Skip to content

feat(versions): declare the app's workflow files - #691

Draft
yurynix wants to merge 3 commits into
mainfrom
feat/dev3-declare-workflow-files
Draft

yurynix wants to merge 3 commits into
mainfrom
feat/dev3-declare-workflow-files

Conversation

@yurynix

@yurynix yurynix commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Note

Description

base44 publish now declares the app's workflow files alongside its entities and agents, so a recorded version captures the workflows the build produced. The payloads go up raw — keyed the way the platform names the same file — and workflows is always sent, {} for an app with none, because the platform requires the field and refuses a declare without it. Workflows follow the platform's own reading of that directory, which differs from entities and agents in two rules: only .jsonc counts (a .json file there is an ordinary file), and dot-files count (.draft.jsonc is the workflow .draft).

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • core/version/artifacts.ts: collectResources now also reads the workflows directory and returns a workflows map; readRawResources takes options for the extension glob and for including dot-files, so workflows are restricted to CONFIG_FILE_EXTENSION (.jsonc) and read with dot: true, while entities and agents keep {json,jsonc} and skip dot-files. Keys are the file path with the extension stripped, so workflows/daily-digest.jsonc → daily-digest, a hidden .draft.jsonc → .draft, and a nested file keeps its relative path (sub/x).
  • core/version/schema.ts: added workflows: Record<string, unknown> to ArtifactSet, documented as always-sent ({} when empty); the actors comment now states the same contract.
  • core/version/api.ts: createVersion sends workflows in the declare body.
  • core/project/schema.ts: new workflowsDir project-config setting, defaulting to workflows.
  • core/project/target.ts: BuildTarget carries workflowsDir (same default), resolved from configDir like the other resource directories.
  • docs/versions.md: documented the workflows payload, the .jsonc-only and dot-files rules, the always-sent {} contract, and added the workflows keyword. Corrected the actors note: the platform requires the field on every declare and refuses a declare without it with 422 invalid_request, not only for an app that has actors (409 actors_undeclared).

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

New/updated coverage:

  • tests/core/version-artifacts.spec.ts: keying by path (including nested), JSONC parsed and sent raw, .jsonc-only selection, a hidden .draft.jsonc being taken as a workflow, a parse failure naming the file (ConfigInvalidError), and reading from a configured workflowsDir.
  • tests/cli/publish.spec.ts: the declare body carries the fixture's workflow and ignores the .json file beside it; an app with no workflows declares workflows: {}.
  • tests/core/project-target.spec.ts: workflowsDir in the resolved build target.
  • New fixtures under tests/fixtures/publishable/base44/workflows/: daily-digest.jsonc and a notes.json that must be ignored.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

Behind the existing BASE44_VERSIONS_API gate, like the rest of the versions lane. Workflow payloads are deliberately not read through a validated resource reader — the platform's own extractor and validation are authoritative, matching how entities and agents are already handled. The dot-file rule is scoped to workflows: readRawResources defaults to dot: false, so entity and agent collection is unchanged.


🤖 Generated by Claude | 2026-11-04 12:54 UTC | 48ac1e4

The declare body now carries `workflows`: each `base44/workflows/**/*.jsonc`
file, parsed as JSONC and sent raw, keyed by its path under the directory
with `.jsonc` stripped (`daily-digest`, `sub/x`), the key the platform's
`workflow_files_key` derives. Only `.jsonc`: to the platform a `.json` file
there is an ordinary file, not a workflow. Always sent, `{}` for an app with
none, since an absent field means a producer that cannot describe workflows.

The directory is `workflowsDir` in config.jsonc, default `workflows`, beside
`entitiesDir` and `agentsDir`.

Requires an apper that accepts `workflows` on DeclareVersionRequest; an
older one refuses the unknown field with a 422.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.3.1-pr.691.71865f0

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.3.1-pr.691.71865f0"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.3.1-pr.691.71865f0"
  }
}

Preview published to npm registry — try new features instantly!

The platform counts any `.jsonc` under base44/workflows/ as a workflow,
dot-files included, so `.draft.jsonc` is the workflow `.draft`. Skipping
it here would record a version without a workflow the app has. Workflows
only; entities and agents keep globby's default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yurynix
yurynix marked this pull request as draft November 3, 2026 12:44
@yurynix

yurynix commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Do not merge or release yet. apper's DeclareVersionRequest forbids unknown fields, so every publish from this CLI gets a 422 until apper PR 1 (base44/apper#37387, workflows on the declare body) is live in production. This PR stays a draft until then. (The auto-generated description regenerates on each push, so the gate lives here instead.)

apper #37480 makes both fields required on POST versions: a declare
without either is a 422 invalid_request for any app, and the conditional
409s (actors_undeclared, workflows_undeclared) are gone. The CLI already
always sends both, so only the wording changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant