create-flowdular 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/agent-template/.agents/skills/agent-tool-design/SKILL.md +203 -0
- package/agent-template/.agents/skills/auth-security-review/SKILL.md +90 -0
- package/agent-template/.agents/skills/auto-review/SKILL.md +103 -0
- package/agent-template/.agents/skills/bug-hunt/SKILL.md +104 -0
- package/agent-template/.agents/skills/business-agent-design/SKILL.md +182 -0
- package/agent-template/.agents/skills/cli-extension/SKILL.md +108 -0
- package/agent-template/.agents/skills/core-extend/SKILL.md +99 -0
- package/agent-template/.agents/skills/database-adapter/SKILL.md +198 -0
- package/agent-template/.agents/skills/database-adapter/references/first-run-and-matrix.md +105 -0
- package/agent-template/.agents/skills/migration-authoring/SKILL.md +161 -0
- package/agent-template/.agents/skills/module-new/SKILL.md +171 -0
- package/agent-template/.agents/skills/module-update/SKILL.md +91 -0
- package/agent-template/.agents/skills/perf-audit/SKILL.md +98 -0
- package/agent-template/.agents/skills/release-eject-pr/SKILL.md +107 -0
- package/agent-template/.agents/skills/spec-approval/SKILL.md +106 -0
- package/agent-template/.agents/skills/test-hardening/SKILL.md +79 -0
- package/agent-template/.agents/skills/translations-i18n/SKILL.md +78 -0
- package/agent-template/.agents/skills/ux-design/SKILL.md +92 -0
- package/agent-template/.agents/skills/variables/SKILL.md +156 -0
- package/agent-template/.agents/skills/workflow-development/SKILL.md +192 -0
- package/agent-template/.ai/README.md +62 -0
- package/agent-template/.ai/agents/README.md +27 -0
- package/agent-template/.ai/agents/module-executor.md +36 -0
- package/agent-template/.ai/agents/reviewer.md +23 -0
- package/agent-template/.ai/agents/sandbox/agentic-engineer.md +31 -0
- package/agent-template/.ai/agents/sandbox/backend-engineer.md +36 -0
- package/agent-template/.ai/agents/sandbox/business-manager.md +23 -0
- package/agent-template/.ai/agents/sandbox/frontend-engineer.md +27 -0
- package/agent-template/.ai/agents/sandbox/ux-designer.md +23 -0
- package/agent-template/.ai/agents/spec-author.md +29 -0
- package/agent-template/.ai/blueprints/add-migration/README.md +5 -0
- package/agent-template/.ai/blueprints/add-migration/allowed-paths.yaml +23 -0
- package/agent-template/.ai/blueprints/add-migration/blueprint.json +14 -0
- package/agent-template/.ai/blueprints/add-migration/examples/invalid/input-destructive.json +6 -0
- package/agent-template/.ai/blueprints/add-migration/examples/invalid/plan-unnumbered-file.json +9 -0
- package/agent-template/.ai/blueprints/add-migration/examples/valid/input.json +6 -0
- package/agent-template/.ai/blueprints/add-migration/examples/valid/plan.json +9 -0
- package/agent-template/.ai/blueprints/add-migration/gates.yaml +30 -0
- package/agent-template/.ai/blueprints/add-migration/input.schema.json +23 -0
- package/agent-template/.ai/blueprints/add-migration/plan.schema.json +54 -0
- package/agent-template/.ai/blueprints/add-migration/required-files.yaml +18 -0
- package/agent-template/.ai/blueprints/add-migration/spec-requirements.yaml +13 -0
- package/agent-template/.ai/blueprints/add-migration/steps.yaml +62 -0
- package/agent-template/.ai/blueprints/author-spec/README.md +5 -0
- package/agent-template/.ai/blueprints/author-spec/allowed-paths.yaml +7 -0
- package/agent-template/.ai/blueprints/author-spec/blueprint.json +14 -0
- package/agent-template/.ai/blueprints/author-spec/examples/invalid/input-missing-outcome.json +5 -0
- package/agent-template/.ai/blueprints/author-spec/examples/valid/input.json +6 -0
- package/agent-template/.ai/blueprints/author-spec/gates.yaml +13 -0
- package/agent-template/.ai/blueprints/author-spec/input.schema.json +20 -0
- package/agent-template/.ai/blueprints/author-spec/plan.schema.json +14 -0
- package/agent-template/.ai/blueprints/author-spec/required-files.yaml +6 -0
- package/agent-template/.ai/blueprints/author-spec/spec-requirements.yaml +35 -0
- package/agent-template/.ai/blueprints/author-spec/steps.yaml +28 -0
- package/agent-template/.ai/blueprints/author-spec/templates/module.yaml +45 -0
- package/agent-template/.ai/blueprints/bug-fix/README.md +5 -0
- package/agent-template/.ai/blueprints/bug-fix/allowed-paths.yaml +29 -0
- package/agent-template/.ai/blueprints/bug-fix/blueprint.json +14 -0
- package/agent-template/.ai/blueprints/bug-fix/examples/invalid/input-no-symptom.json +4 -0
- package/agent-template/.ai/blueprints/bug-fix/examples/invalid/plan-no-test.json +8 -0
- package/agent-template/.ai/blueprints/bug-fix/examples/valid/input.json +6 -0
- package/agent-template/.ai/blueprints/bug-fix/examples/valid/plan.json +8 -0
- package/agent-template/.ai/blueprints/bug-fix/gates.yaml +30 -0
- package/agent-template/.ai/blueprints/bug-fix/input.schema.json +25 -0
- package/agent-template/.ai/blueprints/bug-fix/plan.schema.json +53 -0
- package/agent-template/.ai/blueprints/bug-fix/required-files.yaml +7 -0
- package/agent-template/.ai/blueprints/bug-fix/spec-requirements.yaml +7 -0
- package/agent-template/.ai/blueprints/bug-fix/steps.yaml +51 -0
- package/agent-template/.ai/blueprints/core-extend/README.md +5 -0
- package/agent-template/.ai/blueprints/core-extend/allowed-paths.yaml +49 -0
- package/agent-template/.ai/blueprints/core-extend/blueprint.json +14 -0
- package/agent-template/.ai/blueprints/core-extend/examples/invalid/input-unknown-package.json +5 -0
- package/agent-template/.ai/blueprints/core-extend/examples/invalid/plan-missing-gates.json +7 -0
- package/agent-template/.ai/blueprints/core-extend/examples/valid/input.json +6 -0
- package/agent-template/.ai/blueprints/core-extend/examples/valid/plan.json +10 -0
- package/agent-template/.ai/blueprints/core-extend/gates.yaml +16 -0
- package/agent-template/.ai/blueprints/core-extend/input.schema.json +54 -0
- package/agent-template/.ai/blueprints/core-extend/plan.schema.json +39 -0
- package/agent-template/.ai/blueprints/core-extend/required-files.yaml +36 -0
- package/agent-template/.ai/blueprints/core-extend/spec-requirements.yaml +17 -0
- package/agent-template/.ai/blueprints/core-extend/steps.yaml +54 -0
- package/agent-template/.ai/blueprints/edit-module/README.md +9 -0
- package/agent-template/.ai/blueprints/edit-module/allowed-paths.yaml +27 -0
- package/agent-template/.ai/blueprints/edit-module/blueprint.json +20 -0
- package/agent-template/.ai/blueprints/edit-module/examples/invalid/input-unknown-change.json +5 -0
- package/agent-template/.ai/blueprints/edit-module/examples/invalid/plan-touches-platform.json +15 -0
- package/agent-template/.ai/blueprints/edit-module/examples/valid/input.json +5 -0
- package/agent-template/.ai/blueprints/edit-module/examples/valid/plan.json +25 -0
- package/agent-template/.ai/blueprints/edit-module/gates.yaml +30 -0
- package/agent-template/.ai/blueprints/edit-module/input.schema.json +31 -0
- package/agent-template/.ai/blueprints/edit-module/plan.schema.json +65 -0
- package/agent-template/.ai/blueprints/edit-module/required-files.yaml +80 -0
- package/agent-template/.ai/blueprints/edit-module/spec-requirements.yaml +15 -0
- package/agent-template/.ai/blueprints/edit-module/steps.yaml +115 -0
- package/agent-template/.ai/blueprints/new-module/README.md +7 -0
- package/agent-template/.ai/blueprints/new-module/allowed-paths.yaml +27 -0
- package/agent-template/.ai/blueprints/new-module/blueprint.json +20 -0
- package/agent-template/.ai/blueprints/new-module/examples/invalid/input-spec-outside-modules.json +4 -0
- package/agent-template/.ai/blueprints/new-module/examples/invalid/plan-unknown-gate.json +8 -0
- package/agent-template/.ai/blueprints/new-module/examples/valid/input.json +5 -0
- package/agent-template/.ai/blueprints/new-module/examples/valid/plan.json +22 -0
- package/agent-template/.ai/blueprints/new-module/gates.yaml +30 -0
- package/agent-template/.ai/blueprints/new-module/input.schema.json +21 -0
- package/agent-template/.ai/blueprints/new-module/plan.schema.json +58 -0
- package/agent-template/.ai/blueprints/new-module/required-files.yaml +73 -0
- package/agent-template/.ai/blueprints/new-module/spec-requirements.yaml +30 -0
- package/agent-template/.ai/blueprints/new-module/steps.yaml +138 -0
- package/agent-template/.ai/blueprints/release/README.md +5 -0
- package/agent-template/.ai/blueprints/release/allowed-paths.yaml +19 -0
- package/agent-template/.ai/blueprints/release/blueprint.json +14 -0
- package/agent-template/.ai/blueprints/release/examples/invalid/input-bad-version.json +4 -0
- package/agent-template/.ai/blueprints/release/examples/invalid/plan-bad-branch.json +7 -0
- package/agent-template/.ai/blueprints/release/examples/valid/input.json +5 -0
- package/agent-template/.ai/blueprints/release/examples/valid/plan.json +20 -0
- package/agent-template/.ai/blueprints/release/gates.yaml +20 -0
- package/agent-template/.ai/blueprints/release/input.schema.json +24 -0
- package/agent-template/.ai/blueprints/release/plan.schema.json +46 -0
- package/agent-template/.ai/blueprints/release/required-files.yaml +19 -0
- package/agent-template/.ai/blueprints/release/spec-requirements.yaml +8 -0
- package/agent-template/.ai/blueprints/release/steps.yaml +47 -0
- package/agent-template/.ai/blueprints/security-review/README.md +5 -0
- package/agent-template/.ai/blueprints/security-review/allowed-paths.yaml +6 -0
- package/agent-template/.ai/blueprints/security-review/blueprint.json +14 -0
- package/agent-template/.ai/blueprints/security-review/examples/invalid/input-unknown-kind.json +4 -0
- package/agent-template/.ai/blueprints/security-review/examples/invalid/plan-finding-without-scenario.json +14 -0
- package/agent-template/.ai/blueprints/security-review/examples/valid/input.json +4 -0
- package/agent-template/.ai/blueprints/security-review/examples/valid/plan.json +19 -0
- package/agent-template/.ai/blueprints/security-review/gates.yaml +22 -0
- package/agent-template/.ai/blueprints/security-review/input.schema.json +20 -0
- package/agent-template/.ai/blueprints/security-review/plan.schema.json +65 -0
- package/agent-template/.ai/blueprints/security-review/required-files.yaml +6 -0
- package/agent-template/.ai/blueprints/security-review/spec-requirements.yaml +9 -0
- package/agent-template/.ai/blueprints/security-review/steps.yaml +38 -0
- package/agent-template/.ai/examples/README.md +8 -0
- package/agent-template/.ai/examples/bad/client-imports-server/README.md +20 -0
- package/agent-template/.ai/examples/bad/client-imports-server/api.ts +12 -0
- package/agent-template/.ai/examples/bad/missing-acl/README.md +23 -0
- package/agent-template/.ai/examples/bad/missing-acl/endpoints.ts +12 -0
- package/agent-template/.ai/examples/bad/tenant-from-body/README.md +19 -0
- package/agent-template/.ai/examples/bad/tenant-from-body/endpoints.ts +33 -0
- package/agent-template/.ai/examples/client-contribution/CustomerListView.tsrx +34 -0
- package/agent-template/.ai/examples/client-contribution/README.md +11 -0
- package/agent-template/.ai/examples/client-contribution/contribution.tsrx +48 -0
- package/agent-template/.ai/examples/client-contribution/index.ts +20 -0
- package/agent-template/.ai/examples/client-contribution/permissions.ts +8 -0
- package/agent-template/.ai/examples/customer-cli-extension/README.md +14 -0
- package/agent-template/.ai/examples/customer-cli-extension/commands.json +17 -0
- package/agent-template/.ai/examples/customer-cli-extension/index.ts +36 -0
- package/agent-template/.ai/examples/module-create/task-packet.json +11 -0
- package/agent-template/.ai/guides/application-development.md +97 -0
- package/agent-template/.ai/policies/capabilities.yaml +164 -0
- package/agent-template/.ai/policies/model-routing.yaml +72 -0
- package/agent-template/.ai/policies/path-ownership.yaml +65 -0
- package/agent-template/.ai/policies/task-budgets.yaml +37 -0
- package/agent-template/.ai/references/catalog/LICENSE +21 -0
- package/agent-template/.ai/references/catalog/migrations/0001_catalog_core.down.sql +2 -0
- package/agent-template/.ai/references/catalog/migrations/0001_catalog_core.up.sql +21 -0
- package/agent-template/.ai/references/catalog/migrations/0002_catalog_history.down.sql +3 -0
- package/agent-template/.ai/references/catalog/migrations/0002_catalog_history.up.sql +20 -0
- package/agent-template/.ai/references/catalog/migrations/0003_catalog_history_service_actors.down.sql +3 -0
- package/agent-template/.ai/references/catalog/migrations/0003_catalog_history_service_actors.up.sql +36 -0
- package/agent-template/.ai/references/catalog/migrations/0004_catalog_idempotency_ledger.down.sql +3 -0
- package/agent-template/.ai/references/catalog/migrations/0004_catalog_idempotency_ledger.up.sql +19 -0
- package/agent-template/.ai/references/catalog/migrations/README.md +3 -0
- package/agent-template/.ai/references/catalog/module.json +27 -0
- package/agent-template/.ai/references/catalog/package.json +49 -0
- package/agent-template/.ai/references/catalog/spec/module.yaml +86 -0
- package/agent-template/.ai/references/catalog/src/acl/permissions.ts +6 -0
- package/agent-template/.ai/references/catalog/src/agent/tools.ts +164 -0
- package/agent-template/.ai/references/catalog/src/api/endpoints.ts +243 -0
- package/agent-template/.ai/references/catalog/src/client/CatalogHistoryDrawer.tsrx +123 -0
- package/agent-template/.ai/references/catalog/src/client/CatalogItemForm.tsrx +190 -0
- package/agent-template/.ai/references/catalog/src/client/CatalogView.tsrx +473 -0
- package/agent-template/.ai/references/catalog/src/client/api.ts +111 -0
- package/agent-template/.ai/references/catalog/src/client/contribution.tsrx +61 -0
- package/agent-template/.ai/references/catalog/src/client/index.ts +18 -0
- package/agent-template/.ai/references/catalog/src/client/navigation-copy.ts +9 -0
- package/agent-template/.ai/references/catalog/src/client/state.ts +24 -0
- package/agent-template/.ai/references/catalog/src/domain/types.ts +32 -0
- package/agent-template/.ai/references/catalog/src/domain/variables.ts +111 -0
- package/agent-template/.ai/references/catalog/src/index.ts +31 -0
- package/agent-template/.ai/references/catalog/src/platform.ts +35 -0
- package/agent-template/.ai/references/catalog/src/server/index.ts +4 -0
- package/agent-template/.ai/references/catalog/src/server/runtime.ts +86 -0
- package/agent-template/.ai/references/catalog/src/services/catalog-service.ts +306 -0
- package/agent-template/.ai/references/catalog/src/services/database-repository.ts +440 -0
- package/agent-template/.ai/references/catalog/src/services/index.ts +4 -0
- package/agent-template/.ai/references/catalog/src/services/migration.ts +171 -0
- package/agent-template/.ai/references/catalog/src/services/repository.ts +36 -0
- package/agent-template/.ai/references/catalog/src/services/target-idempotency.ts +59 -0
- package/agent-template/.ai/references/catalog/tests/agent-tools.test.ts +277 -0
- package/agent-template/.ai/references/catalog/tests/endpoints.test.ts +320 -0
- package/agent-template/.ai/references/catalog/tests/idempotency.test.ts +297 -0
- package/agent-template/.ai/references/catalog/tests/migrations.test.ts +149 -0
- package/agent-template/.ai/references/catalog/tests/module.test.ts +271 -0
- package/agent-template/.ai/references/catalog/tests/support/database.ts +76 -0
- package/agent-template/.ai/references/catalog/translations/en.json +101 -0
- package/agent-template/.ai/references/catalog/translations/pl.json +101 -0
- package/agent-template/.ai/references/catalog/tsconfig.json +15 -0
- package/agent-template/.ai/references/catalog/vitest.config.ts +16 -0
- package/agent-template/.ai/references/catalog.provenance.json +55 -0
- package/agent-template/.ai/rules/flowdular.md +86 -0
- package/agent-template/.ai/skills/README.md +36 -0
- package/agent-template/.ai/skills/agent-tool-design/SKILL.md +209 -0
- package/agent-template/.ai/skills/auth-security-review/SKILL.md +96 -0
- package/agent-template/.ai/skills/auto-review/SKILL.md +112 -0
- package/agent-template/.ai/skills/bug-hunt/SKILL.md +110 -0
- package/agent-template/.ai/skills/business-agent-design/SKILL.md +188 -0
- package/agent-template/.ai/skills/cli-extension/SKILL.md +114 -0
- package/agent-template/.ai/skills/core-extend/SKILL.md +104 -0
- package/agent-template/.ai/skills/database-adapter/SKILL.md +204 -0
- package/agent-template/.ai/skills/database-adapter/references/first-run-and-matrix.md +105 -0
- package/agent-template/.ai/skills/migration-authoring/SKILL.md +167 -0
- package/agent-template/.ai/skills/module-new/SKILL.md +180 -0
- package/agent-template/.ai/skills/module-update/SKILL.md +100 -0
- package/agent-template/.ai/skills/perf-audit/SKILL.md +105 -0
- package/agent-template/.ai/skills/release-eject-pr/SKILL.md +113 -0
- package/agent-template/.ai/skills/spec-approval/SKILL.md +112 -0
- package/agent-template/.ai/skills/test-hardening/SKILL.md +86 -0
- package/agent-template/.ai/skills/translations-i18n/SKILL.md +85 -0
- package/agent-template/.ai/skills/ux-design/SKILL.md +97 -0
- package/agent-template/.ai/skills/variables/SKILL.md +164 -0
- package/agent-template/.ai/skills/workflow-development/SKILL.md +199 -0
- package/agent-template/.claude/skills/agent-tool-design/SKILL.md +203 -0
- package/agent-template/.claude/skills/auth-security-review/SKILL.md +90 -0
- package/agent-template/.claude/skills/auto-review/SKILL.md +103 -0
- package/agent-template/.claude/skills/bug-hunt/SKILL.md +104 -0
- package/agent-template/.claude/skills/business-agent-design/SKILL.md +182 -0
- package/agent-template/.claude/skills/cli-extension/SKILL.md +108 -0
- package/agent-template/.claude/skills/core-extend/SKILL.md +99 -0
- package/agent-template/.claude/skills/database-adapter/SKILL.md +198 -0
- package/agent-template/.claude/skills/database-adapter/references/first-run-and-matrix.md +105 -0
- package/agent-template/.claude/skills/migration-authoring/SKILL.md +161 -0
- package/agent-template/.claude/skills/module-new/SKILL.md +171 -0
- package/agent-template/.claude/skills/module-update/SKILL.md +91 -0
- package/agent-template/.claude/skills/perf-audit/SKILL.md +98 -0
- package/agent-template/.claude/skills/release-eject-pr/SKILL.md +107 -0
- package/agent-template/.claude/skills/spec-approval/SKILL.md +106 -0
- package/agent-template/.claude/skills/test-hardening/SKILL.md +79 -0
- package/agent-template/.claude/skills/translations-i18n/SKILL.md +78 -0
- package/agent-template/.claude/skills/ux-design/SKILL.md +92 -0
- package/agent-template/.claude/skills/variables/SKILL.md +156 -0
- package/agent-template/.claude/skills/workflow-development/SKILL.md +192 -0
- package/agent-template/AGENTS.md +77 -0
- package/agent-template/CLAUDE.md +77 -0
- package/agent-template/docs/adr/0001-development-reload.md +16 -0
- package/agent-template/docs/adr/0002-durable-agent-execution.md +21 -0
- package/agent-template/docs/adr/0003-module-settings.md +22 -0
- package/agent-template/docs/adr/0004-enterprise-access-and-audit.md +36 -0
- package/agent-template/docs/adr/0005-sandbox-runtime-and-coding-agents.md +81 -0
- package/agent-template/docs/adr/0006-agentic-workflows.md +1702 -0
- package/agent-template/docs/adr/0007-module-owned-agents.md +429 -0
- package/agent-template/docs/adr/0008-database-adapter-contract.md +90 -0
- package/agent-template/docs/agent-contract.md +45 -0
- package/agent-template/docs/configuration.md +122 -0
- package/agent-template/docs/database-adapters.md +346 -0
- package/agent-template/docs/design-system.md +217 -0
- package/agent-template/docs/modules.md +146 -0
- package/agent-template/platform/scripts/build.mjs +38 -0
- package/agent-template/rulesync.jsonc +11 -0
- package/dist/bin.js +3 -1
- package/package.json +3 -2
- package/template/default/.prettierignore +9 -0
- package/template/default/README.md +12 -0
- package/template/default/flowdular.json +3 -3
- package/template/default/package.json +6 -2
- package/template/default/platform/octane.config.ts +17 -6
- package/template/default/platform/package.json +2 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!-- Source: .ai/rules/flowdular.md. Run pnpm rules:generate; never edit generated copies. -->
|
|
2
|
+
|
|
3
|
+
# Flowdular
|
|
4
|
+
|
|
5
|
+
An agentic foundation that businesses extend with their own modules.
|
|
6
|
+
|
|
7
|
+
## One task, one skill
|
|
8
|
+
|
|
9
|
+
Choose the most specific task in `.ai/skills/README.md` and read only that
|
|
10
|
+
`.ai/skills/<name>/SKILL.md`. Announce the choice briefly. For a multi-part
|
|
11
|
+
request, finish one bounded phase before switching skills. Do not recursively
|
|
12
|
+
load other skills mentioned by a skill. Read referenced code or documentation
|
|
13
|
+
only when the current task needs it. Explicit user instructions take priority.
|
|
14
|
+
|
|
15
|
+
Sandbox: use the single skill named under Session, at
|
|
16
|
+
`reference/skills/<name>/SKILL.md`. Follow the role's write paths and handoff list.
|
|
17
|
+
Do not load the whole skill catalog into the task context.
|
|
18
|
+
|
|
19
|
+
## Always-active invariants
|
|
20
|
+
|
|
21
|
+
1. Stay within the requested scope. Preserve other agents' edits. Read the owning
|
|
22
|
+
code before changing it. Do not invent missing business decisions.
|
|
23
|
+
2. Spec-first: a new module requires an approved `spec/module.yaml`. Sandbox
|
|
24
|
+
implementation requires operator approval of the exact current spec hash;
|
|
25
|
+
any spec change invalidates it. Never infer or grant approval yourself.
|
|
26
|
+
Only explicit user approval naming a spec permits the host `spec-approval` action.
|
|
27
|
+
3. Deny by default. Use `defineEndpoint`, an explicit permission and identity
|
|
28
|
+
resolver. Mutations enforce CSRF and bounded input validation.
|
|
29
|
+
4. Tenant identity comes from the authenticated principal, never request input.
|
|
30
|
+
Use bound SQL, tenant predicates and `transaction(..., { tenantId, access })`.
|
|
31
|
+
Tenant tables enforce RLS with `USING` and `WITH CHECK`. Runtime roles have
|
|
32
|
+
neither superuser nor `BYPASSRLS`; migration leases are for DDL only.
|
|
33
|
+
5. Never expose credentials in output, logs or audit. Cross-module access uses
|
|
34
|
+
declared public capabilities or registered tools, never another module's DB.
|
|
35
|
+
Agent instructions cannot expand permissions or tool grants.
|
|
36
|
+
6. Persist background work before acknowledging it. Preserve idempotency,
|
|
37
|
+
leases, recovery and audit evidence. Drain async work before releasing resources.
|
|
38
|
+
7. Applied migrations are immutable. Add numbered PostgreSQL SQL and mirror it
|
|
39
|
+
byte for byte in `databaseMigrations`. Never bypass checksum or adoption checks.
|
|
40
|
+
8. Generated composition is CLI-owned: `platform/octane.config.ts`,
|
|
41
|
+
`platform/src/App.tsrx`, `platform/src/generated/**`, platform package
|
|
42
|
+
dependencies and `flowdular.json` enabled modules. Use `module enable/sync --apply`.
|
|
43
|
+
Declare imports and dependencies; keep module, package and spec versions aligned.
|
|
44
|
+
9. Use shared `@flowdular/sdk/ui` components and tokens. Keep all locales in sync.
|
|
45
|
+
UI states: loading, empty, error, populated, denied. Inspect rendered UI after changes.
|
|
46
|
+
10. Prove fixes with regression tests. Never skip assertions, weaken isolation or
|
|
47
|
+
hide errors to make gates green. Run scoped checks, then `pnpm verify` before a PR.
|
|
48
|
+
Finish implementation, then run the `auto-review` skill as a separate phase
|
|
49
|
+
before completion or delivery. Report actual results and remaining failures.
|
|
50
|
+
11. Destructive actions require the runner's flags and explicit scope.
|
|
51
|
+
`setup quick` and `auth greenfield` are local resets: preview, stop the app,
|
|
52
|
+
never target a custom or deployed DB. Sandbox agents cannot install, use
|
|
53
|
+
network/git, or touch a DB outside their module tests.
|
|
54
|
+
12. Keep handoffs short and factual. No AI attribution footers or em/en dashes.
|
|
55
|
+
Sandbox final line: `HANDOFF: <allowed-role> - <why>` or
|
|
56
|
+
`HANDOFF: none - <why>`, never your own role.
|
|
57
|
+
|
|
58
|
+
Detailed recipes: `docs/agent-contract.md` (lookup only).
|
|
59
|
+
Reference module: `.ai/references/catalog`; visual contract: `docs/design-system.md`.
|
|
60
|
+
|
|
61
|
+
## Application workspace
|
|
62
|
+
|
|
63
|
+
For application work, use the path and task map in
|
|
64
|
+
.ai/guides/application-development.md.
|
|
65
|
+
|
|
66
|
+
This is a generated application consuming the published Flowdular SDK. Extend
|
|
67
|
+
this application's modules; never edit installed dependencies. Upstream paths
|
|
68
|
+
such as packages/server and core modules/auth refer to the read-only SDK under
|
|
69
|
+
platform/node_modules/@flowdular/sdk after installation. Sandbox implementation
|
|
70
|
+
sources belong to the separate @flowdular/sandbox package. A core change must be
|
|
71
|
+
made in the Flowdular repository and released before this application uses it.
|
|
72
|
+
|
|
73
|
+
The skills and examples use @flowdular/sdk subpath imports. For pnpm --filter,
|
|
74
|
+
read the actual module package name from its package.json. Use pnpm verify and
|
|
75
|
+
pnpm build for this application. Root .ai files are editable project guidance;
|
|
76
|
+
run pnpm rules:generate after changing rules or skills, then pnpm rules:check.
|
|
77
|
+
AGENTS.md, CLAUDE.md, .agents/skills and .claude/skills are generated copies.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!-- Source: .ai/rules/flowdular.md. Run pnpm rules:generate; never edit generated copies. -->
|
|
2
|
+
|
|
3
|
+
# Flowdular
|
|
4
|
+
|
|
5
|
+
An agentic foundation that businesses extend with their own modules.
|
|
6
|
+
|
|
7
|
+
## One task, one skill
|
|
8
|
+
|
|
9
|
+
Choose the most specific task in `.ai/skills/README.md` and read only that
|
|
10
|
+
`.ai/skills/<name>/SKILL.md`. Announce the choice briefly. For a multi-part
|
|
11
|
+
request, finish one bounded phase before switching skills. Do not recursively
|
|
12
|
+
load other skills mentioned by a skill. Read referenced code or documentation
|
|
13
|
+
only when the current task needs it. Explicit user instructions take priority.
|
|
14
|
+
|
|
15
|
+
Sandbox: use the single skill named under Session, at
|
|
16
|
+
`reference/skills/<name>/SKILL.md`. Follow the role's write paths and handoff list.
|
|
17
|
+
Do not load the whole skill catalog into the task context.
|
|
18
|
+
|
|
19
|
+
## Always-active invariants
|
|
20
|
+
|
|
21
|
+
1. Stay within the requested scope. Preserve other agents' edits. Read the owning
|
|
22
|
+
code before changing it. Do not invent missing business decisions.
|
|
23
|
+
2. Spec-first: a new module requires an approved `spec/module.yaml`. Sandbox
|
|
24
|
+
implementation requires operator approval of the exact current spec hash;
|
|
25
|
+
any spec change invalidates it. Never infer or grant approval yourself.
|
|
26
|
+
Only explicit user approval naming a spec permits the host `spec-approval` action.
|
|
27
|
+
3. Deny by default. Use `defineEndpoint`, an explicit permission and identity
|
|
28
|
+
resolver. Mutations enforce CSRF and bounded input validation.
|
|
29
|
+
4. Tenant identity comes from the authenticated principal, never request input.
|
|
30
|
+
Use bound SQL, tenant predicates and `transaction(..., { tenantId, access })`.
|
|
31
|
+
Tenant tables enforce RLS with `USING` and `WITH CHECK`. Runtime roles have
|
|
32
|
+
neither superuser nor `BYPASSRLS`; migration leases are for DDL only.
|
|
33
|
+
5. Never expose credentials in output, logs or audit. Cross-module access uses
|
|
34
|
+
declared public capabilities or registered tools, never another module's DB.
|
|
35
|
+
Agent instructions cannot expand permissions or tool grants.
|
|
36
|
+
6. Persist background work before acknowledging it. Preserve idempotency,
|
|
37
|
+
leases, recovery and audit evidence. Drain async work before releasing resources.
|
|
38
|
+
7. Applied migrations are immutable. Add numbered PostgreSQL SQL and mirror it
|
|
39
|
+
byte for byte in `databaseMigrations`. Never bypass checksum or adoption checks.
|
|
40
|
+
8. Generated composition is CLI-owned: `platform/octane.config.ts`,
|
|
41
|
+
`platform/src/App.tsrx`, `platform/src/generated/**`, platform package
|
|
42
|
+
dependencies and `flowdular.json` enabled modules. Use `module enable/sync --apply`.
|
|
43
|
+
Declare imports and dependencies; keep module, package and spec versions aligned.
|
|
44
|
+
9. Use shared `@flowdular/sdk/ui` components and tokens. Keep all locales in sync.
|
|
45
|
+
UI states: loading, empty, error, populated, denied. Inspect rendered UI after changes.
|
|
46
|
+
10. Prove fixes with regression tests. Never skip assertions, weaken isolation or
|
|
47
|
+
hide errors to make gates green. Run scoped checks, then `pnpm verify` before a PR.
|
|
48
|
+
Finish implementation, then run the `auto-review` skill as a separate phase
|
|
49
|
+
before completion or delivery. Report actual results and remaining failures.
|
|
50
|
+
11. Destructive actions require the runner's flags and explicit scope.
|
|
51
|
+
`setup quick` and `auth greenfield` are local resets: preview, stop the app,
|
|
52
|
+
never target a custom or deployed DB. Sandbox agents cannot install, use
|
|
53
|
+
network/git, or touch a DB outside their module tests.
|
|
54
|
+
12. Keep handoffs short and factual. No AI attribution footers or em/en dashes.
|
|
55
|
+
Sandbox final line: `HANDOFF: <allowed-role> - <why>` or
|
|
56
|
+
`HANDOFF: none - <why>`, never your own role.
|
|
57
|
+
|
|
58
|
+
Detailed recipes: `docs/agent-contract.md` (lookup only).
|
|
59
|
+
Reference module: `.ai/references/catalog`; visual contract: `docs/design-system.md`.
|
|
60
|
+
|
|
61
|
+
## Application workspace
|
|
62
|
+
|
|
63
|
+
For application work, use the path and task map in
|
|
64
|
+
.ai/guides/application-development.md.
|
|
65
|
+
|
|
66
|
+
This is a generated application consuming the published Flowdular SDK. Extend
|
|
67
|
+
this application's modules; never edit installed dependencies. Upstream paths
|
|
68
|
+
such as packages/server and core modules/auth refer to the read-only SDK under
|
|
69
|
+
platform/node_modules/@flowdular/sdk after installation. Sandbox implementation
|
|
70
|
+
sources belong to the separate @flowdular/sandbox package. A core change must be
|
|
71
|
+
made in the Flowdular repository and released before this application uses it.
|
|
72
|
+
|
|
73
|
+
The skills and examples use @flowdular/sdk subpath imports. For pnpm --filter,
|
|
74
|
+
read the actual module package name from its package.json. Use pnpm verify and
|
|
75
|
+
pnpm build for this application. Root .ai files are editable project guidance;
|
|
76
|
+
run pnpm rules:generate after changing rules or skills, then pnpm rules:check.
|
|
77
|
+
AGENTS.md, CLAUDE.md, .agents/skills and .claude/skills are generated copies.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# ADR 0001: Development reload boundaries
|
|
2
|
+
|
|
3
|
+
- Status: accepted
|
|
4
|
+
- Date: 2026-08-31
|
|
5
|
+
|
|
6
|
+
## Decision
|
|
7
|
+
|
|
8
|
+
The application shell uses Vite HMR during development. TSRX, styles, and ordinary client modules update without restarting the full application server.
|
|
9
|
+
|
|
10
|
+
`platform/scripts/dev.mjs` owns the developer-facing startup output. The default view shows the application URL, authentication adapter, and reload status while suppressing repeated tool warnings. `--verbose` exposes native Vite and plugin diagnostics. File-change messages use the stable `[octane:reload]` framework prefix, and persistence under `.flowdular/data` is excluded from the watcher.
|
|
11
|
+
|
|
12
|
+
`platform/index.html` includes a small critical splash outside the hydration root. It is visible from the first HTML frame and remains through session resolution, workspace selection, module loading, and workspace preparation. The authenticated or anonymous root dispatches `flowdular:ready` only when the first stable application state is ready. The splash then leaves after a minimum display interval, respects reduced-motion preferences, and is disabled when JavaScript is unavailable. This prevents an unstyled workspace-selection frame and removes white transitions before authentication or the application shell.
|
|
13
|
+
|
|
14
|
+
State-preserving HMR is deferred. Segment already provides dehydration and hydration primitives, but preserving state across code changes needs an explicit compatibility contract for schema versions, invalid snapshots, module disposal, and server-rendered state. Until that contract exists, a full module replacement may reset local shell state.
|
|
15
|
+
|
|
16
|
+
The sandbox preview runtime will own the future state-preserving behavior because it can isolate one module, fixture, and state schema without affecting the full ERP runtime.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ADR 0002: Durable agent execution
|
|
2
|
+
|
|
3
|
+
- Status: accepted; the storage paragraph is superseded (2026-09)
|
|
4
|
+
- Date: 2026-08-31
|
|
5
|
+
|
|
6
|
+
> Superseded in part (2026-09): `agents.core` no longer owns a SQLite file. It
|
|
7
|
+
> holds the same data in the shared platform PostgreSQL database through a
|
|
8
|
+
> provider lease. Everything else here, including the rule that this data is not
|
|
9
|
+
> an integration path, is unchanged.
|
|
10
|
+
|
|
11
|
+
## Decision
|
|
12
|
+
|
|
13
|
+
`agents.core` owns tenant-scoped agent definitions, a durable execution queue, run history, execution events, and module-local audit evidence. An enqueue request commits a queued run before it returns `202 Accepted`. A background worker claims work with an expiring lease, renews the lease while active, and recovers queued or expired claims after runtime restart.
|
|
14
|
+
|
|
15
|
+
The browser and session that requested a run do not own its lifecycle. Closing the page, navigating away, or signing out after the enqueue commit does not cancel the run. The run stores an immutable snapshot of the agent revision, provider, model, limits, input, initiating subject, tool grants, and permission evidence used to authorize the request.
|
|
16
|
+
|
|
17
|
+
Agent instructions are data, not authority. The harness exposes only tools registered by the platform composition root. Each tool records either an approved API endpoint identifier or an approved CLI capability identifier, declares required permissions, and receives a trusted tenant and subject context. Agent code must not import business repositories, open another module's database, execute arbitrary shell commands, or load executable code at runtime.
|
|
18
|
+
|
|
19
|
+
The local simulation provider is deterministic and performs no network request. Production providers and business tools must be registered explicitly and receive separate specifications, secret handling, budgets, rate limits, and operational monitoring.
|
|
20
|
+
|
|
21
|
+
`agents.core` may use its own SQLite database for agent definitions, queue state, events, and audit records. That database is not an integration path to ERP business data.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# ADR 0003: Namespaced module settings
|
|
2
|
+
|
|
3
|
+
- Status: accepted, runtime implemented 2026-09-01
|
|
4
|
+
- Date: 2026-08-31
|
|
5
|
+
|
|
6
|
+
## Decision
|
|
7
|
+
|
|
8
|
+
Every setting is declared and owned by one module. Its stable key is the module identifier plus a module-local key, such as `auth.core.allowSignUp`. A declaration fixes the value type, default value, visibility, client exposure, and secret status.
|
|
9
|
+
|
|
10
|
+
A module may read another module's setting only when its manifest declares a direct dependency on the owner and the setting is explicitly marked shared. Private or secret settings never cross that boundary. Secret settings cannot be included in a client snapshot.
|
|
11
|
+
|
|
12
|
+
The first setting is `auth.core.allowSignUp`. The server is authoritative and rejects sign-up when it is disabled. The client configuration endpoint exposes only the client-safe boolean so the public authentication screen can hide the sign-up action. The environment variable `FD_AUTH_ALLOW_SIGN_UP` supplies the initial deployment value.
|
|
13
|
+
|
|
14
|
+
## Runtime (amendment, 2026-09-01)
|
|
15
|
+
|
|
16
|
+
- `@flowdular/sdk/kernel` exports `ModuleSettingsRuntime` (`declare`, `get`, `list`, `set`, `onChange`) and `createModuleSettingsRuntime(store)`. Values live in `module_settings` in auth.db (`tenant_id`, `module_id`, `key`, `value_json`, `updated_at`, `updated_by`); `auth.core` provides the store and exposes the runtime as `authRuntime.moduleSettings`.
|
|
17
|
+
- A setting is tenant-scoped by default. `scope: 'platform'` stores one value for the whole deployment (tenant id `''`); auth uses it for knobs that apply before a tenant is known (sign-up, session policy, password length, sign-in providers).
|
|
18
|
+
- Environment variables only supply the declared default. A stored value wins at read time; reads are live, never snapshotted at boot.
|
|
19
|
+
- A module declares settings by returning `settings` from `createServerComposition`; the platform registers every declaration after composing, then calls each composition's `start()`.
|
|
20
|
+
- Administration: `GET /api/settings` (`system.settings.read`) lists every declaration with its current tenant value and metadata; `POST /api/settings/update` (`system.settings.manage`, session only) validates against the declaration, stores or clears the value, and appends `settings.updated` to the auth audit trail. Secrets are write-only: the API returns whether a value is set, never the value. Administration > Modules renders the selected module's declarations in its Settings drawer section. Administration > Settings contains only workspace and organization settings.
|
|
21
|
+
- `emailConfirmation` cannot be enabled while no mail transport is composed; the API refuses with `MAIL_TRANSPORT_REQUIRED` and the screen shows the setting as locked.
|
|
22
|
+
- The cross-module read rule (declared dependency, shared, non-secret) is not enforced by `get`; it is a review rule until a requester-aware read exists.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ADR 0004: Enterprise access and audit boundaries
|
|
2
|
+
|
|
3
|
+
- Status: proposed; first increment landed in auth.core on 2026-09-01
|
|
4
|
+
- Date: 2026-08-31
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
The current authentication core provides tenant membership roles and explicit scopes. Module endpoints deny missing scopes, Development is owner-only, and agent runs snapshot the initiating subject and authorization evidence. This is a secure first phase, but it is not the complete enterprise RBAC and audit model.
|
|
9
|
+
|
|
10
|
+
## Proposed direction
|
|
11
|
+
|
|
12
|
+
`access.core` should own custom roles, permission grants, user and group assignments, resource constraints, temporary grants, segregation-of-duties policies, and an authorization decision API. Business modules should depend on this API instead of interpreting role names.
|
|
13
|
+
|
|
14
|
+
`audit.core` should own a central append-only event contract, tenant and actor indexing, integrity verification, retention policy, redaction, export, and external sink delivery. Module-local audit writers should publish into that contract. Sensitive values, credentials, raw session tokens, and unrestricted request bodies must never enter audit metadata.
|
|
15
|
+
|
|
16
|
+
Background agents should receive a bounded execution grant at enqueue time. Every API or CLI tool invocation must still pass through the target capability's server-side authorization and audit boundary. Revocation policy for queued work, approval workflows, privileged access, and emergency access require explicit acceptance scenarios before implementation.
|
|
17
|
+
|
|
18
|
+
Until those modules are approved and implemented, the platform must describe its current model as scope-based authorization with module-local audit evidence, not full enterprise RBAC or centralized compliance audit.
|
|
19
|
+
|
|
20
|
+
## First increment in auth.core (amendment, 2026-09-01)
|
|
21
|
+
|
|
22
|
+
Custom roles and the auth audit trail now live in `auth.core`, sized to what a workspace administrator needs today and shaped so `access.core` and `audit.core` can take them over without a data migration of meaning:
|
|
23
|
+
|
|
24
|
+
- `auth_roles` holds one row per tenant role. The built-in `owner` and `member` rows are seeded per tenant from the static scope lists and are read-only; custom roles carry a subset of the scopes the workspace can grant (`AuthService.listGrantableScopes`). `auth_memberships.role_id` points at the row and the legacy `role` string stays in sync. Assigning a role replaces the membership scopes with the role's scopes; changing a role's scopes updates every holder; a role in use cannot be deleted. Endpoints: `/api/auth/roles` (`auth.roles.read`, `auth.roles.manage`).
|
|
25
|
+
- Member administration goes through the auth administration port with the acting principal: only an owner may create, promote, or change an owner; a non-owner may only hand out scopes it holds; a tenant always keeps one active owner; nobody edits their own membership from the directory.
|
|
26
|
+
- `auth_audit` is an append-only, tenant-indexed table (`tenant_id, actor, action, subject_type, subject_id, metadata_json, occurred_at`) written for sign-in success, failure, and lockout, sign-out, session revocation, password change and reset, token issue and revoke, member create, update, status, scopes, role, and removal, role create, update, and delete, workspace rename, and settings updates. It is readable per tenant through `GET /api/auth/audit` (`auth.audit.read`) with a cursor on `(occurred_at, id)`. Metadata never carries credentials, raw tokens, or request bodies. Unauthenticated failures for unknown addresses are not attributed to any tenant. Hash chaining, retention, export, and sinks remain with `audit.core`.
|
|
27
|
+
|
|
28
|
+
## Unified audit history (amendment, 2026-09-01)
|
|
29
|
+
|
|
30
|
+
The three module-local trails are now readable from one screen without merging their storage. `auth.core`'s Administration > Audit view carries a source selector (Platform, Agents, Sandbox), derived from the reader's scopes, and renders any source in one table (time, actor, action, subject, details).
|
|
31
|
+
|
|
32
|
+
- Agents: `GET /api/agent-audit` and `GET /api/agent-audit/verify`, both behind `agents.runs.read`.
|
|
33
|
+
- Sandbox: `GET /api/sandbox/audit` and `GET /api/sandbox/audit/verify`, both behind `sandbox.sessions.read` (the list moved off `sandbox.access.manage` so a read scope guards a read).
|
|
34
|
+
- Auth: `GET /api/auth/audit` (`auth.audit.read`), unchanged.
|
|
35
|
+
|
|
36
|
+
Every list endpoint is tenant-scoped from the principal and pages on `(occurred_at, id)`. For the hash-chained agent and sandbox trails the second half of the cursor is the append `sequence`, which is the row's position in the chain and the order the `(tenant_id, occurred_at, sequence)` index keeps. Those two trails are hash-chained; their verify endpoint recomputes the chain and returns `{ verified, brokenAt }` from the same repository walk the `flowdular <module> audit-verify` CLI uses, so the CLI and the endpoint cannot drift. The platform trail is append-only but not chained, so it shows no integrity indicator. Central hash chaining across trails, retention, export, and sinks still belong to `audit.core`.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# ADR 0005: Sandbox runtime, coding agents, and sandbox access
|
|
2
|
+
|
|
3
|
+
- Status: accepted
|
|
4
|
+
- Date: 2026-08-31
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
Part 2 of the architecture describes an agentic sandbox that builds one module in isolation and previews it without booting the complete platform. Three questions were left open: how the sandbox is distributed, which agent writes the module source, and how a person is authorized to use it.
|
|
9
|
+
|
|
10
|
+
The platform already ships `agents.core` and `@flowdular/sdk/harness`. That runtime is a shared in-product capability: business modules use it to run bounded agents against registered API and CLI tools. It is deliberately not a coding agent. It cannot open a workspace, edit source files, or run gates, and it must not gain those powers.
|
|
11
|
+
|
|
12
|
+
## Decision
|
|
13
|
+
|
|
14
|
+
### Distribution and runtime modes
|
|
15
|
+
|
|
16
|
+
The sandbox is an independently executable package, `@flowdular/sandbox`, with a `flowdular-sandbox` binary. It is started from a Flowdular workspace and discovers that workspace by walking up to `flowdular.json`. Its first-class launch path is `npx @flowdular/sandbox`.
|
|
17
|
+
|
|
18
|
+
It runs in one of two modes.
|
|
19
|
+
|
|
20
|
+
- `loopback`: the default for a developer machine. It binds a loopback interface only and may offer locally installed coding agent binaries.
|
|
21
|
+
- `self-hosted`: a deployed sandbox. It binds a configured interface, requires the same session and grant checks, and never offers local binaries. Bring-your-own-key providers are the only coding agent backends.
|
|
22
|
+
|
|
23
|
+
The mode is explicit configuration, not inference. A sandbox that cannot prove it is loopback treats itself as self-hosted.
|
|
24
|
+
|
|
25
|
+
### Coding agent adapter
|
|
26
|
+
|
|
27
|
+
Coding agents are a separate contract in `@flowdular/coding-agent`. A driver receives a session workspace, a bounded instruction, and a turn input, and returns an ordered stream of normalized events: assistant text, reasoning summary, tool activity, file change, error, and turn completion with usage.
|
|
28
|
+
|
|
29
|
+
Three drivers are bundled.
|
|
30
|
+
|
|
31
|
+
- `claude-code`: the locally installed `claude` binary in print mode with a streamed JSON protocol, restricted tools, and the session workspace as its only writable directory. It uses the operator's existing subscription login. Loopback only.
|
|
32
|
+
- `codex`: the locally installed `codex` binary in `exec` mode with JSONL events and a workspace-write sandbox. Loopback only.
|
|
33
|
+
- `byok`: the Vercel AI SDK with Anthropic, OpenAI, Azure OpenAI, and OpenAI-compatible kinds, driving the sandbox's own bounded file and gate tools. Available in both modes and required in `self-hosted`.
|
|
34
|
+
|
|
35
|
+
A driver is offered only after a capability probe succeeds. Local drivers are probed by executing the binary's version command; the byok driver is probed by an existing credential. The driver is chosen when the session is created, next to the brief, and is recorded in the session's audit trail. Roles are never chosen by hand at that point: the planner picks the first specialist and the handoff decides every later one.
|
|
36
|
+
|
|
37
|
+
The two agent systems stay separate. The sandbox never uses `@flowdular/sdk/harness` to write code, and `agents.core` never gains file system or process tools. A draft module that uses `agents.core` is previewed through the normal module contract.
|
|
38
|
+
|
|
39
|
+
### Turn handoff
|
|
40
|
+
|
|
41
|
+
A turn ends with a decision about who continues, never with silence. Each role closes its final message with one handoff line naming the next specialist or `none`. The orchestrator validates that line against the registered roles and falls back to the deterministic state routing when it is missing or unknown, so a driver that ignores the instruction still produces a usable next step.
|
|
42
|
+
|
|
43
|
+
The resulting plan is durable, written into the transcript with the turn that produced it, and has five shapes: `continue` (a specialist takes over with a prompt carrying the original brief), `approval` (a new module's draft specification waits for the operator, who approves it with one click that moves only the `status` line), `question` (the turn changed nothing and needs an answer), `review` (the work is ready to inspect and eject), and `blocked` (the driver errored).
|
|
44
|
+
|
|
45
|
+
A `continue` runs by itself while the session's auto handoff is on, bounded to a small number of chained turns per operator message, and otherwise waits behind a button. A failed gate is its own handoff back to the specialist that caused it, so a broken change never travels down the chain.
|
|
46
|
+
|
|
47
|
+
### Preview and data
|
|
48
|
+
|
|
49
|
+
A session owns an isolated workspace directory and an ephemeral database. The sandbox composes the draft module's server routes at their declared paths and renders its client contribution inside a preview host that supplies the platform's identity, tenant, locale, and ACL contracts.
|
|
50
|
+
|
|
51
|
+
Preview data has two modes. `fixtures` is the default and is fully offline. `bridge` forwards any API path the draft does not own to a running full platform, using a server-held session for the signed-in account, so a draft screen can read real records from other enabled modules under the platform's own authorization. The bridge is refused when the session lacks the data scope, when the target origin is not configured, or when the sandbox runs without an authenticated principal.
|
|
52
|
+
|
|
53
|
+
### Access
|
|
54
|
+
|
|
55
|
+
`sandbox.core` is a normal module of the full platform. It owns sandbox scopes, tenant-scoped access grants, session metadata, and its audit evidence. Access is created and assigned either from the full application, by an owner with the management scope, or from the CLI with `flowdular sandbox` commands. Both paths write the same grant records.
|
|
56
|
+
|
|
57
|
+
Signing in to the sandbox requires an active `auth.core` account, the `sandbox.access.use` scope on the selected tenant membership, and a grant that is neither revoked nor expired. The sandbox issues its own cookie and never accepts the platform cookie as a sandbox session.
|
|
58
|
+
|
|
59
|
+
Ejecting a draft into `modules/` is a separate scope and a separate CLI capability with a dry run by default. Eject never writes the platform composition by hand: it copies the module, validates it, and calls the existing `module enable` capability.
|
|
60
|
+
|
|
61
|
+
## Amendments
|
|
62
|
+
|
|
63
|
+
- 2026-09-01: A session workspace is a pnpm workspace of its own. Draft
|
|
64
|
+
modules are its projects, every other workspace package is linked to the live
|
|
65
|
+
checkout through `overrides`, the host lockfile seeds the resolution, and
|
|
66
|
+
gates run with the module's own installed binaries. A session may carry
|
|
67
|
+
several modules (`modules[]` in the record, primary first); they are
|
|
68
|
+
materialized, diffed, gated, previewed and delivered together.
|
|
69
|
+
- 2026-09-01: Turns are detached from the request that starts them and
|
|
70
|
+
automatic handoffs are chained server-side (limit four per operator message).
|
|
71
|
+
A declared handoff is honoured only when it names a role the finishing role
|
|
72
|
+
may hand to.
|
|
73
|
+
- 2026-09-01: Delivery is a target behind `DeliveryTarget`
|
|
74
|
+
(`available`, `plan`, `apply`); the `workspace` target hard-fails on any step,
|
|
75
|
+
removes files an edit deleted, and records the eject on the platform. A
|
|
76
|
+
pull-request target is the next implementation of the same interface.
|
|
77
|
+
- 2026-09-01: The sandbox API requires same-origin plus a custom header on every
|
|
78
|
+
mutation, validates session ids as UUIDs, authenticates the state,
|
|
79
|
+
configuration and preview routes, never accepts a mode change over HTTP, and
|
|
80
|
+
reads capabilities from the acting principal. Sessions can be archived,
|
|
81
|
+
restored and deleted, from the sandbox and from `flowdular sandbox` commands.
|