@tacuchi/agent-workflow-cli 25.7.0 → 25.9.0
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/CHANGELOG.md +110 -0
- package/README.md +5 -1
- package/dist/adapters/git-cli.js +311 -24
- package/dist/adapters/git-cli.js.map +1 -1
- package/dist/adapters/node-file-system.js +48 -0
- package/dist/adapters/node-file-system.js.map +1 -1
- package/dist/application/amend-service.js +51 -14
- package/dist/application/amend-service.js.map +1 -1
- package/dist/application/branch-resolver.js +6 -3
- package/dist/application/branch-resolver.js.map +1 -1
- package/dist/application/capability/design-handler.js +124 -43
- package/dist/application/capability/design-handler.js.map +1 -1
- package/dist/application/capability/dispatcher.js +4 -1
- package/dist/application/capability/dispatcher.js.map +1 -1
- package/dist/application/capability/durable-effect.js +3 -0
- package/dist/application/capability/durable-effect.js.map +1 -1
- package/dist/application/capability/readiness.js +26 -10
- package/dist/application/capability/readiness.js.map +1 -1
- package/dist/application/capability/wrapper.js +10 -3
- package/dist/application/capability/wrapper.js.map +1 -1
- package/dist/application/check-branch-service.js +158 -19
- package/dist/application/check-branch-service.js.map +1 -1
- package/dist/application/checkpoint/markdown.js +2 -2
- package/dist/application/checkpoint/markdown.js.map +1 -1
- package/dist/application/checkpoint/state-reader.js +12 -0
- package/dist/application/checkpoint/state-reader.js.map +1 -1
- package/dist/application/checkpoint-service.js +12 -4
- package/dist/application/checkpoint-service.js.map +1 -1
- package/dist/application/checkpoint-write-service.js +91 -17
- package/dist/application/checkpoint-write-service.js.map +1 -1
- package/dist/application/claims-ledger.js +137 -11
- package/dist/application/claims-ledger.js.map +1 -1
- package/dist/application/claims-recovery.js +85 -44
- package/dist/application/claims-recovery.js.map +1 -1
- package/dist/application/database-tool-catalog.js +33 -0
- package/dist/application/database-tool-catalog.js.map +1 -1
- package/dist/application/design/consumer-document.js +2 -2
- package/dist/application/design/consumer-document.js.map +1 -1
- package/dist/application/design/design-content-gate-service.js +20 -2
- package/dist/application/design/design-content-gate-service.js.map +1 -1
- package/dist/application/design/design-gate-service.js +2 -0
- package/dist/application/design/design-gate-service.js.map +1 -1
- package/dist/application/design/design-index-service.js +4 -0
- package/dist/application/design/design-index-service.js.map +1 -1
- package/dist/application/design/design-publish-service.js +1 -4
- package/dist/application/design/design-publish-service.js.map +1 -1
- package/dist/application/design/design-record-service.js +13 -7
- package/dist/application/design/design-record-service.js.map +1 -1
- package/dist/application/design/design-resolver-service.js +22 -3
- package/dist/application/design/design-resolver-service.js.map +1 -1
- package/dist/application/design/design-simple-service.js +24 -5
- package/dist/application/design/design-simple-service.js.map +1 -1
- package/dist/application/design/digest.js +41 -0
- package/dist/application/design/digest.js.map +1 -0
- package/dist/application/dev-only-services.js +171 -27
- package/dist/application/dev-only-services.js.map +1 -1
- package/dist/application/doc-branch-ledger.js +145 -0
- package/dist/application/doc-branch-ledger.js.map +1 -0
- package/dist/application/docs-canon-service.js +1 -1
- package/dist/application/docs-canon-service.js.map +1 -1
- package/dist/application/doctor/dist-integrity.js +113 -0
- package/dist/application/doctor/dist-integrity.js.map +1 -0
- package/dist/application/doctor/hosts.js +5 -2
- package/dist/application/doctor/hosts.js.map +1 -1
- package/dist/application/doctor/prepare.js +4 -1
- package/dist/application/doctor/prepare.js.map +1 -1
- package/dist/application/doctor/provider-installation.js +39 -19
- package/dist/application/doctor/provider-installation.js.map +1 -1
- package/dist/application/doctor/provider-mcps.js +10 -2
- package/dist/application/doctor/provider-mcps.js.map +1 -1
- package/dist/application/doctor/provider-skills.js +25 -0
- package/dist/application/doctor/provider-skills.js.map +1 -1
- package/dist/application/doctor/provider-visibility.js +76 -3
- package/dist/application/doctor/provider-visibility.js.map +1 -1
- package/dist/application/doctor/provider-workspace-block.js +156 -0
- package/dist/application/doctor/provider-workspace-block.js.map +1 -0
- package/dist/application/doctor/repair-runner.js +47 -3
- package/dist/application/doctor/repair-runner.js.map +1 -1
- package/dist/application/doctor/report.js +24 -4
- package/dist/application/doctor/report.js.map +1 -1
- package/dist/application/doctor/skills-toml-migrate.js +76 -0
- package/dist/application/doctor/skills-toml-migrate.js.map +1 -0
- package/dist/application/export-catalog-check.js +200 -0
- package/dist/application/export-catalog-check.js.map +1 -0
- package/dist/application/export-service.js +716 -79
- package/dist/application/export-service.js.map +1 -1
- package/dist/application/fix-git-service.js +285 -64
- package/dist/application/fix-git-service.js.map +1 -1
- package/dist/application/flow/advance.js +241 -30
- package/dist/application/flow/advance.js.map +1 -1
- package/dist/application/flow/annul-service.js +3 -1
- package/dist/application/flow/annul-service.js.map +1 -1
- package/dist/application/flow/batch-commit.js +189 -0
- package/dist/application/flow/batch-commit.js.map +1 -0
- package/dist/application/flow/checkout-observation.js +110 -8
- package/dist/application/flow/checkout-observation.js.map +1 -1
- package/dist/application/flow/close-artifacts.js +105 -0
- package/dist/application/flow/close-artifacts.js.map +1 -0
- package/dist/application/flow/close-at-boundary.js +155 -0
- package/dist/application/flow/close-at-boundary.js.map +1 -0
- package/dist/application/flow/close-document-guidance.js +70 -0
- package/dist/application/flow/close-document-guidance.js.map +1 -0
- package/dist/application/flow/flow-service.js +49 -5
- package/dist/application/flow/flow-service.js.map +1 -1
- package/dist/application/flow/internal-actions.js +361 -80
- package/dist/application/flow/internal-actions.js.map +1 -1
- package/dist/application/flow/internal-drive.js +47 -19
- package/dist/application/flow/internal-drive.js.map +1 -1
- package/dist/application/flow/plan-entry.js +82 -0
- package/dist/application/flow/plan-entry.js.map +1 -0
- package/dist/application/flow/prove.js +32 -1
- package/dist/application/flow/prove.js.map +1 -1
- package/dist/application/flow/quick-checkouts.js +48 -0
- package/dist/application/flow/quick-checkouts.js.map +1 -0
- package/dist/application/flow/reinfer-batch.js +177 -0
- package/dist/application/flow/reinfer-batch.js.map +1 -0
- package/dist/application/flow/reopen-run.js +159 -0
- package/dist/application/flow/reopen-run.js.map +1 -0
- package/dist/application/flow/run-journey.js +11 -8
- package/dist/application/flow/run-journey.js.map +1 -1
- package/dist/application/flow/run-projection.js +16 -5
- package/dist/application/flow/run-projection.js.map +1 -1
- package/dist/application/flow/run-state-service.js +3 -1
- package/dist/application/flow/run-state-service.js.map +1 -1
- package/dist/application/flow/submit.js +731 -154
- package/dist/application/flow/submit.js.map +1 -1
- package/dist/application/generate-launch-service.js +16 -6
- package/dist/application/generate-launch-service.js.map +1 -1
- package/dist/application/git-flow-service.js +34 -3
- package/dist/application/git-flow-service.js.map +1 -1
- package/dist/application/history-publications.js +24 -0
- package/dist/application/history-publications.js.map +1 -1
- package/dist/application/history-reconcile-service.js +45 -0
- package/dist/application/history-reconcile-service.js.map +1 -0
- package/dist/application/history-table.js +61 -12
- package/dist/application/history-table.js.map +1 -1
- package/dist/application/history-update-service.js +25 -4
- package/dist/application/history-update-service.js.map +1 -1
- package/dist/application/hook-branch-check.js +25 -3
- package/dist/application/hook-branch-check.js.map +1 -1
- package/dist/application/hook-git-commit-advisor.js +3 -4
- package/dist/application/hook-git-commit-advisor.js.map +1 -1
- package/dist/application/hook-sql-mutation-guard.js +147 -12
- package/dist/application/hook-sql-mutation-guard.js.map +1 -1
- package/dist/application/hook-turn-start.js +51 -0
- package/dist/application/hook-turn-start.js.map +1 -0
- package/dist/application/host-memory/codex.js +1 -1
- package/dist/application/host-memory/codex.js.map +1 -1
- package/dist/application/hub-registry.js +135 -0
- package/dist/application/hub-registry.js.map +1 -0
- package/dist/application/local-proposal.js +72 -19
- package/dist/application/local-proposal.js.map +1 -1
- package/dist/application/mcp-host-reader.js +1 -1
- package/dist/application/mcp-host-reader.js.map +1 -1
- package/dist/application/mcp-host-writer.js +16 -10
- package/dist/application/mcp-host-writer.js.map +1 -1
- package/dist/application/merge-state-service.js +150 -34
- package/dist/application/merge-state-service.js.map +1 -1
- package/dist/application/multiroot/claude.js +17 -10
- package/dist/application/multiroot/claude.js.map +1 -1
- package/dist/application/multiroot/codex.js +17 -11
- package/dist/application/multiroot/codex.js.map +1 -1
- package/dist/application/multiroot-service.js +52 -28
- package/dist/application/multiroot-service.js.map +1 -1
- package/dist/application/parsers/execution-batches.js +64 -0
- package/dist/application/parsers/execution-batches.js.map +1 -0
- package/dist/application/parsers/phases.js +23 -2
- package/dist/application/parsers/phases.js.map +1 -1
- package/dist/application/parsers/project-block.js +146 -17
- package/dist/application/parsers/project-block.js.map +1 -1
- package/dist/application/parsers/tasks.js +16 -2
- package/dist/application/parsers/tasks.js.map +1 -1
- package/dist/application/parsers/toml.js +19 -0
- package/dist/application/parsers/toml.js.map +1 -0
- package/dist/application/paths-service.js +13 -16
- package/dist/application/paths-service.js.map +1 -1
- package/dist/application/persist-service.js +118 -5
- package/dist/application/persist-service.js.map +1 -1
- package/dist/application/plan-exec-batch-service.js +162 -22
- package/dist/application/plan-exec-batch-service.js.map +1 -1
- package/dist/application/plan-exec-decision-service.js +61 -12
- package/dist/application/plan-exec-decision-service.js.map +1 -1
- package/dist/application/plan-exec-plan-diff.js +105 -0
- package/dist/application/plan-exec-plan-diff.js.map +1 -0
- package/dist/application/plan-lint-service.js +2 -0
- package/dist/application/plan-lint-service.js.map +1 -1
- package/dist/application/plan-passes.js +41 -0
- package/dist/application/plan-passes.js.map +1 -0
- package/dist/application/preparation-receipts.js +58 -0
- package/dist/application/preparation-receipts.js.map +1 -0
- package/dist/application/project-md-upsert-service.js +191 -52
- package/dist/application/project-md-upsert-service.js.map +1 -1
- package/dist/application/project-tab-data.js +40 -10
- package/dist/application/project-tab-data.js.map +1 -1
- package/dist/application/release-data/artifacts.js +15 -7
- package/dist/application/release-data/artifacts.js.map +1 -1
- package/dist/application/release-data/bundles.js +52 -6
- package/dist/application/release-data/bundles.js.map +1 -1
- package/dist/application/release-data/common.js +2 -2
- package/dist/application/release-data/common.js.map +1 -1
- package/dist/application/release-data/rollback.js +7 -0
- package/dist/application/release-data/rollback.js.map +1 -0
- package/dist/application/release-data/sessions.js +2 -2
- package/dist/application/release-data/sessions.js.map +1 -1
- package/dist/application/release-pass-ledger.js +1 -1
- package/dist/application/render/history-row.js +2 -0
- package/dist/application/render/history-row.js.map +1 -1
- package/dist/application/render/project-block.js +28 -11
- package/dist/application/render/project-block.js.map +1 -1
- package/dist/application/reseal-service.js +1 -0
- package/dist/application/reseal-service.js.map +1 -1
- package/dist/application/resume-service.js +55 -8
- package/dist/application/resume-service.js.map +1 -1
- package/dist/application/retirement/apply.js +25 -7
- package/dist/application/retirement/apply.js.map +1 -1
- package/dist/application/retirement/attribution.js +121 -48
- package/dist/application/retirement/attribution.js.map +1 -1
- package/dist/application/retirement/prepare.js +17 -11
- package/dist/application/retirement/prepare.js.map +1 -1
- package/dist/application/retirement/preview.js +2 -1
- package/dist/application/retirement/preview.js.map +1 -1
- package/dist/application/self/codex-plugin.js +1 -1
- package/dist/application/self/codex-plugin.js.map +1 -1
- package/dist/application/self/host-states.js +3 -3
- package/dist/application/self/host-states.js.map +1 -1
- package/dist/application/self/install-hooks.js +1 -1
- package/dist/application/self/install-hooks.js.map +1 -1
- package/dist/application/self/install-skill.js +35 -11
- package/dist/application/self/install-skill.js.map +1 -1
- package/dist/application/self/install-targets.js +73 -2
- package/dist/application/self/install-targets.js.map +1 -1
- package/dist/application/self/mcp-config.js +19 -11
- package/dist/application/self/mcp-config.js.map +1 -1
- package/dist/application/self/opencode-plugin.js +1 -0
- package/dist/application/self/opencode-plugin.js.map +1 -1
- package/dist/application/self/uninstall.js +22 -8
- package/dist/application/self/uninstall.js.map +1 -1
- package/dist/application/semantic-operation/protocol.js +66 -5
- package/dist/application/semantic-operation/protocol.js.map +1 -1
- package/dist/application/session-archive-service.js +113 -0
- package/dist/application/session-archive-service.js.map +1 -0
- package/dist/application/session-binding-service.js +35 -0
- package/dist/application/session-binding-service.js.map +1 -1
- package/dist/application/session-close-service.js +390 -54
- package/dist/application/session-close-service.js.map +1 -1
- package/dist/application/session-create-service.js +97 -5
- package/dist/application/session-create-service.js.map +1 -1
- package/dist/application/session-custody-recorder.js +15 -12
- package/dist/application/session-custody-recorder.js.map +1 -1
- package/dist/application/session-custody-service.js +1 -0
- package/dist/application/session-custody-service.js.map +1 -1
- package/dist/application/session-narrative.js +51 -12
- package/dist/application/session-narrative.js.map +1 -1
- package/dist/application/session-pause-service.js +46 -0
- package/dist/application/session-pause-service.js.map +1 -0
- package/dist/application/session-resolver.js +36 -11
- package/dist/application/session-resolver.js.map +1 -1
- package/dist/application/session-resume-service.js +190 -20
- package/dist/application/session-resume-service.js.map +1 -1
- package/dist/application/sessions-service.js +4 -0
- package/dist/application/sessions-service.js.map +1 -1
- package/dist/application/sessions-sweep-service.js +77 -0
- package/dist/application/sessions-sweep-service.js.map +1 -0
- package/dist/application/settle-service.js +3 -1
- package/dist/application/settle-service.js.map +1 -1
- package/dist/application/skills-resolver-service.js +1 -1
- package/dist/application/skills-resolver-service.js.map +1 -1
- package/dist/application/source-add-service.js +37 -0
- package/dist/application/source-add-service.js.map +1 -0
- package/dist/application/source-boundary-policy.js +97 -8
- package/dist/application/source-boundary-policy.js.map +1 -1
- package/dist/application/source-pipeline.js +68 -0
- package/dist/application/source-pipeline.js.map +1 -0
- package/dist/application/source-remove-service.js +15 -3
- package/dist/application/source-remove-service.js.map +1 -1
- package/dist/application/sources-service.js +71 -16
- package/dist/application/sources-service.js.map +1 -1
- package/dist/application/status-service.js +55 -5
- package/dist/application/status-service.js.map +1 -1
- package/dist/application/unit-dependencies.js +100 -0
- package/dist/application/unit-dependencies.js.map +1 -0
- package/dist/application/unit-membership.js +37 -0
- package/dist/application/unit-membership.js.map +1 -0
- package/dist/application/unit-residue.js +72 -0
- package/dist/application/unit-residue.js.map +1 -0
- package/dist/application/visibility-doctor-service.js +66 -4
- package/dist/application/visibility-doctor-service.js.map +1 -1
- package/dist/application/working-branch-service.js +6 -0
- package/dist/application/working-branch-service.js.map +1 -1
- package/dist/application/workline-graph.js +1 -1
- package/dist/application/workline-graph.js.map +1 -1
- package/dist/application/workline-index-service.js +118 -17
- package/dist/application/workline-index-service.js.map +1 -1
- package/dist/application/workspace-commit-service.js +218 -0
- package/dist/application/workspace-commit-service.js.map +1 -0
- package/dist/application/workspace-init-service.js +64 -34
- package/dist/application/workspace-init-service.js.map +1 -1
- package/dist/application/workspace-local-config.js +90 -0
- package/dist/application/workspace-local-config.js.map +1 -0
- package/dist/application/workspace-materialization-service.js +52 -3
- package/dist/application/workspace-materialization-service.js.map +1 -1
- package/dist/application/workspace-migrate/apply.js +525 -4
- package/dist/application/workspace-migrate/apply.js.map +1 -1
- package/dist/application/workspace-migrate/markers.js +9 -6
- package/dist/application/workspace-migrate/markers.js.map +1 -1
- package/dist/application/workspace-migrate/plan.js +97 -5
- package/dist/application/workspace-migrate/plan.js.map +1 -1
- package/dist/application/workspace-move-service.js +270 -0
- package/dist/application/workspace-move-service.js.map +1 -0
- package/dist/application/workspace-untrack-service.js +28 -0
- package/dist/application/workspace-untrack-service.js.map +1 -0
- package/dist/application/worktree-service.js +654 -105
- package/dist/application/worktree-service.js.map +1 -1
- package/dist/cli/ascii.js +86 -0
- package/dist/cli/ascii.js.map +1 -0
- package/dist/cli/commands/add-source.js +38 -0
- package/dist/cli/commands/add-source.js.map +1 -0
- package/dist/cli/commands/amend.js +14 -2
- package/dist/cli/commands/amend.js.map +1 -1
- package/dist/cli/commands/capability.js +26 -0
- package/dist/cli/commands/capability.js.map +1 -1
- package/dist/cli/commands/check-branch.js +1 -0
- package/dist/cli/commands/check-branch.js.map +1 -1
- package/dist/cli/commands/checkpoint-read.js +1 -0
- package/dist/cli/commands/checkpoint-read.js.map +1 -1
- package/dist/cli/commands/checkpoint-write.js +4 -1
- package/dist/cli/commands/checkpoint-write.js.map +1 -1
- package/dist/cli/commands/claims.js +1 -0
- package/dist/cli/commands/claims.js.map +1 -1
- package/dist/cli/commands/code-scan.js +1 -0
- package/dist/cli/commands/code-scan.js.map +1 -1
- package/dist/cli/commands/context-budget.js +1 -0
- package/dist/cli/commands/context-budget.js.map +1 -1
- package/dist/cli/commands/context-plan.js +1 -0
- package/dist/cli/commands/context-plan.js.map +1 -1
- package/dist/cli/commands/cut-intent.js +1 -0
- package/dist/cli/commands/cut-intent.js.map +1 -1
- package/dist/cli/commands/designs.js +15 -5
- package/dist/cli/commands/designs.js.map +1 -1
- package/dist/cli/commands/dev-only.js +22 -5
- package/dist/cli/commands/dev-only.js.map +1 -1
- package/dist/cli/commands/doc-branch.js +184 -0
- package/dist/cli/commands/doc-branch.js.map +1 -0
- package/dist/cli/commands/doctor.js +9 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/export.js +89 -16
- package/dist/cli/commands/export.js.map +1 -1
- package/dist/cli/commands/fix-git.js +89 -13
- package/dist/cli/commands/fix-git.js.map +1 -1
- package/dist/cli/commands/flow.js +129 -13
- package/dist/cli/commands/flow.js.map +1 -1
- package/dist/cli/commands/generate-launch.js +15 -2
- package/dist/cli/commands/generate-launch.js.map +1 -1
- package/dist/cli/commands/git-flow.js +1 -0
- package/dist/cli/commands/git-flow.js.map +1 -1
- package/dist/cli/commands/history-update.js +7 -9
- package/dist/cli/commands/history-update.js.map +1 -1
- package/dist/cli/commands/history.js +14 -0
- package/dist/cli/commands/history.js.map +1 -0
- package/dist/cli/commands/hook.js +26 -5
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/host-doctor.js +1 -0
- package/dist/cli/commands/host-doctor.js.map +1 -1
- package/dist/cli/commands/host-memory.js +2 -9
- package/dist/cli/commands/host-memory.js.map +1 -1
- package/dist/cli/commands/index.js +18 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/mcp.js +30 -4
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/merge-state.js +3 -2
- package/dist/cli/commands/merge-state.js.map +1 -1
- package/dist/cli/commands/multiroot.js +16 -0
- package/dist/cli/commands/multiroot.js.map +1 -1
- package/dist/cli/commands/persist.js +7 -5
- package/dist/cli/commands/persist.js.map +1 -1
- package/dist/cli/commands/plan.js +1 -0
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/plugin-cache.js +4 -0
- package/dist/cli/commands/plugin-cache.js.map +1 -1
- package/dist/cli/commands/plugin-doctor.js +3 -0
- package/dist/cli/commands/plugin-doctor.js.map +1 -1
- package/dist/cli/commands/project-md-upsert.js +8 -3
- package/dist/cli/commands/project-md-upsert.js.map +1 -1
- package/dist/cli/commands/release-data.js +12 -0
- package/dist/cli/commands/release-data.js.map +1 -1
- package/dist/cli/commands/release-pass.js +13 -3
- package/dist/cli/commands/release-pass.js.map +1 -1
- package/dist/cli/commands/remove-source.js +1 -0
- package/dist/cli/commands/remove-source.js.map +1 -1
- package/dist/cli/commands/reseal.js +1 -0
- package/dist/cli/commands/reseal.js.map +1 -1
- package/dist/cli/commands/resume-summary.js +5 -0
- package/dist/cli/commands/resume-summary.js.map +1 -1
- package/dist/cli/commands/resume.js +13 -3
- package/dist/cli/commands/resume.js.map +1 -1
- package/dist/cli/commands/retirement.js +1 -0
- package/dist/cli/commands/retirement.js.map +1 -1
- package/dist/cli/commands/self.js +39 -1
- package/dist/cli/commands/self.js.map +1 -1
- package/dist/cli/commands/session-artifacts.js +1 -0
- package/dist/cli/commands/session-artifacts.js.map +1 -1
- package/dist/cli/commands/session-close.js +185 -31
- package/dist/cli/commands/session-close.js.map +1 -1
- package/dist/cli/commands/session-create.js +4 -1
- package/dist/cli/commands/session-create.js.map +1 -1
- package/dist/cli/commands/session-pause.js +14 -0
- package/dist/cli/commands/session-pause.js.map +1 -0
- package/dist/cli/commands/session-resume.js +1 -0
- package/dist/cli/commands/session-resume.js.map +1 -1
- package/dist/cli/commands/sessions.js +16 -2
- package/dist/cli/commands/sessions.js.map +1 -1
- package/dist/cli/commands/set-branch.js +29 -4
- package/dist/cli/commands/set-branch.js.map +1 -1
- package/dist/cli/commands/set-edit-mode.js +20 -0
- package/dist/cli/commands/set-edit-mode.js.map +1 -0
- package/dist/cli/commands/set-pipeline.js +35 -0
- package/dist/cli/commands/set-pipeline.js.map +1 -0
- package/dist/cli/commands/settle.js +1 -0
- package/dist/cli/commands/settle.js.map +1 -1
- package/dist/cli/commands/skill-index.js +1 -0
- package/dist/cli/commands/skill-index.js.map +1 -1
- package/dist/cli/commands/skills.js +1 -0
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/cli/commands/sources.js +5 -0
- package/dist/cli/commands/sources.js.map +1 -1
- package/dist/cli/commands/stack.js +1 -0
- package/dist/cli/commands/stack.js.map +1 -1
- package/dist/cli/commands/status.js +36 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/tool.js +5 -21
- package/dist/cli/commands/tool.js.map +1 -1
- package/dist/cli/commands/unknown-flags.js +68 -16
- package/dist/cli/commands/unknown-flags.js.map +1 -1
- package/dist/cli/commands/visibility.js +2 -0
- package/dist/cli/commands/visibility.js.map +1 -1
- package/dist/cli/commands/workspace-commit.js +62 -0
- package/dist/cli/commands/workspace-commit.js.map +1 -0
- package/dist/cli/commands/workspace-init.js +51 -2
- package/dist/cli/commands/workspace-init.js.map +1 -1
- package/dist/cli/commands/workspace-migrate.js +31 -14
- package/dist/cli/commands/workspace-migrate.js.map +1 -1
- package/dist/cli/commands/workspace-move.js +42 -0
- package/dist/cli/commands/workspace-move.js.map +1 -0
- package/dist/cli/commands/worktree.js +5 -4
- package/dist/cli/commands/worktree.js.map +1 -1
- package/dist/cli/context-id.js +6 -0
- package/dist/cli/context-id.js.map +1 -1
- package/dist/cli/full-cli.js +555 -0
- package/dist/cli/full-cli.js.map +1 -0
- package/dist/cli/help-groups.js +108 -14
- package/dist/cli/help-groups.js.map +1 -1
- package/dist/cli/hook-stdin-cache.js +12 -0
- package/dist/cli/hook-stdin-cache.js.map +1 -0
- package/dist/cli/main.js +47 -471
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/output-mode.js +11 -2
- package/dist/cli/output-mode.js.map +1 -1
- package/dist/cli/parser.js +18 -5
- package/dist/cli/parser.js.map +1 -1
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli/render.js +30 -1
- package/dist/cli/render.js.map +1 -1
- package/dist/cli/tui/app.js +1 -1
- package/dist/cli/tui/app.js.map +1 -1
- package/dist/cli/tui/components/workspace-init-form.js +4 -1
- package/dist/cli/tui/components/workspace-init-form.js.map +1 -1
- package/dist/cli/tui/data/recommended-skills.js +2 -2
- package/dist/cli/tui/data/recommended-skills.js.map +1 -1
- package/dist/cli/tui/data/workflow-content.js +6 -1
- package/dist/cli/tui/data/workflow-content.js.map +1 -1
- package/dist/cli/tui/tabs/mcp-tab.js +4 -3
- package/dist/cli/tui/tabs/mcp-tab.js.map +1 -1
- package/dist/cli/tui/tabs/project-tab.js +7 -2
- package/dist/cli/tui/tabs/project-tab.js.map +1 -1
- package/dist/dist-manifest.json +4117 -0
- package/dist/domain/capability/protocol.js.map +1 -1
- package/dist/domain/decision-note.js +13 -0
- package/dist/domain/decision-note.js.map +1 -1
- package/dist/domain/design/artifact.js +22 -3
- package/dist/domain/design/artifact.js.map +1 -1
- package/dist/domain/design/capability.js +1 -0
- package/dist/domain/design/capability.js.map +1 -1
- package/dist/domain/design/expansion.js +1 -1
- package/dist/domain/design/expansion.js.map +1 -1
- package/dist/domain/design/maturity.js +16 -0
- package/dist/domain/design/maturity.js.map +1 -1
- package/dist/domain/design/reference.js +5 -0
- package/dist/domain/design/reference.js.map +1 -1
- package/dist/domain/doctor/operations.js +28 -2
- package/dist/domain/doctor/operations.js.map +1 -1
- package/dist/domain/effective-contract.js +3 -1
- package/dist/domain/effective-contract.js.map +1 -1
- package/dist/domain/elicitation.js +1 -1
- package/dist/domain/flow/answer.js +273 -130
- package/dist/domain/flow/answer.js.map +1 -1
- package/dist/domain/flow/authority.js +330 -44
- package/dist/domain/flow/authority.js.map +1 -1
- package/dist/domain/flow/batch-review.js +65 -0
- package/dist/domain/flow/batch-review.js.map +1 -0
- package/dist/domain/flow/decision-schema.js +47 -0
- package/dist/domain/flow/decision-schema.js.map +1 -0
- package/dist/domain/flow/directive.js +16 -0
- package/dist/domain/flow/directive.js.map +1 -1
- package/dist/domain/flow/execution-result.js +169 -9
- package/dist/domain/flow/execution-result.js.map +1 -1
- package/dist/domain/flow/route.js.map +1 -1
- package/dist/domain/flow/rules.js +5 -6
- package/dist/domain/flow/rules.js.map +1 -1
- package/dist/domain/flow/run-state.js +531 -47
- package/dist/domain/flow/run-state.js.map +1 -1
- package/dist/domain/flow/test-run-evidence.js +285 -0
- package/dist/domain/flow/test-run-evidence.js.map +1 -0
- package/dist/domain/flow/unchanged-phase.js +15 -0
- package/dist/domain/flow/unchanged-phase.js.map +1 -0
- package/dist/domain/harnesses.js +22 -6
- package/dist/domain/harnesses.js.map +1 -1
- package/dist/domain/isolation-unit.js +2 -2
- package/dist/domain/isolation-unit.js.map +1 -1
- package/dist/domain/lineage.js +7 -2
- package/dist/domain/lineage.js.map +1 -1
- package/dist/domain/obligation-correspondence.js +4 -2
- package/dist/domain/obligation-correspondence.js.map +1 -1
- package/dist/domain/plan-handoff.js +5 -0
- package/dist/domain/plan-handoff.js.map +1 -0
- package/dist/domain/proposal.js +18 -7
- package/dist/domain/proposal.js.map +1 -1
- package/dist/domain/reservation.js +5 -3
- package/dist/domain/reservation.js.map +1 -1
- package/dist/domain/retirement/proposal.js +1 -0
- package/dist/domain/retirement/proposal.js.map +1 -1
- package/dist/domain/session/custody.js +10 -6
- package/dist/domain/session/custody.js.map +1 -1
- package/dist/domain/session/narrative.js +4 -1
- package/dist/domain/session/narrative.js.map +1 -1
- package/dist/domain/skills.js +2 -0
- package/dist/domain/skills.js.map +1 -1
- package/dist/domain/sql-lexer.js +15 -2
- package/dist/domain/sql-lexer.js.map +1 -1
- package/dist/runtime/namespace-resolver.js +4 -0
- package/dist/runtime/namespace-resolver.js.map +1 -1
- package/dist/runtime/workline-marker.js +35 -8
- package/dist/runtime/workline-marker.js.map +1 -1
- package/dist/runtime/workspace-resolution.js +123 -0
- package/dist/runtime/workspace-resolution.js.map +1 -0
- package/package.json +5 -4
- package/skills/w/SKILL.md +3 -1
- package/skills/w/artifacts/artifacts-core/CHECKPOINT.md +1 -1
- package/skills/w/artifacts/artifacts-core/SCRIPTS.rollback.sql +8 -0
- package/skills/w/artifacts/artifacts-core/SCRIPTS.sql +4 -8
- package/skills/w/commands/export-diagrams.md +3 -3
- package/skills/w/commands/export-manuals.md +6 -6
- package/skills/w/commands/export-reports.md +3 -3
- package/skills/w/commands/export-scripts.md +5 -5
- package/skills/w/commands/fix-git.md +12 -13
- package/skills/w/commands/persist.md +2 -2
- package/skills/w/commands/plan-exec.md +4 -2
- package/skills/w/commands/spec-new.md +1 -1
- package/skills/w/commands/workspace-init.md +2 -0
- package/skills/w/context/MANIFEST.json +1 -1
- package/skills/w/exports/export-diagrams/EXPORT.md +3 -3
- package/skills/w/exports/export-manuals/EXPORT.md +14 -16
- package/skills/w/exports/export-reports/EXPORT.md +3 -3
- package/skills/w/exports/export-scripts/EXPORT.md +45 -21
- package/skills/w/harness/HARNESS.md +5 -3
- package/skills/w/hooks/hooks.template.json +6 -4
- package/skills/w/loops/CHASSIS.md +12 -6
- package/skills/w/loops/CODE-POLICIES.md +7 -4
- package/skills/w/loops/plan-exec-loop/LOOP.md +23 -22
- package/skills/w/loops/plan-new-loop/LOOP.md +23 -31
- package/skills/w/loops/plan-refine-loop/LOOP.md +8 -2
- package/skills/w/loops/quick-loop/LOOP.md +6 -5
- package/skills/w/modules/DESIGN-REFERENCES.md +9 -11
- package/skills/w/modules/PLAN-EXECUTION-BATCHES.md +4 -4
- package/skills/w/modules/SESSION-NUMBERING.md +2 -0
- package/skills/w/roles/design/CONTRACT.md +16 -7
- package/skills/w/roles/design/ROLE.md +4 -2
- package/skills/w/roles/git/ROLE.md +16 -9
- package/skills/w/roles/research/ROLE.md +1 -1
- package/skills/w/roles/sql/ROLE.md +16 -14
- package/skills/w/schemas/design/ui-screen.v1.schema.json +9 -0
|
@@ -43,6 +43,10 @@ export function proposalContractOf(decision) {
|
|
|
43
43
|
export function publishApprovalOf(decision) {
|
|
44
44
|
return decision.publishes?.approve ?? null;
|
|
45
45
|
}
|
|
46
|
+
/** The redraft alternative of a confirmation row and where it re-enters, or `null`. */
|
|
47
|
+
export function reentryOf(decision) {
|
|
48
|
+
return decision.reenters ?? null;
|
|
49
|
+
}
|
|
46
50
|
/** Whether this row's answer is what fixes the run's plan and its sources. */
|
|
47
51
|
export function scopesSources(decision) {
|
|
48
52
|
return decision.scopes_sources === true;
|
|
@@ -139,6 +143,7 @@ export const INTERNAL_ACTION_OPERATIONS = [
|
|
|
139
143
|
"proposal.publish",
|
|
140
144
|
/** Seal the next plan-execution batch before any of its work is credited. */
|
|
141
145
|
"plan-exec.batch-infer",
|
|
146
|
+
"plan-exec.batch-commit",
|
|
142
147
|
/** Close one sealed plan-execution batch through the document/state CAS. */
|
|
143
148
|
"plan-exec.batch-close",
|
|
144
149
|
/** Seal a fully evidenced PLAN-exec document as done. */
|
|
@@ -164,13 +169,14 @@ export const INTERNAL_OPERATION_EFFECTS = {
|
|
|
164
169
|
// it replaces nothing and it destroys nothing. That the CLI reaches git to make
|
|
165
170
|
// it is not what the class measures — `workspace.board` already reads git the
|
|
166
171
|
// same way and is `read_only`.
|
|
167
|
-
"worktree.ensure": ["local_additive"],
|
|
172
|
+
"worktree.ensure": ["local_additive", "mutate_overwrite"],
|
|
168
173
|
// Creating and replacing, both real — and which of the two happens is decided
|
|
169
174
|
// by the proposal, not by the row: what the row declares here is the ceiling.
|
|
170
175
|
"proposal.publish": ["local_additive", "mutate_overwrite"],
|
|
171
176
|
// Inference writes only the run's sealed ledger. It changes no project
|
|
172
177
|
// artifact and therefore has no capability-world effect to authorize.
|
|
173
178
|
"plan-exec.batch-infer": [],
|
|
179
|
+
"plan-exec.batch-commit": ["execute", "local_additive"],
|
|
174
180
|
// Batch progress always rewrites the current plan document, but only from the
|
|
175
181
|
// exact before/after pair persisted in its v10 batch state.
|
|
176
182
|
"plan-exec.batch-close": ["mutate_overwrite"],
|
|
@@ -451,14 +457,17 @@ const ROUTE_VALIDATION = {
|
|
|
451
457
|
},
|
|
452
458
|
risk: "la ausencia o sustitución de evidencia reduce el assurance del cierre",
|
|
453
459
|
};
|
|
454
|
-
|
|
460
|
+
/**
|
|
461
|
+
* The phase validation of `plan-exec`: substitutable, never omissible. Omitting it
|
|
462
|
+
* would credit a batch with no proof of its own checkout at all.
|
|
463
|
+
*/
|
|
464
|
+
const ROUTE_PHASE_VALIDATION = {
|
|
455
465
|
recommendation: "apply",
|
|
456
466
|
consequences: {
|
|
457
|
-
apply:
|
|
458
|
-
|
|
459
|
-
substitute: "se usa la revisión o inspección sustituta declarada",
|
|
467
|
+
apply: ROUTE_VALIDATION.consequences.apply,
|
|
468
|
+
substitute: ROUTE_VALIDATION.consequences.substitute,
|
|
460
469
|
},
|
|
461
|
-
risk:
|
|
470
|
+
risk: ROUTE_VALIDATION.risk,
|
|
462
471
|
};
|
|
463
472
|
/** The five signals of the multi-plan split gate, shared by both plan loops. */
|
|
464
473
|
const PLAN_SPLIT_SIGNALS = [
|
|
@@ -713,6 +722,42 @@ export const FLOW_DECISIONS = [
|
|
|
713
722
|
symbol: "flowControlChoices",
|
|
714
723
|
},
|
|
715
724
|
},
|
|
725
|
+
{
|
|
726
|
+
id: "chassis.commit-choice",
|
|
727
|
+
scope: CHASSIS,
|
|
728
|
+
title: "aprobar el commit del workspace por rutas explícitas o cerrar sin él",
|
|
729
|
+
authority: "human",
|
|
730
|
+
ownership: "cli-owned",
|
|
731
|
+
document: CHASSIS_MD,
|
|
732
|
+
attribution: CHASSIS_ATTRIBUTION,
|
|
733
|
+
placement: "suffix",
|
|
734
|
+
alternatives: [
|
|
735
|
+
{
|
|
736
|
+
label: "Cerrar sin commit",
|
|
737
|
+
consequence: "se archiva el mínimo y se cierra la sesión; el trabajo del workspace queda sin commitear",
|
|
738
|
+
recommended: true,
|
|
739
|
+
outcome: { kind: "continue" },
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
label: "Aprobar commit del workspace",
|
|
743
|
+
consequence: "se cierra y luego el CLI commitea solamente el pathspec y mensaje mostrados en la propuesta; nunca hace push",
|
|
744
|
+
recommended: false,
|
|
745
|
+
outcome: { kind: "continue" },
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
label: "Copiar evidencia y cerrar",
|
|
749
|
+
consequence: "se copian a la sesión las referencias existentes del scratchpad y se archivan antes de cerrar, sin commit",
|
|
750
|
+
recommended: false,
|
|
751
|
+
outcome: { kind: "continue" },
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
label: "Copiar evidencia y aprobar commit del workspace",
|
|
755
|
+
consequence: "se copia la evidencia efímera a la sesión, se archiva y entra en el commit aprobado del cierre; nunca hace push",
|
|
756
|
+
recommended: false,
|
|
757
|
+
outcome: { kind: "continue" },
|
|
758
|
+
},
|
|
759
|
+
],
|
|
760
|
+
},
|
|
716
761
|
{
|
|
717
762
|
id: "chassis.finalize",
|
|
718
763
|
scope: CHASSIS,
|
|
@@ -743,7 +788,7 @@ export const FLOW_DECISIONS = [
|
|
|
743
788
|
execution: { kind: "internal", operation: "session.close" },
|
|
744
789
|
evidence: ["chassis.sesion-cerrada"],
|
|
745
790
|
idempotent: true,
|
|
746
|
-
recovery: "una sesión que no cerró deja la corrida abierta: no la marques finalizada — reparás la fila del registro con 'aw history-update' y volvés a cerrar",
|
|
791
|
+
recovery: "una sesión que no cerró deja la corrida abierta: no la marques finalizada — reparás la fila del registro con 'aw history-update' y volvés a cerrar; si el cierre lo empezó 'aw session-close', volvé a correrlo: termina la corrida en su frontera conservando las unidades",
|
|
747
792
|
},
|
|
748
793
|
},
|
|
749
794
|
// ── QUICK — the pilot tranche, and the first one this CLI decides ──────────
|
|
@@ -830,9 +875,9 @@ export const FLOW_DECISIONS = [
|
|
|
830
875
|
alternatives: [
|
|
831
876
|
{
|
|
832
877
|
label: "Cambiar a SPEC",
|
|
833
|
-
consequence: "
|
|
878
|
+
consequence: "se cierra la sesión quick conservando lo pendiente y se entrega el pedido a /w:spec-new",
|
|
834
879
|
recommended: true,
|
|
835
|
-
outcome: { kind: "
|
|
880
|
+
outcome: { kind: "handoff", destination: "spec-new" },
|
|
836
881
|
},
|
|
837
882
|
{
|
|
838
883
|
label: "Seguir en quick",
|
|
@@ -928,7 +973,7 @@ export const FLOW_DECISIONS = [
|
|
|
928
973
|
"quick.checkpoint-sembrado",
|
|
929
974
|
],
|
|
930
975
|
idempotent: true,
|
|
931
|
-
recovery: "
|
|
976
|
+
recovery: "completá el objetivo y los criterios de éxito y corré aw flow advance: el CLI siembra el CHECKPOINT que falta sin reemplazar lo escrito",
|
|
932
977
|
},
|
|
933
978
|
},
|
|
934
979
|
{
|
|
@@ -942,7 +987,12 @@ export const FLOW_DECISIONS = [
|
|
|
942
987
|
// Same read as PLAN's, and for the same reason: `aw check-branch` with no
|
|
943
988
|
// --source resolves no target and passes unconditionally.
|
|
944
989
|
action: {
|
|
945
|
-
invocation: {
|
|
990
|
+
invocation: {
|
|
991
|
+
program: "aw",
|
|
992
|
+
args: ["sources", "--verbose", "--code", "{code}"],
|
|
993
|
+
target: ".",
|
|
994
|
+
input: null,
|
|
995
|
+
},
|
|
946
996
|
execution: {
|
|
947
997
|
kind: "external",
|
|
948
998
|
reason: "la rama esperada de cada fuente es un veredicto sobre git, y un workspace sin fuentes declaradas no lo tiene: leerlo desde adentro diría 'verificada' donde no hay nada que verificar",
|
|
@@ -1027,12 +1077,12 @@ export const FLOW_DECISIONS = [
|
|
|
1027
1077
|
{
|
|
1028
1078
|
id: "quick.db-touched",
|
|
1029
1079
|
scope: "quick",
|
|
1030
|
-
title: "reconocer si la tarea
|
|
1080
|
+
title: "reconocer si la tarea mutó una base de datos; leer no declara la señal",
|
|
1031
1081
|
authority: "agent",
|
|
1032
1082
|
ownership: "cli-owned",
|
|
1033
1083
|
document: DB_SCRIPTS_ONLY,
|
|
1034
1084
|
attribution: PLAN_ATTRIBUTION,
|
|
1035
|
-
// A quick
|
|
1085
|
+
// A read-only quick has no mutation statement to derive and no
|
|
1036
1086
|
// `SCRIPTS.sql` to hand back, so the row below it used to demand an artifact
|
|
1037
1087
|
// that should not exist. Declaring the signal is what lets the rule apply
|
|
1038
1088
|
// exactly where it has something to govern.
|
|
@@ -1049,7 +1099,7 @@ export const FLOW_DECISIONS = [
|
|
|
1049
1099
|
effects: ["local_additive"],
|
|
1050
1100
|
condition: {
|
|
1051
1101
|
threshold: { observed: "quick.db-touched", of: ["quick.db-touched"], min: 1 },
|
|
1052
|
-
otherwise: "la tarea no
|
|
1102
|
+
otherwise: "la tarea no mutó la base de datos: las lecturas no exigen scripts",
|
|
1053
1103
|
},
|
|
1054
1104
|
// Migrated with the PLAN tranche and not with QUICK, for the same reason
|
|
1055
1105
|
// CODE-POLICIES was: `plan-exec` reads this module too, and retiring its rule
|
|
@@ -1066,7 +1116,7 @@ export const FLOW_DECISIONS = [
|
|
|
1066
1116
|
execution: { kind: "internal", operation: "session.artifacts", dump: ["scripts"] },
|
|
1067
1117
|
evidence: ["quick.scripts-derivados"],
|
|
1068
1118
|
idempotent: true,
|
|
1069
|
-
recovery: "escribí el DDL o DML en
|
|
1119
|
+
recovery: "escribí el DDL o DML en SCRIPTS.sql o scripts/*.sql de la sesión y corré aw flow advance; si sólo leíste la base, retirá la señal con aw flow retract --session <código> --signal quick.db-touched; el CLI no ejecuta SQL",
|
|
1070
1120
|
},
|
|
1071
1121
|
},
|
|
1072
1122
|
{
|
|
@@ -1462,6 +1512,7 @@ export const FLOW_DECISIONS = [
|
|
|
1462
1512
|
// person would have been confirming a write that already happened. The
|
|
1463
1513
|
// doctrine's own line is `edit_in_place_with_confirm(spec) + stamp`.
|
|
1464
1514
|
publishes: { approve: "Aprobar y guardar" },
|
|
1515
|
+
reenters: { label: "Refinar", from: "spec-refine.content-authoring" },
|
|
1465
1516
|
alternatives: [
|
|
1466
1517
|
{
|
|
1467
1518
|
label: "Aprobar y guardar",
|
|
@@ -1736,6 +1787,7 @@ export const FLOW_DECISIONS = [
|
|
|
1736
1787
|
document: PLAN_NEW_LOOP,
|
|
1737
1788
|
attribution: PLAN_ATTRIBUTION,
|
|
1738
1789
|
publishes: { approve: "Aprobar y guardar" },
|
|
1790
|
+
reenters: { label: "Refinar", from: "plan-new.phase-shaping" },
|
|
1739
1791
|
alternatives: [
|
|
1740
1792
|
{
|
|
1741
1793
|
label: "Aprobar y guardar",
|
|
@@ -1949,6 +2001,7 @@ export const FLOW_DECISIONS = [
|
|
|
1949
2001
|
document: PLAN_REFINE_LOOP,
|
|
1950
2002
|
attribution: PLAN_ATTRIBUTION,
|
|
1951
2003
|
publishes: { approve: "Aprobar y guardar" },
|
|
2004
|
+
reenters: { label: "Refinar", from: "plan-refine.journey-map" },
|
|
1952
2005
|
alternatives: [
|
|
1953
2006
|
{
|
|
1954
2007
|
label: "Aprobar y guardar",
|
|
@@ -2050,9 +2103,14 @@ export const FLOW_DECISIONS = [
|
|
|
2050
2103
|
document: PLAN_EXEC_LOOP,
|
|
2051
2104
|
attribution: PLAN_ATTRIBUTION,
|
|
2052
2105
|
condition: {
|
|
2053
|
-
threshold: {
|
|
2054
|
-
|
|
2106
|
+
threshold: {
|
|
2107
|
+
observed: "plan-exec.entry-gap-recognition",
|
|
2108
|
+
of: ["plan.entry-gap-structural"],
|
|
2109
|
+
min: 1,
|
|
2110
|
+
},
|
|
2111
|
+
otherwise: "el gate de entrada no encontró un hueco estructural: no hay que escalar",
|
|
2055
2112
|
},
|
|
2113
|
+
handoff: { kind: "handoff", destination: "plan-refine" },
|
|
2056
2114
|
},
|
|
2057
2115
|
{
|
|
2058
2116
|
id: "plan-exec.normalization-consent",
|
|
@@ -2088,6 +2146,23 @@ export const FLOW_DECISIONS = [
|
|
|
2088
2146
|
},
|
|
2089
2147
|
],
|
|
2090
2148
|
},
|
|
2149
|
+
{
|
|
2150
|
+
id: "plan-exec.unchanged-phase-consent",
|
|
2151
|
+
scope: "plan-exec",
|
|
2152
|
+
title: "aprobar la validación sin cambios de las fases detectadas al entrar",
|
|
2153
|
+
authority: "human",
|
|
2154
|
+
ownership: "cli-owned",
|
|
2155
|
+
document: PLAN_EXEC_LOOP,
|
|
2156
|
+
attribution: PLAN_ATTRIBUTION,
|
|
2157
|
+
alternatives: [
|
|
2158
|
+
{
|
|
2159
|
+
label: "Aprobar validación sin cambios",
|
|
2160
|
+
consequence: "se validan con evidencia real sólo las fases sin tareas abiertas observadas al entrar; no se cierra ninguna tarea y el crédito se puede anular",
|
|
2161
|
+
recommended: true,
|
|
2162
|
+
outcome: { kind: "continue" },
|
|
2163
|
+
},
|
|
2164
|
+
],
|
|
2165
|
+
},
|
|
2091
2166
|
{
|
|
2092
2167
|
id: "plan-exec.source-scope",
|
|
2093
2168
|
scope: "plan-exec",
|
|
@@ -2144,7 +2219,7 @@ export const FLOW_DECISIONS = [
|
|
|
2144
2219
|
execution: { kind: "internal", operation: "plan-exec.batch-infer" },
|
|
2145
2220
|
evidence: ["plan.batch-inferido"],
|
|
2146
2221
|
idempotent: true,
|
|
2147
|
-
recovery: "reanudá con 'aw flow advance'
|
|
2222
|
+
recovery: "reanudá con 'aw flow advance'; si el plan cambió, usá 'aw flow recover --session <código> --reinfer-batch' para ver el diff antes de re-sellar el lote no publicado",
|
|
2148
2223
|
},
|
|
2149
2224
|
},
|
|
2150
2225
|
{
|
|
@@ -2177,7 +2252,7 @@ export const FLOW_DECISIONS = [
|
|
|
2177
2252
|
ownership: "cli-owned",
|
|
2178
2253
|
document: CODE_POLICIES_MD,
|
|
2179
2254
|
attribution: PLAN_ATTRIBUTION,
|
|
2180
|
-
effects: ["local_additive"],
|
|
2255
|
+
effects: ["local_additive", "mutate_overwrite"],
|
|
2181
2256
|
// BEFORE `plan-exec.implementation`, and the position is the whole rule: the
|
|
2182
2257
|
// policy says a loop that edits code edits inside its unit, and a unit obtained
|
|
2183
2258
|
// after the first write would be an isolation nobody was ever isolated by.
|
|
@@ -2364,7 +2439,7 @@ export const FLOW_DECISIONS = [
|
|
|
2364
2439
|
document: PLAN_EXEC_LOOP,
|
|
2365
2440
|
attribution: PLAN_ATTRIBUTION,
|
|
2366
2441
|
effects: ["execute"],
|
|
2367
|
-
route_control:
|
|
2442
|
+
route_control: ROUTE_PHASE_VALIDATION,
|
|
2368
2443
|
// Running the proofs the plan itself declares is the run verifying its own
|
|
2369
2444
|
// work: custody covers the `execute`, and the real output stays mandatory.
|
|
2370
2445
|
custody: "run",
|
|
@@ -2384,9 +2459,11 @@ export const FLOW_DECISIONS = [
|
|
|
2384
2459
|
kind: "external",
|
|
2385
2460
|
reason: "correr las pruebas de fase es ejecutar código, nunca una operación interna",
|
|
2386
2461
|
},
|
|
2387
|
-
|
|
2462
|
+
// One proof per source of the batch: what ties the output to THIS batch's
|
|
2463
|
+
// checkout, so an envelope recycled from another batch cannot credit it.
|
|
2464
|
+
evidence: ["plan.validaciones-de-fase-verdes", SOURCE_BOUNDED_EVIDENCE],
|
|
2388
2465
|
idempotent: true,
|
|
2389
|
-
recovery: "arreglá lo que la validación reprobó y volvé a correr las pruebas afectadas: la transición sigue pendiente hasta que su salida real vuelva en verde",
|
|
2466
|
+
recovery: "arreglá lo que la validación reprobó y volvé a correr las pruebas afectadas: la transición sigue pendiente hasta que su salida real vuelva en verde, con una prueba 'aw flow prove --source <alias>' de cada fuente del lote tomada después de sus cambios",
|
|
2390
2467
|
},
|
|
2391
2468
|
},
|
|
2392
2469
|
{
|
|
@@ -2406,7 +2483,57 @@ export const FLOW_DECISIONS = [
|
|
|
2406
2483
|
ownership: "cli-owned",
|
|
2407
2484
|
document: CODE_POLICIES_MD,
|
|
2408
2485
|
attribution: PLAN_ATTRIBUTION,
|
|
2409
|
-
|
|
2486
|
+
answer_contract: "batch-review",
|
|
2487
|
+
},
|
|
2488
|
+
{
|
|
2489
|
+
id: "plan-exec.batch-commit-proposal",
|
|
2490
|
+
scope: "plan-exec",
|
|
2491
|
+
title: "proponer el mensaje de commit por fuente sobre las rutas del lote",
|
|
2492
|
+
authority: "agent",
|
|
2493
|
+
ownership: "cli-owned",
|
|
2494
|
+
document: PLAN_EXEC_LOOP,
|
|
2495
|
+
attribution: PLAN_ATTRIBUTION,
|
|
2496
|
+
},
|
|
2497
|
+
{
|
|
2498
|
+
id: "plan-exec.batch-commit-authorization",
|
|
2499
|
+
scope: "plan-exec",
|
|
2500
|
+
title: "aprobar los commits propuestos del lote con sus rutas y mensajes",
|
|
2501
|
+
authority: "human",
|
|
2502
|
+
ownership: "cli-owned",
|
|
2503
|
+
document: PLAN_EXEC_LOOP,
|
|
2504
|
+
attribution: PLAN_ATTRIBUTION,
|
|
2505
|
+
authorizes: { approve: "Aprobar los commits del lote", transition: "plan-exec.batch-commit" },
|
|
2506
|
+
alternatives: [
|
|
2507
|
+
{
|
|
2508
|
+
label: "Aprobar los commits del lote",
|
|
2509
|
+
consequence: "el CLI crea sólo los commits del lote aprobado, por fuente y por rutas",
|
|
2510
|
+
recommended: true,
|
|
2511
|
+
outcome: { kind: "continue" },
|
|
2512
|
+
},
|
|
2513
|
+
],
|
|
2514
|
+
},
|
|
2515
|
+
{
|
|
2516
|
+
id: "plan-exec.batch-commit",
|
|
2517
|
+
scope: "plan-exec",
|
|
2518
|
+
title: "crear y comprobar los commits aprobados del lote",
|
|
2519
|
+
authority: "cli",
|
|
2520
|
+
ownership: "cli-owned",
|
|
2521
|
+
document: PLAN_EXEC_LOOP,
|
|
2522
|
+
attribution: PLAN_ATTRIBUTION,
|
|
2523
|
+
effects: ["execute", "local_additive"],
|
|
2524
|
+
custody: "run",
|
|
2525
|
+
action: {
|
|
2526
|
+
invocation: {
|
|
2527
|
+
program: "aw",
|
|
2528
|
+
args: ["flow", "advance", "--code", "{code}"],
|
|
2529
|
+
target: ".",
|
|
2530
|
+
input: null,
|
|
2531
|
+
},
|
|
2532
|
+
execution: { kind: "internal", operation: "plan-exec.batch-commit" },
|
|
2533
|
+
evidence: ["plan.batch-commits-verificados"],
|
|
2534
|
+
idempotent: true,
|
|
2535
|
+
recovery: "reanudá con aw flow advance: se reconocen los recibos y commits propios ya aplicados antes de avanzar",
|
|
2536
|
+
},
|
|
2410
2537
|
},
|
|
2411
2538
|
{
|
|
2412
2539
|
id: "plan-exec.batch-close",
|
|
@@ -2432,7 +2559,7 @@ export const FLOW_DECISIONS = [
|
|
|
2432
2559
|
execution: { kind: "internal", operation: "plan-exec.batch-close" },
|
|
2433
2560
|
evidence: ["plan.batch-publicado"],
|
|
2434
2561
|
idempotent: true,
|
|
2435
|
-
recovery: "reanudá con 'aw flow advance'
|
|
2562
|
+
recovery: "reanudá con 'aw flow advance'; si el plan cambió antes de publicar, mirá el diff con 'aw flow recover --session <código> --reinfer-batch' y volvé a validar el lote",
|
|
2436
2563
|
},
|
|
2437
2564
|
},
|
|
2438
2565
|
// ── The settlement, between the last batch and the final validation ──────
|
|
@@ -2522,7 +2649,6 @@ export const FLOW_DECISIONS = [
|
|
|
2522
2649
|
ownership: "cli-owned",
|
|
2523
2650
|
document: PLAN_EXEC_LOOP,
|
|
2524
2651
|
attribution: PLAN_ATTRIBUTION,
|
|
2525
|
-
route_control: ROUTE_VALIDATION,
|
|
2526
2652
|
// BEFORE Git, and the real walk is what proved it: the registry had inherited
|
|
2527
2653
|
// an order where the plan was committed and only then validated and stamped.
|
|
2528
2654
|
// The document says the opposite — "last Batch also runs final validation
|
|
@@ -2559,7 +2685,7 @@ export const FLOW_DECISIONS = [
|
|
|
2559
2685
|
{
|
|
2560
2686
|
id: "plan-exec.commit-authorization",
|
|
2561
2687
|
scope: "plan-exec",
|
|
2562
|
-
title: "aprobar los commits
|
|
2688
|
+
title: "aprobar los commits de una corrida heredada",
|
|
2563
2689
|
authority: "human",
|
|
2564
2690
|
ownership: "cli-owned",
|
|
2565
2691
|
document: CODE_POLICIES_MD,
|
|
@@ -2578,12 +2704,6 @@ export const FLOW_DECISIONS = [
|
|
|
2578
2704
|
recommended: true,
|
|
2579
2705
|
outcome: { kind: "continue" },
|
|
2580
2706
|
},
|
|
2581
|
-
{
|
|
2582
|
-
label: "Dejar el batch sin commitear",
|
|
2583
|
-
consequence: "los cambios quedan en el árbol de trabajo y el batch se registra sin commitear en CHECKPOINT y BACKLOG",
|
|
2584
|
-
recommended: false,
|
|
2585
|
-
outcome: { kind: "continue" },
|
|
2586
|
-
},
|
|
2587
2707
|
],
|
|
2588
2708
|
},
|
|
2589
2709
|
{
|
|
@@ -2663,7 +2783,7 @@ export const FLOW_DECISIONS = [
|
|
|
2663
2783
|
// Integrating an already-integrated session is a no-op that reports the same
|
|
2664
2784
|
// thing, which is what lets the recovery end where it started.
|
|
2665
2785
|
idempotent: true,
|
|
2666
|
-
recovery: "una unidad en conflicto conserva su merge y sus commits: resolvé con 'aw fix-git --path <
|
|
2786
|
+
recovery: "una unidad en conflicto conserva su merge y sus commits: resolvé con 'aw fix-git --path <ruta que reportó la integración>' (prepare → apply → commit --confirm) y volvé a correr la integración; la transición sigue pendiente mientras la sesión conserve una unidad",
|
|
2667
2787
|
},
|
|
2668
2788
|
},
|
|
2669
2789
|
{
|
|
@@ -3035,6 +3155,14 @@ export const FLOW_DECISIONS = [
|
|
|
3035
3155
|
* a second list: one field, one reason, one guard.
|
|
3036
3156
|
*/
|
|
3037
3157
|
export const COMMAND_EXCLUSIONS = [
|
|
3158
|
+
{
|
|
3159
|
+
command: "workspace-commit",
|
|
3160
|
+
reason: "comando transversal sin corrida propia: prepare sella mensaje y pathspec del workspace y apply exige ese digest; el cierre del chasis también lo invoca sólo después del consentimiento humano",
|
|
3161
|
+
},
|
|
3162
|
+
{
|
|
3163
|
+
command: "workspace-move",
|
|
3164
|
+
reason: "mudanza o reparación puntual de un hub; valida el destino y las referencias vivas antes de mover, sin abrir una corrida adicional",
|
|
3165
|
+
},
|
|
3038
3166
|
{
|
|
3039
3167
|
command: "spec-new",
|
|
3040
3168
|
reason: "comando `/w:` de una sola pasada que no abre loop: sin corrida que dirigir, su gate de división lo aplica el propio comando con la regla de modules/SPLIT-GATE.md, que por eso conserva su enunciado",
|
|
@@ -3091,8 +3219,16 @@ export const COMMAND_EXCLUSIONS = [
|
|
|
3091
3219
|
{ command: "stack", reason: "detección de stack informativa" },
|
|
3092
3220
|
{ command: "sources", reason: "inventario de fuentes del workspace" },
|
|
3093
3221
|
{ command: "set-working-branch", reason: "configuración declarativa de rama" },
|
|
3222
|
+
{
|
|
3223
|
+
command: "doc-branch",
|
|
3224
|
+
reason: "asociación declarativa de una rama de trabajo a un documento, con lectura sin efectos y escritura append-only después de asegurar la rama",
|
|
3225
|
+
},
|
|
3094
3226
|
{ command: "set-qa-branch", reason: "configuración declarativa de rama" },
|
|
3227
|
+
{ command: "set-exception-branch", reason: "configuración declarativa de rama" },
|
|
3228
|
+
{ command: "set-edit-mode", reason: "configuración declarativa del workspace" },
|
|
3229
|
+
{ command: "set-pipeline", reason: "configuración declarativa de build y test por fuente" },
|
|
3095
3230
|
{ command: "remove-source", reason: "operación de configuración del workspace" },
|
|
3231
|
+
{ command: "add-source", reason: "operación de configuración del workspace" },
|
|
3096
3232
|
{ command: "git-flow", reason: "utilidad de ramas sin recorrido de flow" },
|
|
3097
3233
|
{ command: "merge-state", reason: "lectura del estado de una fusión" },
|
|
3098
3234
|
{ command: "attach-multiroot", reason: "configuración de multiroot" },
|
|
@@ -3113,6 +3249,11 @@ export const COMMAND_EXCLUSIONS = [
|
|
|
3113
3249
|
reason: "comparte la clasificación de export-reports: selección semántica del agente más corpus, numeración y escritura del CLI, con su propio destino documental",
|
|
3114
3250
|
},
|
|
3115
3251
|
{ command: "history-update", reason: "reparación del registro durable" },
|
|
3252
|
+
{
|
|
3253
|
+
command: "session-pause",
|
|
3254
|
+
reason: "marca explícita de pausa por decisión humana, fuera de recorridos",
|
|
3255
|
+
},
|
|
3256
|
+
{ command: "history", reason: "reconciliación de sólo lectura del registro de sesiones" },
|
|
3116
3257
|
{ command: "project-md-upsert", reason: "escritura del bloque de proyecto en el host" },
|
|
3117
3258
|
{
|
|
3118
3259
|
command: "workspace-migrate",
|
|
@@ -3163,25 +3304,42 @@ export function journeyOfFlow(flow) {
|
|
|
3163
3304
|
const at = (placement) => transversal.filter((decision) => decision.placement === placement);
|
|
3164
3305
|
return [...at("prefix"), ...decisionsOfScope(flow), ...at("suffix")];
|
|
3165
3306
|
}
|
|
3307
|
+
const FINALIZE_TRANSITION = "chassis.finalize";
|
|
3166
3308
|
/**
|
|
3167
3309
|
* The actual cursor journey for a persisted run.
|
|
3168
3310
|
*
|
|
3169
|
-
*
|
|
3170
|
-
*
|
|
3171
|
-
*
|
|
3172
|
-
*
|
|
3173
|
-
*
|
|
3311
|
+
* The registry list, with two kinds of repetition layered on it: plan-exec's
|
|
3312
|
+
* batch segment (see {@link batchSegments}) and the reentries the run recorded
|
|
3313
|
+
* (see {@link JourneyReentry}). Both only ever INSERT rows at or after the
|
|
3314
|
+
* cursor, so the cursor remains an append-only prefix — it never rewinds, which
|
|
3315
|
+
* would make already-applied transitions re-runnable.
|
|
3174
3316
|
*
|
|
3175
3317
|
* This intentionally accepts only the small state shape it reads, avoiding a
|
|
3176
3318
|
* runtime dependency back from the authority registry to the run-state domain.
|
|
3177
3319
|
*/
|
|
3178
3320
|
export function journeyForState(state, baseJourney) {
|
|
3321
|
+
return expandJourney(state, baseJourney).rows;
|
|
3322
|
+
}
|
|
3323
|
+
/** {@link journeyForState} with the reentry each row came from. */
|
|
3324
|
+
export function expandJourney(state, baseJourney) {
|
|
3179
3325
|
// The runtime normally supplies no base, so this reads the registry directly.
|
|
3180
|
-
// A controlled host may supply its own fixture journey
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3326
|
+
// A controlled host may supply its own fixture journey.
|
|
3327
|
+
const source = baseJourney ?? journeyOfFlow(state.flow);
|
|
3328
|
+
// A run finalized by an older CLI must keep its completed cursor: inserting
|
|
3329
|
+
// a human gate before an already applied finalize would reinterpret its close.
|
|
3330
|
+
const base = state.applied?.includes(FINALIZE_TRANSITION) && !state.applied.includes("chassis.commit-choice")
|
|
3331
|
+
? source.filter((row) => row.id !== "chassis.commit-choice")
|
|
3332
|
+
: source;
|
|
3333
|
+
const batched = state.flow === "plan-exec" ? batchSegments(state, base) : base;
|
|
3334
|
+
return withReentries(batched, base, state.reentries ?? []);
|
|
3335
|
+
}
|
|
3336
|
+
/**
|
|
3337
|
+
* PLAN-exec's repeatable middle: every sealed batch appends another copy of
|
|
3338
|
+
* `batch-eligibility-signal … batch-close` while an open phase remains, and the
|
|
3339
|
+
* final close simply stops adding a copy, exposing final validation, Git and
|
|
3340
|
+
* `done`. A fixture journey without the segment keeps its ordinary path.
|
|
3341
|
+
*/
|
|
3342
|
+
function batchSegments(state, base) {
|
|
3185
3343
|
const first = base.findIndex((decision) => decision.id === "plan-exec.batch-eligibility-signal");
|
|
3186
3344
|
const last = base.findIndex((decision) => decision.id === "plan-exec.batch-close");
|
|
3187
3345
|
// A registry build missing either boundary must keep the ordinary path rather
|
|
@@ -3208,7 +3366,9 @@ export function journeyForState(state, baseJourney) {
|
|
|
3208
3366
|
const noWorkInferenceStarted = copies === 0 &&
|
|
3209
3367
|
inference >= first &&
|
|
3210
3368
|
(state.applied?.includes("plan-exec.batch-inference") === true ||
|
|
3211
|
-
state.boundary === "plan-exec.batch-inference"
|
|
3369
|
+
state.boundary === "plan-exec.batch-inference" ||
|
|
3370
|
+
// A close there moves the boundary to its finalize; the row stood on is the same.
|
|
3371
|
+
(state.reentries ?? []).some((reentry) => reentry.kind === "close" && reentry.transition === "plan-exec.batch-inference"));
|
|
3212
3372
|
if (noWorkInferenceStarted) {
|
|
3213
3373
|
return [...base.slice(0, first), ...base.slice(first, inference + 1), ...base.slice(last + 1)];
|
|
3214
3374
|
}
|
|
@@ -3223,6 +3383,132 @@ export function journeyForState(state, baseJourney) {
|
|
|
3223
3383
|
...base.slice(last + 1),
|
|
3224
3384
|
];
|
|
3225
3385
|
}
|
|
3386
|
+
/**
|
|
3387
|
+
* Lay the recorded reentries over the journey, oldest first.
|
|
3388
|
+
*
|
|
3389
|
+
* Each one names its row as the run walked it at that moment, which is exactly
|
|
3390
|
+
* what replaying them in order rebuilds. A reentry whose rows this build no
|
|
3391
|
+
* longer has is left out rather than approximated — and so is the reopen of a
|
|
3392
|
+
* close left out — so the cursor check names the mismatch instead of the run
|
|
3393
|
+
* walking an invented stretch.
|
|
3394
|
+
*/
|
|
3395
|
+
function withReentries(rows, base, reentries) {
|
|
3396
|
+
let journey = { rows, copies: rows.map(() => 0) };
|
|
3397
|
+
let cut = null;
|
|
3398
|
+
for (const [index, reentry] of reentries.entries()) {
|
|
3399
|
+
const ordinal = index + 1;
|
|
3400
|
+
if (reentry.kind === "refine") {
|
|
3401
|
+
journey = insertRedraft(journey, base, reentry, ordinal);
|
|
3402
|
+
}
|
|
3403
|
+
else if (reentry.kind === "review") {
|
|
3404
|
+
journey = insertReview(journey, base, reentry, ordinal);
|
|
3405
|
+
}
|
|
3406
|
+
else if (reentry.kind === "reinfer") {
|
|
3407
|
+
journey = insertBatchRevalidation(journey, base, reentry, ordinal);
|
|
3408
|
+
}
|
|
3409
|
+
else if (reentry.kind === "close") {
|
|
3410
|
+
const closed = closeAt(journey, base, reentry, ordinal);
|
|
3411
|
+
journey = closed?.journey ?? journey;
|
|
3412
|
+
cut = closed?.cut ?? "dropped";
|
|
3413
|
+
}
|
|
3414
|
+
else {
|
|
3415
|
+
if (cut !== "dropped")
|
|
3416
|
+
journey = reopen(journey, cut, reentry, ordinal);
|
|
3417
|
+
cut = null;
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
return journey;
|
|
3421
|
+
}
|
|
3422
|
+
/** Index of the `occurrence`-th row of `transition`, or -1 when there is none. */
|
|
3423
|
+
export function occurrenceIndex(rows, transition, occurrence) {
|
|
3424
|
+
let seen = 0;
|
|
3425
|
+
for (const [index, row] of rows.entries()) {
|
|
3426
|
+
if (row.id !== transition)
|
|
3427
|
+
continue;
|
|
3428
|
+
seen += 1;
|
|
3429
|
+
if (seen === occurrence)
|
|
3430
|
+
return index;
|
|
3431
|
+
}
|
|
3432
|
+
return -1;
|
|
3433
|
+
}
|
|
3434
|
+
/** Which walk of its id the row at `index` is, counting from 1. */
|
|
3435
|
+
export function occurrenceAt(rows, index) {
|
|
3436
|
+
const id = rows[index]?.id;
|
|
3437
|
+
return rows.slice(0, index + 1).filter((row) => row.id === id).length;
|
|
3438
|
+
}
|
|
3439
|
+
function insertRedraft(journey, base, reentry, ordinal) {
|
|
3440
|
+
const from = base.findIndex((decision) => decision.id === reentry.from);
|
|
3441
|
+
const to = base.findIndex((decision) => decision.id === reentry.transition);
|
|
3442
|
+
const origin = occurrenceIndex(journey.rows, reentry.transition, reentry.occurrence);
|
|
3443
|
+
if (from < 0 || to < from || origin < 0)
|
|
3444
|
+
return journey;
|
|
3445
|
+
const at = origin + 1;
|
|
3446
|
+
const segment = base.slice(from, to + 1);
|
|
3447
|
+
return {
|
|
3448
|
+
rows: [...journey.rows.slice(0, at), ...segment, ...journey.rows.slice(at)],
|
|
3449
|
+
copies: [
|
|
3450
|
+
...journey.copies.slice(0, at),
|
|
3451
|
+
...segment.map(() => ordinal),
|
|
3452
|
+
...journey.copies.slice(at),
|
|
3453
|
+
],
|
|
3454
|
+
};
|
|
3455
|
+
}
|
|
3456
|
+
/** Restore required evidence immediately before a legacy pending close, even after reopening. */
|
|
3457
|
+
function insertReview(journey, base, reentry, ordinal) {
|
|
3458
|
+
const row = base.find((decision) => decision.id === "plan-exec.review-findings");
|
|
3459
|
+
const at = occurrenceIndex(journey.rows, reentry.transition, reentry.occurrence);
|
|
3460
|
+
if (row === undefined || at < 0)
|
|
3461
|
+
return journey;
|
|
3462
|
+
return {
|
|
3463
|
+
rows: [...journey.rows.slice(0, at), row, ...journey.rows.slice(at)],
|
|
3464
|
+
copies: [...journey.copies.slice(0, at), ordinal, ...journey.copies.slice(at)],
|
|
3465
|
+
};
|
|
3466
|
+
}
|
|
3467
|
+
/** Re-run validation and review before the uncommitted batch is published. */
|
|
3468
|
+
function insertBatchRevalidation(journey, base, reentry, ordinal) {
|
|
3469
|
+
const start = base.findIndex((decision) => decision.id === "plan-exec.validation-execution");
|
|
3470
|
+
const end = base.findIndex((decision) => decision.id === reentry.transition);
|
|
3471
|
+
const at = occurrenceIndex(journey.rows, reentry.transition, reentry.occurrence);
|
|
3472
|
+
if (start < 0 || end <= start || at < 0)
|
|
3473
|
+
return journey;
|
|
3474
|
+
const segment = base.slice(start, end);
|
|
3475
|
+
return {
|
|
3476
|
+
rows: [...journey.rows.slice(0, at), ...segment, ...journey.rows.slice(at)],
|
|
3477
|
+
copies: [
|
|
3478
|
+
...journey.copies.slice(0, at),
|
|
3479
|
+
...segment.map(() => ordinal),
|
|
3480
|
+
...journey.copies.slice(at),
|
|
3481
|
+
],
|
|
3482
|
+
};
|
|
3483
|
+
}
|
|
3484
|
+
function closeAt(journey, base, reentry, ordinal) {
|
|
3485
|
+
const finalize = base.find((decision) => decision.id === FINALIZE_TRANSITION);
|
|
3486
|
+
const at = occurrenceIndex(journey.rows, reentry.transition, reentry.occurrence);
|
|
3487
|
+
if (finalize === undefined || at < 0)
|
|
3488
|
+
return null;
|
|
3489
|
+
return {
|
|
3490
|
+
journey: {
|
|
3491
|
+
rows: [...journey.rows.slice(0, at), finalize],
|
|
3492
|
+
copies: [...journey.copies.slice(0, at), ordinal],
|
|
3493
|
+
},
|
|
3494
|
+
cut: { rows: journey.rows.slice(at), copies: journey.copies.slice(at) },
|
|
3495
|
+
};
|
|
3496
|
+
}
|
|
3497
|
+
function reopen(journey, cut, reentry, ordinal) {
|
|
3498
|
+
// After a close, the rows it cut are the same rows, not copies: the boundary it
|
|
3499
|
+
// stood on keeps its attempts, so closing and reopening never refills a budget.
|
|
3500
|
+
if (cut !== null) {
|
|
3501
|
+
return { rows: [...journey.rows, ...cut.rows], copies: [...journey.copies, ...cut.copies] };
|
|
3502
|
+
}
|
|
3503
|
+
const from = occurrenceIndex(journey.rows, reentry.transition, reentry.occurrence);
|
|
3504
|
+
if (from < 0)
|
|
3505
|
+
return journey;
|
|
3506
|
+
const again = journey.rows.slice(from);
|
|
3507
|
+
return {
|
|
3508
|
+
rows: [...journey.rows, ...again],
|
|
3509
|
+
copies: [...journey.copies, ...again.map(() => ordinal)],
|
|
3510
|
+
};
|
|
3511
|
+
}
|
|
3226
3512
|
/**
|
|
3227
3513
|
* The `docs/` folders a flow may write, as the chassis' boundary states them.
|
|
3228
3514
|
*
|