@ybotok/loam 0.2.0-alpha.7 → 0.2.0-alpha.9
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 +1315 -1
- package/COMPARISON.md +91 -3
- package/CONTRIBUTING.md +37 -0
- package/MIGRATING-from-OpenSpec.md +40 -22
- package/QUICKSTART.md +181 -9
- package/README.md +256 -57
- package/ROADMAP.md +83 -7
- package/SCHEMA.md +569 -98
- package/WORKFLOW.md +272 -62
- package/dist/cli.js +26 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt/adopt.js +5 -10
- package/dist/commands/adopt/adopt.js.map +1 -1
- package/dist/commands/archive/archive.js +15 -18
- package/dist/commands/archive/archive.js.map +1 -1
- package/dist/commands/archive/plan/contracts/asyncapi.js +27 -41
- package/dist/commands/archive/plan/contracts/asyncapi.js.map +1 -1
- package/dist/commands/archive/plan/contracts/consumers.js +56 -0
- package/dist/commands/archive/plan/contracts/consumers.js.map +1 -0
- package/dist/commands/archive/plan/contracts/openapi.js +25 -42
- package/dist/commands/archive/plan/contracts/openapi.js.map +1 -1
- package/dist/commands/archive/plan/contracts/verdict-lines.js +41 -0
- package/dist/commands/archive/plan/contracts/verdict-lines.js.map +1 -0
- package/dist/commands/archive/plan/gate.js +3 -7
- package/dist/commands/archive/plan/gate.js.map +1 -1
- package/dist/commands/archive/plan/landscape.js +4 -4
- package/dist/commands/archive/plan/landscape.js.map +1 -1
- package/dist/commands/archive/plan/refusal.js +8 -18
- package/dist/commands/archive/plan/refusal.js.map +1 -1
- package/dist/commands/archive/plan/specs.js +134 -25
- package/dist/commands/archive/plan/specs.js.map +1 -1
- package/dist/commands/archive/plan/state.js +1 -0
- package/dist/commands/archive/plan/state.js.map +1 -1
- package/dist/commands/archive/run.js +33 -11
- package/dist/commands/archive/run.js.map +1 -1
- package/dist/commands/archive/shipped.js +49 -0
- package/dist/commands/archive/shipped.js.map +1 -0
- package/dist/commands/context/context.js +4 -7
- package/dist/commands/context/context.js.map +1 -1
- package/dist/commands/context/print.js +2 -2
- package/dist/commands/context/print.js.map +1 -1
- package/dist/commands/delta/delta.js +44 -12
- package/dist/commands/delta/delta.js.map +1 -1
- package/dist/commands/delta/print.js +1 -1
- package/dist/commands/delta/print.js.map +1 -1
- package/dist/commands/dependencies.js +3 -7
- package/dist/commands/dependencies.js.map +1 -1
- package/dist/commands/diff/diff.js +20 -27
- package/dist/commands/diff/diff.js.map +1 -1
- package/dist/commands/explore.js +4 -8
- package/dist/commands/explore.js.map +1 -1
- package/dist/commands/gate/gate.js +45 -8
- package/dist/commands/gate/gate.js.map +1 -1
- package/dist/commands/gate/print.js +15 -3
- package/dist/commands/gate/print.js.map +1 -1
- package/dist/commands/gherkin/commit.js +13 -54
- package/dist/commands/gherkin/commit.js.map +1 -1
- package/dist/commands/gherkin/gherkin.js +36 -20
- package/dist/commands/gherkin/gherkin.js.map +1 -1
- package/dist/commands/gherkin/reconcile.js +10 -13
- package/dist/commands/gherkin/reconcile.js.map +1 -1
- package/dist/commands/init/first-hour.js +44 -0
- package/dist/commands/init/first-hour.js.map +1 -1
- package/dist/commands/init/init.js +18 -22
- package/dist/commands/init/init.js.map +1 -1
- package/dist/commands/list/campaign/campaign.js +4 -6
- package/dist/commands/list/campaign/campaign.js.map +1 -1
- package/dist/commands/list/json.js +0 -4
- package/dist/commands/list/json.js.map +1 -1
- package/dist/commands/list/list.js +38 -23
- package/dist/commands/list/list.js.map +1 -1
- package/dist/commands/list/print.js +38 -6
- package/dist/commands/list/print.js.map +1 -1
- package/dist/commands/list/suites/suites.js +140 -0
- package/dist/commands/list/suites/suites.js.map +1 -0
- package/dist/commands/list/views.js +28 -33
- package/dist/commands/list/views.js.map +1 -1
- package/dist/commands/mcp/dispatch.js +91 -36
- package/dist/commands/mcp/dispatch.js.map +1 -1
- package/dist/commands/mcp/mcp.js +56 -15
- package/dist/commands/mcp/mcp.js.map +1 -1
- package/dist/commands/mcp/serve.js.map +1 -1
- package/dist/commands/migrate-openspec/materialize/active.js +27 -22
- package/dist/commands/migrate-openspec/materialize/active.js.map +1 -1
- package/dist/commands/migrate-openspec/materialize/stage.js +4 -3
- package/dist/commands/migrate-openspec/materialize/stage.js.map +1 -1
- package/dist/commands/migrate-openspec/materialize/target.js +2 -2
- package/dist/commands/migrate-openspec/materialize/target.js.map +1 -1
- package/dist/commands/migrate-openspec/openspec/decisions.js +9 -14
- package/dist/commands/migrate-openspec/openspec/decisions.js.map +1 -1
- package/dist/commands/migrate-openspec/openspec/error.js +7 -8
- package/dist/commands/migrate-openspec/openspec/error.js.map +1 -1
- package/dist/commands/migrate-openspec/openspec/mapping.js +1 -9
- package/dist/commands/migrate-openspec/openspec/mapping.js.map +1 -1
- package/dist/commands/migrate-openspec/openspec/paths.js +3 -6
- package/dist/commands/migrate-openspec/openspec/paths.js.map +1 -1
- package/dist/commands/new/capability-template.js +118 -0
- package/dist/commands/new/capability-template.js.map +1 -0
- package/dist/commands/new/commit.js +8 -22
- package/dist/commands/new/commit.js.map +1 -1
- package/dist/commands/new/modifies.js +206 -0
- package/dist/commands/new/modifies.js.map +1 -0
- package/dist/commands/new/new.js +59 -14
- package/dist/commands/new/new.js.map +1 -1
- package/dist/commands/new/templates.js +48 -124
- package/dist/commands/new/templates.js.map +1 -1
- package/dist/commands/open.js +3 -7
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/policy/gate.js +27 -0
- package/dist/commands/policy/gate.js.map +1 -1
- package/dist/commands/rebase/plan.js +2 -2
- package/dist/commands/rebase/plan.js.map +1 -1
- package/dist/commands/rebase/rebase.js +60 -35
- package/dist/commands/rebase/rebase.js.map +1 -1
- package/dist/commands/seed/commit.js +21 -25
- package/dist/commands/seed/commit.js.map +1 -1
- package/dist/commands/seed/seed.js +6 -9
- package/dist/commands/seed/seed.js.map +1 -1
- package/dist/commands/show/show.js +3 -7
- package/dist/commands/show/show.js.map +1 -1
- package/dist/commands/status/print.js +13 -4
- package/dist/commands/status/print.js.map +1 -1
- package/dist/commands/status/status.js +3 -7
- package/dist/commands/status/status.js.map +1 -1
- package/dist/commands/steps/steps.js +3 -7
- package/dist/commands/steps/steps.js.map +1 -1
- package/dist/commands/subsystem/edit.js +3 -5
- package/dist/commands/subsystem/edit.js.map +1 -1
- package/dist/commands/subsystem/move.js +5 -8
- package/dist/commands/subsystem/move.js.map +1 -1
- package/dist/commands/subsystem/query.js +2 -4
- package/dist/commands/subsystem/query.js.map +1 -1
- package/dist/commands/subsystem/subsystem.js +4 -7
- package/dist/commands/subsystem/subsystem.js.map +1 -1
- package/dist/commands/subsystem/sync.js +14 -41
- package/dist/commands/subsystem/sync.js.map +1 -1
- package/dist/commands/subsystem/txn/txn.js +17 -38
- package/dist/commands/subsystem/txn/txn.js.map +1 -1
- package/dist/commands/subsystem/txn/views.js +32 -5
- package/dist/commands/subsystem/txn/views.js.map +1 -1
- package/dist/commands/tasks/render.js +116 -0
- package/dist/commands/tasks/render.js.map +1 -0
- package/dist/commands/tasks/tasks.js +113 -0
- package/dist/commands/tasks/tasks.js.map +1 -0
- package/dist/commands/unarchive/manifest.js +6 -9
- package/dist/commands/unarchive/manifest.js.map +1 -1
- package/dist/commands/unarchive/restore.js +17 -28
- package/dist/commands/unarchive/restore.js.map +1 -1
- package/dist/commands/unarchive/unarchive.js +22 -30
- package/dist/commands/unarchive/unarchive.js.map +1 -1
- package/dist/commands/validate/arch-coverage.js +6 -15
- package/dist/commands/validate/arch-coverage.js.map +1 -1
- package/dist/commands/validate/checks/fleet-shape.js +4 -49
- package/dist/commands/validate/checks/fleet-shape.js.map +1 -1
- package/dist/commands/validate/checks/requirements.js +18 -8
- package/dist/commands/validate/checks/requirements.js.map +1 -1
- package/dist/commands/validate/checks/sources.js +6 -2
- package/dist/commands/validate/checks/sources.js.map +1 -1
- package/dist/commands/validate/feature.js +23 -19
- package/dist/commands/validate/feature.js.map +1 -1
- package/dist/commands/validate/fleet/landscape.js +23 -23
- package/dist/commands/validate/fleet/landscape.js.map +1 -1
- package/dist/commands/validate/fleet/map/attest.js +6 -10
- package/dist/commands/validate/fleet/map/attest.js.map +1 -1
- package/dist/commands/validate/fleet/map/bindings.js +1 -3
- package/dist/commands/validate/fleet/map/bindings.js.map +1 -1
- package/dist/commands/validate/fleet/map/usecases.js +5 -11
- package/dist/commands/validate/fleet/map/usecases.js.map +1 -1
- package/dist/commands/validate/fleet/obligations.js +1 -5
- package/dist/commands/validate/fleet/obligations.js.map +1 -1
- package/dist/commands/validate/fleet/scorecard/print.js +5 -1
- package/dist/commands/validate/fleet/scorecard/print.js.map +1 -1
- package/dist/commands/validate/fleet/scorecard/scorecard.js +17 -11
- package/dist/commands/validate/fleet/scorecard/scorecard.js.map +1 -1
- package/dist/commands/validate/fleet/usecases/usecases.js +6 -4
- package/dist/commands/validate/fleet/usecases/usecases.js.map +1 -1
- package/dist/commands/validate/fleet/views/fleet-project.js.map +1 -1
- package/dist/commands/validate/fleet/views/root-documents.js +8 -28
- package/dist/commands/validate/fleet/views/root-documents.js.map +1 -1
- package/dist/commands/validate/links/corpus.js +1 -4
- package/dist/commands/validate/links/corpus.js.map +1 -1
- package/dist/commands/validate/links/glossary.js.map +1 -1
- package/dist/commands/validate/report.js +5 -4
- package/dist/commands/validate/report.js.map +1 -1
- package/dist/commands/validate/scope.js +113 -0
- package/dist/commands/validate/scope.js.map +1 -0
- package/dist/commands/validate/service/api.js +16 -104
- package/dist/commands/validate/service/api.js.map +1 -1
- package/dist/commands/validate/service/contracts/generated.js +134 -0
- package/dist/commands/validate/service/contracts/generated.js.map +1 -0
- package/dist/commands/validate/service/events/events.js +1 -1
- package/dist/commands/validate/service/events/events.js.map +1 -1
- package/dist/commands/validate/service/events/message-producers.js +1 -1
- package/dist/commands/validate/service/events/message-producers.js.map +1 -1
- package/dist/commands/validate/service/evidence-pins.js +56 -10
- package/dist/commands/validate/service/evidence-pins.js.map +1 -1
- package/dist/commands/validate/service/service.js +16 -26
- package/dist/commands/validate/service/service.js.map +1 -1
- package/dist/commands/validate/service/specs.js +31 -38
- package/dist/commands/validate/service/specs.js.map +1 -1
- package/dist/commands/validate/service/spine.js +8 -11
- package/dist/commands/validate/service/spine.js.map +1 -1
- package/dist/commands/validate/service/usecases/usecases.js +3 -3
- package/dist/commands/validate/service/usecases/usecases.js.map +1 -1
- package/dist/commands/validate/validate.js +44 -26
- package/dist/commands/validate/validate.js.map +1 -1
- package/dist/commands/verify/cross/diff.js +2 -6
- package/dist/commands/verify/cross/diff.js.map +1 -1
- package/dist/commands/verify/evidence/contract.js +1 -1
- package/dist/commands/verify/evidence/contract.js.map +1 -1
- package/dist/commands/verify/evidence/read.js +12 -3
- package/dist/commands/verify/evidence/read.js.map +1 -1
- package/dist/commands/verify/frozen.js +45 -23
- package/dist/commands/verify/frozen.js.map +1 -1
- package/dist/commands/verify/record.js +69 -17
- package/dist/commands/verify/record.js.map +1 -1
- package/dist/commands/verify/report.js +27 -44
- package/dist/commands/verify/report.js.map +1 -1
- package/dist/commands/verify/results.js +112 -30
- package/dist/commands/verify/results.js.map +1 -1
- package/dist/commands/verify/verify.js +54 -51
- package/dist/commands/verify/verify.js.map +1 -1
- package/dist/commands/vouch/pack/pack.js +2 -2
- package/dist/commands/vouch/pack/pack.js.map +1 -1
- package/dist/commands/vouch/pack/print.js +1 -6
- package/dist/commands/vouch/pack/print.js.map +1 -1
- package/dist/commands/vouch/pack/sections.js +1 -2
- package/dist/commands/vouch/pack/sections.js.map +1 -1
- package/dist/commands/vouch/run.js +26 -81
- package/dist/commands/vouch/run.js.map +1 -1
- package/dist/commands/vouch/sample/plan.js +20 -34
- package/dist/commands/vouch/sample/plan.js.map +1 -1
- package/dist/commands/vouch/vet/verify.js +39 -7
- package/dist/commands/vouch/vet/verify.js.map +1 -1
- package/dist/commands/vouch/vouch.js +10 -17
- package/dist/commands/vouch/vouch.js.map +1 -1
- package/dist/core/agent/agents-md/command-map.js +56 -101
- package/dist/core/agent/agents-md/command-map.js.map +1 -1
- package/dist/core/agent/agents-md/map/explain.js +4 -3
- package/dist/core/agent/agents-md/map/explain.js.map +1 -1
- package/dist/core/agent/agents-md/map/lenses/context.js +4 -3
- package/dist/core/agent/agents-md/map/lenses/context.js.map +1 -1
- package/dist/core/agent/agents-md/map/lenses/diff.js +33 -20
- package/dist/core/agent/agents-md/map/lenses/diff.js.map +1 -1
- package/dist/core/agent/agents-md/map/lenses/gate.js +13 -5
- package/dist/core/agent/agents-md/map/lenses/gate.js.map +1 -1
- package/dist/core/agent/agents-md/map/mcp.js +10 -7
- package/dist/core/agent/agents-md/map/mcp.js.map +1 -1
- package/dist/core/agent/agents-md/map/status.js +9 -3
- package/dist/core/agent/agents-md/map/status.js.map +1 -1
- package/dist/core/agent/agents-md/map/subsystem.js +4 -3
- package/dist/core/agent/agents-md/map/subsystem.js.map +1 -1
- package/dist/core/agent/agents-md/map/usecases.js +24 -6
- package/dist/core/agent/agents-md/map/usecases.js.map +1 -1
- package/dist/core/agent/agents-md/refusals.js +32 -18
- package/dist/core/agent/agents-md/refusals.js.map +1 -1
- package/dist/core/agent/agents-md.js +9 -3
- package/dist/core/agent/agents-md.js.map +1 -1
- package/dist/core/agent/agents-stamp.js +10 -0
- package/dist/core/agent/agents-stamp.js.map +1 -1
- package/dist/core/agent/scaffold.js +10 -15
- package/dist/core/agent/scaffold.js.map +1 -1
- package/dist/core/agent/tools/dialects.js +1 -0
- package/dist/core/agent/tools/dialects.js.map +1 -1
- package/dist/core/agent/tools/registry.js +41 -76
- package/dist/core/agent/tools/registry.js.map +1 -1
- package/dist/core/agent/workflows/adopt.js +5 -3
- package/dist/core/agent/workflows/adopt.js.map +1 -1
- package/dist/core/agent/workflows/check.js +20 -16
- package/dist/core/agent/workflows/check.js.map +1 -1
- package/dist/core/agent/workflows/closing.js +54 -21
- package/dist/core/agent/workflows/closing.js.map +1 -1
- package/dist/core/agent/workflows/feature.js +79 -11
- package/dist/core/agent/workflows/feature.js.map +1 -1
- package/dist/core/agent/workflows/implement.js +91 -13
- package/dist/core/agent/workflows/implement.js.map +1 -1
- package/dist/core/agent/workflows/reference/authoring.js +3 -1
- package/dist/core/agent/workflows/reference/authoring.js.map +1 -1
- package/dist/core/agent/workflows/reference/codes.js +8 -6
- package/dist/core/agent/workflows/reference/codes.js.map +1 -1
- package/dist/core/agent/workflows/reference/done-check.js +37 -15
- package/dist/core/agent/workflows/reference/done-check.js.map +1 -1
- package/dist/core/agent/workflows/reference/reference.js.map +1 -1
- package/dist/core/agent/workflows/reference/spine.js +50 -18
- package/dist/core/agent/workflows/reference/spine.js.map +1 -1
- package/dist/core/asyncapi/baseline/plan.js +14 -81
- package/dist/core/asyncapi/baseline/plan.js.map +1 -1
- package/dist/core/asyncapi/digest.js +30 -25
- package/dist/core/asyncapi/digest.js.map +1 -1
- package/dist/core/asyncapi/merge/components.js +5 -4
- package/dist/core/asyncapi/merge/components.js.map +1 -1
- package/dist/core/asyncapi/merge/error.js +7 -2
- package/dist/core/asyncapi/merge/error.js.map +1 -1
- package/dist/core/asyncapi/merge/markers.js +30 -50
- package/dist/core/asyncapi/merge/markers.js.map +1 -1
- package/dist/core/asyncapi/merge/merge.js +31 -53
- package/dist/core/asyncapi/merge/merge.js.map +1 -1
- package/dist/core/asyncapi/merge/pin.js +10 -36
- package/dist/core/asyncapi/merge/pin.js.map +1 -1
- package/dist/core/asyncapi/model.js.map +1 -1
- package/dist/core/asyncapi/read.js +36 -12
- package/dist/core/asyncapi/read.js.map +1 -1
- package/dist/core/brief/brief.js +6 -18
- package/dist/core/brief/brief.js.map +1 -1
- package/dist/core/brief/landscape.js +8 -12
- package/dist/core/brief/landscape.js.map +1 -1
- package/dist/core/brief/map/extend.js +8 -5
- package/dist/core/brief/map/extend.js.map +1 -1
- package/dist/core/brief/map/owed.js +8 -26
- package/dist/core/brief/map/owed.js.map +1 -1
- package/dist/core/brief/targets.js +15 -5
- package/dist/core/brief/targets.js.map +1 -1
- package/dist/core/c4/likec4.js +147 -16
- package/dist/core/c4/likec4.js.map +1 -1
- package/dist/core/c4/locate/unlocated.js +150 -0
- package/dist/core/c4/locate/unlocated.js.map +1 -0
- package/dist/core/c4/parsed/values.js +54 -1
- package/dist/core/c4/parsed/values.js.map +1 -1
- package/dist/core/c4/prefetch/fleet.js +1 -9
- package/dist/core/c4/prefetch/fleet.js.map +1 -1
- package/dist/core/c4/project/documents.js +31 -6
- package/dist/core/c4/project/documents.js.map +1 -1
- package/dist/core/c4/project/load.js +6 -17
- package/dist/core/c4/project/load.js.map +1 -1
- package/dist/core/c4/resolve/external.js +51 -0
- package/dist/core/c4/resolve/external.js.map +1 -0
- package/dist/core/c4/resolve/service.js +25 -1
- package/dist/core/c4/resolve/service.js.map +1 -1
- package/dist/core/c4/seed/template.js +15 -1
- package/dist/core/c4/seed/template.js.map +1 -1
- package/dist/core/c4/service-model/shape.js +2 -22
- package/dist/core/c4/service-model/shape.js.map +1 -1
- package/dist/core/c4/source-mask.js +288 -4
- package/dist/core/c4/source-mask.js.map +1 -1
- package/dist/core/c4/source-scan.js +203 -147
- package/dist/core/c4/source-scan.js.map +1 -1
- package/dist/core/c4/splice/authored-source.js +19 -0
- package/dist/core/c4/splice/authored-source.js.map +1 -1
- package/dist/core/c4/splice/delta-blocks.js +5 -18
- package/dist/core/c4/splice/delta-blocks.js.map +1 -1
- package/dist/core/c4/splice/landscape-merge.js +13 -8
- package/dist/core/c4/splice/landscape-merge.js.map +1 -1
- package/dist/core/c4/splice/model/merge.js +10 -6
- package/dist/core/c4/splice/model/merge.js.map +1 -1
- package/dist/core/c4/splice/placement.js +108 -18
- package/dist/core/c4/splice/placement.js.map +1 -1
- package/dist/core/c4/workspace.js +13 -22
- package/dist/core/c4/workspace.js.map +1 -1
- package/dist/core/capabilities/capabilities.js +6 -6
- package/dist/core/capabilities/capabilities.js.map +1 -1
- package/dist/core/capabilities/delta/doc.js +7 -10
- package/dist/core/capabilities/delta/doc.js.map +1 -1
- package/dist/core/capabilities/findings.js +15 -20
- package/dist/core/capabilities/findings.js.map +1 -1
- package/dist/core/capabilities/realizes/findings.js +12 -19
- package/dist/core/capabilities/realizes/findings.js.map +1 -1
- package/dist/core/capabilities/realizes/join.js +0 -20
- package/dist/core/capabilities/realizes/join.js.map +1 -1
- package/dist/core/capabilities/rollup.js +6 -0
- package/dist/core/capabilities/rollup.js.map +1 -1
- package/dist/core/capabilities/tree.js +6 -28
- package/dist/core/capabilities/tree.js.map +1 -1
- package/dist/core/capabilities/usecase-join.js +3 -13
- package/dist/core/capabilities/usecase-join.js.map +1 -1
- package/dist/core/coherence/authoring/scaffold.js +11 -3
- package/dist/core/coherence/authoring/scaffold.js.map +1 -1
- package/dist/core/coherence/authoring/sentinels.js +2 -1
- package/dist/core/coherence/authoring/sentinels.js.map +1 -1
- package/dist/core/coherence/coherence.js +30 -16
- package/dist/core/coherence/coherence.js.map +1 -1
- package/dist/core/coherence/consumed/operations.js +70 -0
- package/dist/core/coherence/consumed/operations.js.map +1 -0
- package/dist/core/coherence/consumed/refusal.js +38 -0
- package/dist/core/coherence/consumed/refusal.js.map +1 -0
- package/dist/core/coherence/declared.js +60 -34
- package/dist/core/coherence/declared.js.map +1 -1
- package/dist/core/coherence/events/declared.js +44 -59
- package/dist/core/coherence/events/declared.js.map +1 -1
- package/dist/core/coherence/events/events.js +119 -8
- package/dist/core/coherence/events/events.js.map +1 -1
- package/dist/core/coherence/events/grades.js +31 -8
- package/dist/core/coherence/events/grades.js.map +1 -1
- package/dist/core/coherence/events/lookups.js +14 -82
- package/dist/core/coherence/events/lookups.js.map +1 -1
- package/dist/core/coherence/lookups.js +18 -78
- package/dist/core/coherence/lookups.js.map +1 -1
- package/dist/core/coherence/retired/archived.js +285 -0
- package/dist/core/coherence/retired/archived.js.map +1 -0
- package/dist/core/coherence/retired/event-pair.js +62 -0
- package/dist/core/coherence/retired/event-pair.js.map +1 -0
- package/dist/core/coherence/retired/merged.js +79 -0
- package/dist/core/coherence/retired/merged.js.map +1 -0
- package/dist/core/coherence/retired/retirement.js +49 -0
- package/dist/core/coherence/retired/retirement.js.map +1 -0
- package/dist/core/coherence/retired/revival/arrivals.js +131 -0
- package/dist/core/coherence/retired/revival/arrivals.js.map +1 -0
- package/dist/core/coherence/retired/revival/revived.js +297 -0
- package/dist/core/coherence/retired/revival/revived.js.map +1 -0
- package/dist/core/consumers/after.js +113 -0
- package/dist/core/consumers/after.js.map +1 -0
- package/dist/core/consumers/consumers.js +296 -0
- package/dist/core/consumers/consumers.js.map +1 -0
- package/dist/core/consumers/current.js +211 -0
- package/dist/core/consumers/current.js.map +1 -0
- package/dist/core/consumers/scan.js +46 -0
- package/dist/core/consumers/scan.js.map +1 -0
- package/dist/core/consumers/state.js +27 -0
- package/dist/core/consumers/state.js.map +1 -0
- package/dist/core/delta/delta.js +1 -1
- package/dist/core/delta/delta.js.map +1 -1
- package/dist/core/deployment/delta.js +3 -6
- package/dist/core/deployment/delta.js.map +1 -1
- package/dist/core/diff/base-git.js +94 -12
- package/dist/core/diff/base-git.js.map +1 -1
- package/dist/core/diff/base-state.js +28 -16
- package/dist/core/diff/base-state.js.map +1 -1
- package/dist/core/diff/joins.js +136 -0
- package/dist/core/diff/joins.js.map +1 -0
- package/dist/core/diff/scope/changed-paths.js +22 -6
- package/dist/core/diff/scope/changed-paths.js.map +1 -1
- package/dist/core/diff/scope/edges.js +82 -0
- package/dist/core/diff/scope/edges.js.map +1 -0
- package/dist/core/diff/semantic.js +100 -31
- package/dist/core/diff/semantic.js.map +1 -1
- package/dist/core/doctor/agents.js +34 -18
- package/dist/core/doctor/agents.js.map +1 -1
- package/dist/core/doctor/report.js.map +1 -1
- package/dist/core/document/apply.js +10 -2
- package/dist/core/document/apply.js.map +1 -1
- package/dist/core/document/frontmatter.js +55 -0
- package/dist/core/document/frontmatter.js.map +1 -1
- package/dist/core/document/parse.js +29 -6
- package/dist/core/document/parse.js.map +1 -1
- package/dist/core/document/scenarios.js +17 -0
- package/dist/core/document/scenarios.js.map +1 -1
- package/dist/core/document/spec.js +4 -11
- package/dist/core/document/spec.js.map +1 -1
- package/dist/core/envelope/config.js +10 -0
- package/dist/core/envelope/config.js.map +1 -1
- package/dist/core/envelope/json.js +34 -0
- package/dist/core/envelope/json.js.map +1 -1
- package/dist/core/explain/families.js +17 -12
- package/dist/core/explain/families.js.map +1 -1
- package/dist/core/explain/refusals.js +3 -3
- package/dist/core/explain/refusals.js.map +1 -1
- package/dist/core/explain/terms.js +18 -9
- package/dist/core/explain/terms.js.map +1 -1
- package/dist/core/explore/explore.js +2 -7
- package/dist/core/explore/explore.js.map +1 -1
- package/dist/core/fleet-context.js +34 -95
- package/dist/core/fleet-context.js.map +1 -1
- package/dist/core/gate/checks.js +5 -2
- package/dist/core/gate/checks.js.map +1 -1
- package/dist/core/gate/partners.js +4 -2
- package/dist/core/gate/partners.js.map +1 -1
- package/dist/core/gate/report.js.map +1 -1
- package/dist/core/gate/verification.js +75 -12
- package/dist/core/gate/verification.js.map +1 -1
- package/dist/core/gherkin/stale.js +13 -37
- package/dist/core/gherkin/stale.js.map +1 -1
- package/dist/core/glossary/tree.js +6 -19
- package/dist/core/glossary/tree.js.map +1 -1
- package/dist/core/kernel/concurrency.js +19 -0
- package/dist/core/kernel/concurrency.js.map +1 -1
- package/dist/core/kernel/records.js +11 -0
- package/dist/core/kernel/records.js.map +1 -1
- package/dist/core/links/backlinks.js +1 -3
- package/dist/core/links/backlinks.js.map +1 -1
- package/dist/core/links/corpus.js +5 -36
- package/dist/core/links/corpus.js.map +1 -1
- package/dist/core/mcp/argv.js +101 -0
- package/dist/core/mcp/argv.js.map +1 -1
- package/dist/core/mcp/author-tools.js +2 -1
- package/dist/core/mcp/author-tools.js.map +1 -1
- package/dist/core/mcp/protocol.js +2 -2
- package/dist/core/mcp/protocol.js.map +1 -1
- package/dist/core/mcp/tools.js +43 -33
- package/dist/core/mcp/tools.js.map +1 -1
- package/dist/core/openapi/baseline/gate.js +53 -12
- package/dist/core/openapi/baseline/gate.js.map +1 -1
- package/dist/core/openapi/baseline/plan.js +22 -8
- package/dist/core/openapi/baseline/plan.js.map +1 -1
- package/dist/core/openapi/baseline/record.js +0 -1
- package/dist/core/openapi/baseline/record.js.map +1 -1
- package/dist/core/openapi/contract-text.js +33 -0
- package/dist/core/openapi/contract-text.js.map +1 -0
- package/dist/core/openapi/contract-tree.js +56 -0
- package/dist/core/openapi/contract-tree.js.map +1 -0
- package/dist/core/openapi/depth.js +38 -24
- package/dist/core/openapi/depth.js.map +1 -1
- package/dist/core/openapi/digest.js +52 -2
- package/dist/core/openapi/digest.js.map +1 -1
- package/dist/core/openapi/doc.js +12 -4
- package/dist/core/openapi/doc.js.map +1 -1
- package/dist/core/openapi/merge/components.js +25 -60
- package/dist/core/openapi/merge/components.js.map +1 -1
- package/dist/core/openapi/merge/error.js +3 -13
- package/dist/core/openapi/merge/error.js.map +1 -1
- package/dist/core/openapi/merge/markers.js +26 -30
- package/dist/core/openapi/merge/markers.js.map +1 -1
- package/dist/core/openapi/merge/merge.js +26 -52
- package/dist/core/openapi/merge/merge.js.map +1 -1
- package/dist/core/openapi/merge/pin.js +15 -35
- package/dist/core/openapi/merge/pin.js.map +1 -1
- package/dist/core/openspec/decide/verdict.js.map +1 -1
- package/dist/core/openspec/inventory.js +4 -5
- package/dist/core/openspec/inventory.js.map +1 -1
- package/dist/core/openspec/model/mapping.js +30 -28
- package/dist/core/openspec/model/mapping.js.map +1 -1
- package/dist/core/openspec/model/model.js +12 -7
- package/dist/core/openspec/model/model.js.map +1 -1
- package/dist/core/openspec/scan/changes.js +10 -4
- package/dist/core/openspec/scan/changes.js.map +1 -1
- package/dist/core/openspec/scan/config.js +7 -16
- package/dist/core/openspec/scan/config.js.map +1 -1
- package/dist/core/openspec/scan/shape.js +63 -19
- package/dist/core/openspec/scan/shape.js.map +1 -1
- package/dist/core/openspec/scan/walk.js +21 -38
- package/dist/core/openspec/scan/walk.js.map +1 -1
- package/dist/core/pack/living.js +2 -16
- package/dist/core/pack/living.js.map +1 -1
- package/dist/core/provenance/findings.js +48 -12
- package/dist/core/provenance/findings.js.map +1 -1
- package/dist/core/provenance/git.js +33 -57
- package/dist/core/provenance/git.js.map +1 -1
- package/dist/core/provenance/gitq/moves.js +71 -114
- package/dist/core/provenance/gitq/moves.js.map +1 -1
- package/dist/core/provenance/gitq/vouched-ancestor.js +2 -2
- package/dist/core/provenance/gitq/vouched-ancestor.js.map +1 -1
- package/dist/core/provenance/sources.js +23 -6
- package/dist/core/provenance/sources.js.map +1 -1
- package/dist/core/provenance/stamp.js +5 -17
- package/dist/core/provenance/stamp.js.map +1 -1
- package/dist/core/repo/entries.js.map +1 -1
- package/dist/core/repo/repo.js +24 -14
- package/dist/core/repo/repo.js.map +1 -1
- package/dist/core/repo/tree/find.js +12 -3
- package/dist/core/repo/tree/find.js.map +1 -1
- package/dist/core/repo/tree/fs.js +27 -1
- package/dist/core/repo/tree/fs.js.map +1 -1
- package/dist/core/repo/tree/walk.js +8 -30
- package/dist/core/repo/tree/walk.js.map +1 -1
- package/dist/core/results.js +47 -12
- package/dist/core/results.js.map +1 -1
- package/dist/core/staging/commit.js +10 -12
- package/dist/core/staging/commit.js.map +1 -1
- package/dist/core/staging/lock.js +74 -12
- package/dist/core/staging/lock.js.map +1 -1
- package/dist/core/staging/recovery/intent.js +2 -5
- package/dist/core/staging/recovery/intent.js.map +1 -1
- package/dist/core/staging/recovery/recover.js +60 -1
- package/dist/core/staging/recovery/recover.js.map +1 -1
- package/dist/core/staging/snapshot/manifest.js +152 -0
- package/dist/core/staging/snapshot/manifest.js.map +1 -0
- package/dist/core/staging/{snapshot.js → snapshot/snapshot.js} +10 -34
- package/dist/core/staging/snapshot/snapshot.js.map +1 -0
- package/dist/core/status/actions/execution.js +11 -0
- package/dist/core/status/actions/execution.js.map +1 -1
- package/dist/core/status/feature/artifacts.js +2 -2
- package/dist/core/status/feature/artifacts.js.map +1 -1
- package/dist/core/status/feature/feature.js +5 -11
- package/dist/core/status/feature/feature.js.map +1 -1
- package/dist/core/status/fleet/fleet.js +6 -2
- package/dist/core/status/fleet/fleet.js.map +1 -1
- package/dist/core/status/fleet/next.js +26 -3
- package/dist/core/status/fleet/next.js.map +1 -1
- package/dist/core/status/report.js.map +1 -1
- package/dist/core/status/verification.js +30 -15
- package/dist/core/status/verification.js.map +1 -1
- package/dist/core/tasks/packet.js +174 -0
- package/dist/core/tasks/packet.js.map +1 -0
- package/dist/core/tasks/record.js +43 -0
- package/dist/core/tasks/record.js.map +1 -0
- package/dist/core/tasks/sources.js +181 -0
- package/dist/core/tasks/sources.js.map +1 -0
- package/dist/core/tasks/stamps.js +76 -0
- package/dist/core/tasks/stamps.js.map +1 -0
- package/dist/core/tasks/unit.js +0 -0
- package/dist/core/tasks/unit.js.map +1 -0
- package/dist/core/usecases/capability.js +11 -14
- package/dist/core/usecases/capability.js.map +1 -1
- package/dist/core/usecases/delta/flows.js +5 -7
- package/dist/core/usecases/delta/flows.js.map +1 -1
- package/dist/core/usecases/fleet.js +178 -31
- package/dist/core/usecases/fleet.js.map +1 -1
- package/dist/core/usecases/operations.js +5 -4
- package/dist/core/usecases/operations.js.map +1 -1
- package/dist/core/usecases/service/flows.js +9 -6
- package/dist/core/usecases/service/flows.js.map +1 -1
- package/dist/core/usecases/suites/participants.js +83 -0
- package/dist/core/usecases/suites/participants.js.map +1 -0
- package/dist/core/usecases/suites/suites.js +45 -0
- package/dist/core/usecases/suites/suites.js.map +1 -0
- package/dist/core/verify/answers.js +12 -5
- package/dist/core/verify/answers.js.map +1 -1
- package/dist/core/verify/build.js +102 -82
- package/dist/core/verify/build.js.map +1 -1
- package/dist/core/verify/checklist.js +3 -0
- package/dist/core/verify/checklist.js.map +1 -1
- package/dist/core/verify/location.js +67 -0
- package/dist/core/verify/location.js.map +1 -0
- package/dist/core/verify/pins/lint.js +3 -2
- package/dist/core/verify/pins/lint.js.map +1 -1
- package/dist/core/verify/pins/pin.js +1 -1
- package/dist/core/verify/pins/pin.js.map +1 -1
- package/dist/core/verify/read/file.js +224 -0
- package/dist/core/verify/read/file.js.map +1 -0
- package/dist/core/verify/{file.js → read/shape.js} +16 -104
- package/dist/core/verify/read/shape.js.map +1 -0
- package/dist/core/verify/read/union.js +105 -0
- package/dist/core/verify/read/union.js.map +1 -0
- package/dist/core/verify/record.js +35 -12
- package/dist/core/verify/record.js.map +1 -1
- package/dist/core/verify/store/commit.js +40 -30
- package/dist/core/verify/store/commit.js.map +1 -1
- package/dist/core/verify/store/render.js +8 -4
- package/dist/core/verify/store/render.js.map +1 -1
- package/dist/core/vocabulary/issue.js +1 -0
- package/dist/core/vocabulary/issue.js.map +1 -1
- package/dist/core/vocabulary/maturity.js +12 -2
- package/dist/core/vocabulary/maturity.js.map +1 -1
- package/examples/README.md +21 -6
- package/examples/docs/architecture/landscape.likec4 +8 -0
- package/examples/docs/architecture/usecases/order-notification.likec4 +6 -2
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-service/asyncapi.yaml +11 -8
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/openapi.yaml +6 -6
- package/examples/docs/features/archive/FEAT-088-refunds/specs/payment-service/openapi.yaml +13 -10
- package/examples/docs/services/order-service/asyncapi.yaml +3 -2
- package/examples/docs/services/platform/notification-service/asyncapi.yaml +2 -1
- package/package.json +1 -1
- package/dist/commands/validate/checks/vocabulary.js +0 -16
- package/dist/commands/validate/checks/vocabulary.js.map +0 -1
- package/dist/core/agent/agents-md/artifacts.js +0 -221
- package/dist/core/agent/agents-md/artifacts.js.map +0 -1
- package/dist/core/agent/agents-md/cycle.js +0 -180
- package/dist/core/agent/agents-md/cycle.js.map +0 -1
- package/dist/core/agent/agents-md/shipped/archive-gate.js +0 -98
- package/dist/core/agent/agents-md/shipped/archive-gate.js.map +0 -1
- package/dist/core/agent/agents-md/spine.js +0 -40
- package/dist/core/agent/agents-md/spine.js.map +0 -1
- package/dist/core/coherence/events/merged.js +0 -40
- package/dist/core/coherence/events/merged.js.map +0 -1
- package/dist/core/diff/current-state.js +0 -96
- package/dist/core/diff/current-state.js.map +0 -1
- package/dist/core/diff/victims.js +0 -256
- package/dist/core/diff/victims.js.map +0 -1
- package/dist/core/staging/snapshot.js.map +0 -1
- package/dist/core/verify/file.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/archive/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EACL,OAAO,EACP,sBAAsB,EACtB,OAAO,EACP,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,aAAa,GAEd,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAuB,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;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\n * The archive itself, under the docs lock: gate, plan, commit.\n *\n * The order is the command's whole safety property. Every refusal happens before\n * a byte is planned (`./plan/gate.ts`), the plan is computed entirely in memory\n * so a failure on any axis leaves the living docs untouched (`./plan/specs.ts`,\n * `./plan/contracts/`, `./plan/landscape.ts`), and only a plan that succeeded\n * on every axis is staged\n * and swapped. `--dry-run` returns between the second and the third.\n */\nimport { existsSync } from \"node:fs\";\nimport { mkdir, rename } from \"node:fs/promises\";\nimport { emitJson, repoPath, sayExplain } from \"../../core/envelope/json.js\";\nimport {\n message,\n quietPruneEmptyParents,\n quietRm,\n rollbackError,\n rollbackStaged,\n stageWrites,\n swapStaged,\n} from \"../../core/staging/commit.js\";\nimport { clearCommitIntent, writeCommitIntent } from \"../../core/staging/recovery/intent.js\";\nimport {\n SNAPSHOT_DIR,\n SnapshotClobberError,\n snapshotDir,\n writeSnapshot,\n type ServiceKey,\n} from \"../../core/staging/snapshot.js\";\nimport { enumeratedServices } from \"../../core/repo/service-target.js\";\nimport { listFleetTree } from \"../../core/repo/repo.js\";\nimport { serviceViewsPath, subsystemViewsPath } from \"../../core/repo/paths.js\";\nimport { serviceViewsState, viewsState } from \"../../core/repo/tree/render/stale.js\";\nimport { loadArchitecture } from \"../../core/c4/project/architecture.js\";\nimport { FleetContext } from \"../../core/fleet-context.js\";\nimport { gate } from \"./plan/gate.js\";\nimport { type ArchiveOptions } from \"./plan/refusal.js\";\nimport { planCapabilities, planGlossary, planSpecs } from \"./plan/specs.js\";\nimport { planOpenapiContracts } from \"./plan/contracts/openapi.js\";\nimport { planAsyncapiContracts } from \"./plan/contracts/asyncapi.js\";\nimport { planDeployments, planFlows, planLandscape } from \"./plan/landscape.js\";\nimport { emptyPlan } from \"./plan/state.js\";\nimport { issueJson, refuseJson } from \"./plan/refusal.js\";\nimport { ArchiveFailure } from \"./plan/refusal.js\";\nimport { printPlan } from \"./plan/refusal.js\";\nimport type { DocsDir } from \"../../core/kernel/ids/dirs.js\";\n\nexport async function archiveLocked(\n config: { docsDir: DocsDir },\n featureId: string,\n opts: ArchiveOptions,\n): Promise<void> {\n const dryRun = opts.dryRun === true;\n const json = opts.json === true;\n // All prose goes through here so `--json` keeps stdout a single JSON document.\n const say = (line = \"\"): void => {\n if (!json) console.log(line);\n };\n\n // One read index for the whole run, threaded through every planner's\n // config record: gate, the spec merge and both contract merges each hold\n // per-service loops that resolve living paths through the enumeration, and\n // without a shared context every one of those calls re-walks the fleet —\n // O(services²) work under a lock that guarantees the tree is not moving.\n // The snapshot resolver below reads through the same context, so it pays\n // for that enumeration too.\n const read = { docsDir: config.docsDir, fleet: new FleetContext() };\n const gated = await gate(read, featureId, opts, say);\n if (gated === null) return;\n const { id, dirName, featureDir, gating, advisory, archiveDir, archiveDest, recovered, issues } = gated;\n\n say(`archive ${id}${dryRun ? \" (dry run)\" : \"\"}\\n`);\n\n // PLAN — compute every merge in memory. Nothing is written until the whole plan\n // succeeds, so a failure on any axis leaves the living docs untouched.\n const planned = emptyPlan();\n await planSpecs(read, gated, planned, say);\n // The business corpus, beside the service one and before the contracts: both\n // are requirement merges, and reading them together is how a plan stays\n // legible as \"what this feature promises\" followed by \"how it is built\".\n await planCapabilities(read, gated, planned, say);\n // The vocabulary the change brings with it, beside the promises it makes:\n // a create-only whole-file copy, refused at the gate if the word already\n // lives (`core/glossary/delta.ts`).\n await planGlossary(read, gated, planned, say);\n await planOpenapiContracts(read, gated, planned, say);\n await planAsyncapiContracts(read, gated, planned, say);\n // `read`, not `config`: the C4 merge now asks which services own their own\n // interior, and that answer comes from the fleet enumeration this run has\n // already paid for.\n await planLandscape(read, gated, planned, say);\n // The flows this feature brings, after the elements they draw hops over: the\n // copy is create-only and refused at the gate if the living tree already holds\n // one (`core/usecases/delta/flows.ts`), and it is ordered after the landscape\n // merge so a reader of the plan sees the map change before the sequence drawn\n // on it.\n await planFlows(config, gated, planned, say);\n await planDeployments(config, gated, planned, say);\n const { writes, planWarns, planGates, openapiRemovals, asyncapiRemovals } = planned;\n\n // Gate on what only the plan could see: a merged operation pointing at a\n // component that exists nowhere, a removal marker addressing no operation.\n // Same doctrine as the coherence gate — a judgment call --approve overrides\n // (unlike the mechanical merge-failed refusals), and a dry run is gated too.\n // Checked after the whole plan so the refusal costs nothing: no write has\n // happened yet either way.\n if (planGates.length > 0 && !opts.approve) {\n const msg = `archive ${id} — BLOCKED: ${planGates.length} issue(s) in the contract merge`;\n if (json) {\n refuseJson(\n \"not-coherent\",\n msg,\n [...issues, ...planWarns, ...planGates],\n `features/${dirName}`,\n );\n return;\n }\n console.error(`${msg}:`);\n for (const i of planGates) console.error(` ✗ ${i.message}`);\n console.error(`\\nFix them in the feature's openapi.yaml / asyncapi.yaml — or re-run with --approve to merge anyway.`);\n sayExplain(\"not-coherent\");\n process.exitCode = 1;\n return;\n }\n if (planGates.length > 0) {\n say(`\\n ⚠ archiving despite ${planGates.length} contract merge issue(s) (--approve):`);\n for (const i of planGates) say(` ✗ ${i.message}`);\n }\n\n // The plan as data, verb decided now — after the commit everything would read\n // as an update. The `--json` payload is identical for a dry run and the real\n // thing except for `archived`; what WOULD happen is what DOES happen.\n const warnings = [...advisory, ...planWarns];\n const overridden = opts.approve === true ? [...gating, ...planGates] : [];\n const plan: Array<Record<string, unknown>> = writes.map((w) => ({\n path: repoPath(config.docsDir, w.path),\n action: existsSync(w.path) ? \"update\" : \"create\",\n }));\n plan.push({ path: `features/${dirName}`, action: \"move\", to: `features/archive/${dirName}` });\n const payload = (archived: boolean): Record<string, unknown> => ({\n command: \"archive\",\n feature: id,\n archived,\n path: repoPath(config.docsDir, archiveDest),\n plan,\n warnings: warnings.map((issue) => issueJson(issue, repoPath(config.docsDir, archiveDest))),\n overridden: overridden.map((issue) => issueJson(issue, repoPath(config.docsDir, archiveDest))),\n openapiRemovals,\n asyncapiRemovals,\n // Present only when this run found an interrupted commit and dealt with it:\n // an agent that sees the docs change under it deserves to be told why, and\n // the absent field is the ordinary case.\n ...(recovered === null ? {} : { recovered }),\n });\n\n if (dryRun) {\n if (json) emitJson(payload(false));\n else printPlan(config.docsDir, writes, dirName);\n return;\n }\n\n // COMMIT — the whole plan computed cleanly. Stage every new version beside its\n // target, snapshot what is about to be overwritten, then swap them into place.\n // Staging touches the filesystem — a read-only `architecture/`, a full disk,\n // a target whose pre-image cannot be read. None of that is a bug in loam, and\n // reporting `internal` sends the reader looking for one; it is the same\n // answer as any other merge that could not be computed: nothing was written.\n let staged;\n try {\n staged = await stageWrites(writes);\n } catch (err) {\n throw new ArchiveFailure(\"merge-failed\", `${message(err)} — nothing was written`);\n }\n let snapshot = false;\n let createdArchiveDir: string | undefined;\n try {\n // The snapshot's resolver pair: how a docs-relative path decomposes into a\n // service identity, and where that identity lives NOW. Built here — the\n // command layer's view of the tree — and injected, so the snapshot module\n // never learns the repo layout. The seam the flat wave left is now\n // threaded: both answers come from the enumeration, so a service filed\n // into a subsystem keys its snapshot rows by the directory it actually\n // lives in, and the clobber guard grades a leftover claim at that same\n // address. The root-level parse stays as the fallback for the one path\n // shape the enumeration cannot know yet — a service this archive CREATES,\n // which always materialises unfiled at services/<id>/.\n // Tolerant on purpose: a docs repo whose services/ is absent still\n // archives a landscape-only feature exactly as before — the enumeration\n // is empty, every row keys by the flat fallback, and the missing\n // directory stays doctor's diagnosis rather than a merge-failed here.\n const dirOf = new Map(\n (await enumeratedServices(config.docsDir, read.fleet)).map((s) => [s.id as string, repoPath(config.docsDir, s.dir)]),\n );\n const serviceKeyOf = (rel: string): ServiceKey | null => {\n for (const [service, dir] of dirOf) {\n if (rel.startsWith(`${dir}/`)) return { service, artifact: rel.slice(dir.length + 1) };\n }\n const m = /^services\\/([^/]+)\\/(.+)$/.exec(rel);\n return m ? { service: m[1]!, artifact: m[2]! } : null;\n };\n const serviceDirOf = (service: string): string | null => dirOf.get(service) ?? null;\n await writeSnapshot({\n featureDir,\n docsDir: config.docsDir,\n feature: { featureId: id, dirName },\n staged,\n serviceKeyOf,\n serviceDirOf,\n });\n snapshot = true;\n // The journal, fsynced, BEFORE the first rename: swapStaged is N renames and\n // only each one of them is atomic, so a kill between two used to leave a\n // half-merged repo that nothing could name — `doctor` and `status` called it\n // healthy and `validate --all` blamed the delta. Written from `staged`, so\n // it records the same digests the swaps are about to produce.\n await writeCommitIntent(\n config.docsDir,\n { command: \"archive\", restore: \"before\", feature: id, moveFrom: featureDir, moveTo: archiveDest },\n staged,\n );\n await swapStaged(staged);\n createdArchiveDir = await mkdir(archiveDir, { recursive: true });\n await rename(featureDir, archiveDest);\n // Last: while it exists, the commit is in flight.\n await clearCommitIntent(config.docsDir);\n } catch (err) {\n if (err instanceof SnapshotClobberError) {\n // Nothing swapped — the refusal happens before the journal is even\n // written — so this only takes the temp files away. Its own code, because\n // the answer is not \"re-run\": a previous archive of this feature is still\n // sitting in the living docs.\n await rollbackStaged(staged);\n throw new ArchiveFailure(\"commit-interrupted\", err.message);\n }\n // Everything this run made, unmade: the swapped files, the snapshot inside the\n // feature that is staying put, and features/archive/ if we are the ones who\n // created it (mkdir reports nothing when it was already there).\n const failures = await rollbackStaged(staged);\n // The rollback decided the outcome, so the journal has nothing left to\n // describe — including on rollback-incomplete, where the files it names are\n // the ones the message tells a human to look at.\n await clearCommitIntent(config.docsDir);\n // The snapshot goes only when the rollback HELD. On rollback-incomplete it\n // holds the only on-disk pre-images of the very files the message tells the\n // reader to repair by hand — a MODIFIED requirement's previous text appears\n // nowhere else. Retaining it is safe: the next archive of this feature reads\n // it before it would replace it, and refuses if the living docs have moved.\n if (snapshot && failures.length === 0) await quietRm(snapshotDir(featureDir));\n // `features/archive/` is shared the moment it exists: another archive can\n // have moved a whole feature into it between our mkdir and this rollback,\n // and a recursive remove of \"the directory we created\" took that feature —\n // snapshot and all — with it, on OUR failure path, in silence. Empty\n // directories only, stopping at the first that is not.\n if (createdArchiveDir !== undefined) await quietPruneEmptyParents(archiveDir, createdArchiveDir);\n // The code is a caller's answer to \"can I trust the repo?\": merge-failed\n // means yes (rolled back), rollback-incomplete means look at it by hand.\n const wrapped = rollbackError(err, failures);\n const kept =\n snapshot && failures.length > 0\n ? ` Pre-images of the overwritten files are kept in features/${dirName}/${SNAPSHOT_DIR}/files/.`\n : \"\";\n throw new ArchiveFailure(failures.length > 0 ? \"rollback-incomplete\" : \"merge-failed\", wrapped.message + kept);\n }\n\n // This merge just changed the map, and both generated views files are a\n // function of the tree AND the map: a delta whose element lands inside a\n // group that exactly covered a subsystem takes that subsystem's boundary\n // line away, a delta binding an element to a filed service adds an include,\n // and one new edge changes exactly one service's overview. Archive does not\n // rewrite either file — `loam subsystem sync` owns them outright, and folding\n // a second generated artifact into this transaction would mean archive\n // computing the post-merge tree AND the post-merge map, which is how the two\n // writers disagree — but it must not report a repo as current when the next\n // `validate --all` will call it stale. Graded through validate's own\n // functions, so the two cannot answer differently.\n const staleViews = await staleGeneratedViews(config.docsDir);\n\n if (json) {\n emitJson({\n ...payload(true),\n // The original boolean keeps its exact meaning — `architecture/subsystems.likec4`\n // and nothing else — because a payload key's meaning is frozen; the list\n // beside it is the additive answer that can name the second file. Both are\n // omitted when nothing is stale, exactly as the boolean always was.\n ...(staleViews.length === 0 ? {} : { staleViews }),\n ...(staleViews.includes(\"architecture/subsystems.likec4\") ? { subsystemViewsStale: true } : {}),\n });\n return;\n }\n console.log(`\\n archived: features/${dirName} → features/archive/${dirName}`);\n console.log(` snapshot: features/archive/${dirName}/${SNAPSHOT_DIR}/ — \\`loam unarchive ${id}\\` puts it back`);\n // The closing line is a claim about the whole docs repo, and it is the line a\n // reader stops at. It may be printed only when this archive left nothing the\n // next `validate --all` will fail on — a service with no model, or a gate the\n // caller told it to merge past. Printing it over either is how a red fleet\n // gets reported as a finished one.\n const incomplete = planWarns.filter((w) => w.code === \"service.no-model\");\n if (incomplete.length === 0 && overridden.length === 0 && staleViews.length === 0) {\n console.log(\" living spec + landscape are now complete + current.\");\n return;\n }\n // One line per stale file rather than one line listing them: each names a file\n // a reader opens, and a comma-joined series would have to choose a verb that\n // reads wrong for one of the two counts.\n for (const path of staleViews) {\n console.log(` ⚠ ${path} no longer matches the tree and this map — run \\`loam subsystem sync\\`.`);\n }\n for (const w of incomplete) console.log(` ⚠ ${w.message}`);\n if (overridden.length > 0) {\n console.log(\n ` ⚠ merged past ${overridden.length} gating issue(s) with --approve — the living docs carry them now; \\`loam validate --all\\` says what they cost.`,\n );\n }\n}\n\n/**\n * Which generated files would the next `validate --all` report\n * `subsystem.views-stale` on? Docs-relative paths, sorted, empty for none.\n *\n * Asked through validate's OWN functions rather than a second compare, so the\n * warning archive prints and the error validate raises can never disagree —\n * including about the gate validate holds: a map that does not parse is\n * `landscape.invalid`'s business, and grading a generated file against a map\n * nobody can read would cascade a second complaint behind the first. An\n * unreadable map therefore answers \"no claim\", exactly as validate does.\n *\n * BOTH generated files, because this merge just changed the map and the\n * per-service overviews are a function of it in a way the subsystem views are\n * not: a delta adding one edge changes exactly one service's peer set, and a\n * delta binding a new element adds a whole view. Naming only the file loam\n * happened to check first would let a repo be reported current while the very\n * next `validate --all` calls it stale — the one thing this advisory exists to\n * prevent.\n */\nasync function staleGeneratedViews(docsDir: DocsDir): Promise<string[]> {\n try {\n const doc = await loadArchitecture(docsDir);\n if (doc.errors.length > 0) return [];\n const tree = await listFleetTree(docsDir);\n const stale: string[] = [];\n if (!(await viewsState(subsystemViewsPath(docsDir), tree, doc)).agrees) stale.push(\"architecture/subsystems.likec4\");\n if (!(await serviceViewsState(serviceViewsPath(docsDir), tree, doc)).agrees) {\n stale.push(\"architecture/services.likec4\");\n }\n return stale.sort();\n } catch {\n // Tolerant for the reason the snapshot resolver above is: a docs repo with\n // no `services/` at all still archives a landscape-only feature, and this\n // question is an ADVISORY printed after a commit that already succeeded.\n // Nothing here may turn a landed archive into a non-zero exit.\n return [];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/archive/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAA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,GAAG,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QACrH,IAAI,CAAC,CAAC,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YAC5E,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,2EAA2E;QAC3E,0EAA0E;QAC1E,yEAAyE;QACzE,+DAA+D;QAC/D,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC","sourcesContent":["/**\n * The archive itself, under the docs lock: gate, plan, commit.\n *\n * The order is the command's whole safety property. Every refusal happens before\n * a byte is planned (`./plan/gate.ts`), the plan is computed entirely in memory\n * so a failure on any axis leaves the living docs untouched (`./plan/specs.ts`,\n * `./plan/contracts/`, `./plan/landscape.ts`), and only a plan that succeeded\n * on every axis is staged\n * and swapped. `--dry-run` returns between the second and the third.\n */\nimport { existsSync } from \"node:fs\";\nimport { mkdir, rename } from \"node:fs/promises\";\nimport { CodedFailure, emitJson, repoPath, sayExplain } from \"../../core/envelope/json.js\";\nimport {\n message,\n quietPruneEmptyParents,\n quietRm,\n rollbackError,\n rollbackStaged,\n stageWrites,\n swapStaged,\n} from \"../../core/staging/commit.js\";\nimport { clearCommitIntent, writeCommitIntent } from \"../../core/staging/recovery/intent.js\";\nimport { SNAPSHOT_DIR, snapshotDir } from \"../../core/staging/snapshot/manifest.js\";\nimport { SnapshotClobberError, writeSnapshot, type ServiceKey } from \"../../core/staging/snapshot/snapshot.js\";\nimport { enumeratedServices } from \"../../core/repo/service-target.js\";\nimport { listFleetTree } from \"../../core/repo/repo.js\";\nimport { serviceViewsPath, subsystemViewsPath } from \"../../core/repo/paths.js\";\nimport { serviceViewsState, viewsState } from \"../../core/repo/tree/render/stale.js\";\nimport { loadArchitecture } from \"../../core/c4/project/architecture.js\";\nimport { FleetContext } from \"../../core/fleet-context.js\";\nimport { gate } from \"./plan/gate.js\";\nimport { issueJson, printPlan, refuseJson, type ArchiveOptions } from \"./plan/refusal.js\";\nimport { planCapabilities, planGlossary, planSpecs } from \"./plan/specs.js\";\nimport { planOpenapiContracts } from \"./plan/contracts/openapi.js\";\nimport { planAsyncapiContracts } from \"./plan/contracts/asyncapi.js\";\nimport { contractConsumers } from \"./plan/contracts/consumers.js\";\nimport { planDeployments, planFlows, planLandscape } from \"./plan/landscape.js\";\nimport { emptyPlan } from \"./plan/state.js\";\nimport { checklistAtArchive } from \"./shipped.js\";\nimport type { DocsDir } from \"../../core/kernel/ids/dirs.js\";\n\nexport async function archiveLocked(\n config: { docsDir: DocsDir },\n featureId: string,\n opts: ArchiveOptions,\n): Promise<void> {\n const dryRun = opts.dryRun === true;\n const json = opts.json === true;\n // All prose goes through here so `--json` keeps stdout a single JSON document.\n const say = (line = \"\"): void => {\n if (!json) console.log(line);\n };\n\n // One read index for the whole run, threaded through every planner's\n // config record: gate, the spec merge and both contract merges each hold\n // per-service loops that resolve living paths through the enumeration, and\n // without a shared context every one of those calls re-walks the fleet —\n // O(services²) work under a lock that guarantees the tree is not moving.\n // The snapshot resolver below reads through the same context, so it pays\n // for that enumeration too.\n const read = { docsDir: config.docsDir, fleet: new FleetContext() };\n const gated = await gate(read, featureId, opts, say);\n if (gated === null) return;\n const { id, dirName, featureDir, gating, advisory, archiveDir, archiveDest, recovered, issues } = gated;\n\n say(`archive ${id}${dryRun ? \" (dry run)\" : \"\"}\\n`);\n\n // PLAN — compute every merge in memory. Nothing is written until the whole plan\n // succeeds, so a failure on any axis leaves the living docs untouched.\n const planned = emptyPlan();\n await planSpecs(read, gated, planned, say);\n // The business corpus, beside the service one and before the contracts: both\n // are requirement merges, and reading them together is how a plan stays\n // legible as \"what this feature promises\" followed by \"how it is built\".\n await planCapabilities(read, gated, planned, say);\n // The vocabulary the change brings with it, beside the promises it makes:\n // a create-only whole-file copy, refused at the gate if the word already\n // lives (`core/glossary/delta.ts`).\n await planGlossary(read, gated, planned, say);\n // One consumer index for both contract planners, built only if one of them\n // overwrites an operation or a message (./plan/contracts/consumers.ts) —\n // and then over the living fleet as it stands before this merge.\n const contracts = { ...read, consumers: contractConsumers(read) };\n await planOpenapiContracts(contracts, gated, planned, say);\n await planAsyncapiContracts(contracts, gated, planned, say);\n // `read`, not `config`: the C4 merge now asks which services own their own\n // interior, and that answer comes from the fleet enumeration this run has\n // already paid for.\n await planLandscape(read, gated, planned, say);\n // The flows this feature brings, after the elements they draw hops over: the\n // copy is create-only and refused at the gate if the living tree already holds\n // one (`core/usecases/delta/flows.ts`), and it is ordered after the landscape\n // merge so a reader of the plan sees the map change before the sequence drawn\n // on it.\n await planFlows(config, gated, planned, say);\n await planDeployments(config, gated, planned, say);\n const { writes, planWarns, planGates, openapiRemovals, asyncapiRemovals } = planned;\n const revouchOwed = planned.revouchOwed.map((r) => ({ ...r, path: repoPath(config.docsDir, r.path) }));\n\n // Gate on what only the plan could see: a merged operation pointing at a\n // component that exists nowhere, a removal marker addressing no operation.\n // Same doctrine as the coherence gate — a judgment call --approve overrides\n // (unlike the mechanical merge-failed refusals), and a dry run is gated too.\n // Checked after the whole plan so the refusal costs nothing: no write has\n // happened yet either way.\n if (planGates.length > 0 && !opts.approve) {\n const msg = `archive ${id} — BLOCKED: ${planGates.length} issue(s) in the contract merge`;\n if (json) {\n refuseJson(\n \"not-coherent\",\n msg,\n [...issues, ...planWarns, ...planGates],\n `features/${dirName}`,\n );\n return;\n }\n console.error(`${msg}:`);\n for (const i of planGates) console.error(` ✗ ${i.message}`);\n console.error(`\\nFix them in the feature's openapi.yaml / asyncapi.yaml — or re-run with --approve to merge anyway.`);\n sayExplain(\"not-coherent\");\n process.exitCode = 1;\n return;\n }\n if (planGates.length > 0) {\n say(`\\n ⚠ archiving despite ${planGates.length} contract merge issue(s) (--approve):`);\n for (const i of planGates) say(` ✗ ${i.message}`);\n }\n // Printed by the dry run and the real merge alike, before either commits to\n // anything: the merge is what moves these documents, and the merge's PR is\n // the place their re-vouches belong. Not a finding and not a refusal — the\n // staleness that follows is honest, and `content.stale` is what grades it.\n if (revouchOwed.length > 0) {\n say(`\\n re-vouch owed — this merge moves ${revouchOwed.length} vouched spec(s) under the vouch stamp, so content.stale follows on each until its owner re-vouches:`);\n for (const r of revouchOwed) {\n say(` ${r.path} (owner: ${r.owner ?? \"none recorded\"}) — \\`loam vouch --service ${r.service}\\`, run in that service's repo`);\n }\n say(` land the re-vouches in this PR: \\`loam validate --all --base <ref> --strict\\` stays red on it until they do.`);\n }\n\n // The plan as data, verb decided now — after the commit everything would read\n // as an update. The `--json` payload is identical for a dry run and the real\n // thing except for `archived`; what WOULD happen is what DOES happen.\n const warnings = [...advisory, ...planWarns];\n const overridden = opts.approve === true ? [...gating, ...planGates] : [];\n const plan: Array<Record<string, unknown>> = writes.map((w) => ({\n path: repoPath(config.docsDir, w.path),\n action: existsSync(w.path) ? \"update\" : \"create\",\n }));\n plan.push({ path: `features/${dirName}`, action: \"move\", to: `features/archive/${dirName}` });\n const payload = (archived: boolean): Record<string, unknown> => ({\n command: \"archive\",\n feature: id,\n archived,\n path: repoPath(config.docsDir, archiveDest),\n plan,\n warnings: warnings.map((issue) => issueJson(issue, repoPath(config.docsDir, archiveDest))),\n overridden: overridden.map((issue) => issueJson(issue, repoPath(config.docsDir, archiveDest))),\n openapiRemovals,\n asyncapiRemovals,\n revouchOwed,\n // Present only when this run found an interrupted commit and dealt with it:\n // an agent that sees the docs change under it deserves to be told why, and\n // the absent field is the ordinary case.\n ...(recovered === null ? {} : { recovered }),\n });\n\n if (dryRun) {\n if (json) emitJson(payload(false));\n else printPlan(config.docsDir, writes, dirName);\n return;\n }\n\n // The question the feature asks as it ships, captured before anything below\n // moves the living docs it is derived from — see ./shipped.ts. It rides in\n // the snapshot manifest; a dry run writes no snapshot, so it pays nothing.\n const checklist = await checklistAtArchive(read, gated);\n\n // COMMIT — the whole plan computed cleanly. Stage every new version beside its\n // target, snapshot what is about to be overwritten, then swap them into place.\n // Staging touches the filesystem — a read-only `architecture/`, a full disk,\n // a target whose pre-image cannot be read. None of that is a bug in loam, and\n // reporting `internal` sends the reader looking for one; it is the same\n // answer as any other merge that could not be computed: nothing was written.\n let staged;\n try {\n staged = await stageWrites(writes);\n } catch (err) {\n throw new CodedFailure(\"merge-failed\", `${message(err)} — nothing was written`);\n }\n let snapshot = false;\n let createdArchiveDir: string | undefined;\n try {\n // The snapshot's resolver pair: how a docs-relative path decomposes into a\n // service identity, and where that identity lives NOW. Built here — the\n // command layer's view of the tree — and injected, so the snapshot module\n // never learns the repo layout. The seam the flat wave left is now\n // threaded: both answers come from the enumeration, so a service filed\n // into a subsystem keys its snapshot rows by the directory it actually\n // lives in, and the clobber guard grades a leftover claim at that same\n // address. The root-level parse stays as the fallback for the one path\n // shape the enumeration cannot know yet — a service this archive CREATES,\n // which always materialises unfiled at services/<id>/.\n // Tolerant on purpose: a docs repo whose services/ is absent still\n // archives a landscape-only feature exactly as before — the enumeration\n // is empty, every row keys by the flat fallback, and the missing\n // directory stays doctor's diagnosis rather than a merge-failed here.\n const dirOf = new Map(\n (await enumeratedServices(config.docsDir, read.fleet)).map((s) => [s.id as string, repoPath(config.docsDir, s.dir)]),\n );\n const serviceKeyOf = (rel: string): ServiceKey | null => {\n for (const [service, dir] of dirOf) {\n if (rel.startsWith(`${dir}/`)) return { service, artifact: rel.slice(dir.length + 1) };\n }\n const m = /^services\\/([^/]+)\\/(.+)$/.exec(rel);\n return m ? { service: m[1]!, artifact: m[2]! } : null;\n };\n const serviceDirOf = (service: string): string | null => dirOf.get(service) ?? null;\n await writeSnapshot({\n featureDir,\n docsDir: config.docsDir,\n feature: { featureId: id, dirName },\n staged,\n serviceKeyOf,\n serviceDirOf,\n ...(checklist === undefined ? {} : { checklist }),\n });\n snapshot = true;\n // The journal, fsynced, BEFORE the first rename: swapStaged is N renames and\n // only each one of them is atomic, so a kill between two used to leave a\n // half-merged repo that nothing could name — `doctor` and `status` called it\n // healthy and `validate --all` blamed the delta. Written from `staged`, so\n // it records the same digests the swaps are about to produce.\n await writeCommitIntent(\n config.docsDir,\n { command: \"archive\", restore: \"before\", feature: id, moveFrom: featureDir, moveTo: archiveDest },\n staged,\n );\n await swapStaged(staged);\n createdArchiveDir = await mkdir(archiveDir, { recursive: true });\n await rename(featureDir, archiveDest);\n // Last: while it exists, the commit is in flight.\n await clearCommitIntent(config.docsDir);\n } catch (err) {\n if (err instanceof SnapshotClobberError) {\n // Nothing swapped — the refusal happens before the journal is even\n // written — so this only takes the temp files away. Its own code, because\n // the answer is not \"re-run\": a previous archive of this feature is still\n // sitting in the living docs.\n await rollbackStaged(staged);\n throw new CodedFailure(\"commit-interrupted\", err.message);\n }\n // Everything this run made, unmade: the swapped files, the snapshot inside the\n // feature that is staying put, and features/archive/ if we are the ones who\n // created it (mkdir reports nothing when it was already there).\n const failures = await rollbackStaged(staged);\n // The rollback decided the outcome, so the journal has nothing left to\n // describe — including on rollback-incomplete, where the files it names are\n // the ones the message tells a human to look at.\n await clearCommitIntent(config.docsDir);\n // The snapshot goes only when the rollback HELD. On rollback-incomplete it\n // holds the only on-disk pre-images of the very files the message tells the\n // reader to repair by hand — a MODIFIED requirement's previous text appears\n // nowhere else. Retaining it is safe: the next archive of this feature reads\n // it before it would replace it, and refuses if the living docs have moved.\n if (snapshot && failures.length === 0) await quietRm(snapshotDir(featureDir));\n // `features/archive/` is shared the moment it exists: another archive can\n // have moved a whole feature into it between our mkdir and this rollback,\n // and a recursive remove of \"the directory we created\" took that feature —\n // snapshot and all — with it, on OUR failure path, in silence. Empty\n // directories only, stopping at the first that is not.\n if (createdArchiveDir !== undefined) await quietPruneEmptyParents(archiveDir, createdArchiveDir);\n // The code is a caller's answer to \"can I trust the repo?\": merge-failed\n // means yes (rolled back), rollback-incomplete means look at it by hand.\n const wrapped = rollbackError(err, failures);\n const kept =\n snapshot && failures.length > 0\n ? ` Pre-images of the overwritten files are kept in features/${dirName}/${SNAPSHOT_DIR}/files/.`\n : \"\";\n throw new CodedFailure(failures.length > 0 ? \"rollback-incomplete\" : \"merge-failed\", wrapped.message + kept);\n }\n\n // This merge just changed the map, and both generated views files are a\n // function of the tree AND the map: a delta whose element lands inside a\n // group that exactly covered a subsystem takes that subsystem's boundary\n // line away, a delta binding an element to a filed service adds an include,\n // and one new edge changes exactly one service's overview. Archive does not\n // rewrite either file — `loam subsystem sync` owns them outright, and folding\n // a second generated artifact into this transaction would mean archive\n // computing the post-merge tree AND the post-merge map, which is how the two\n // writers disagree — but it must not report a repo as current when the next\n // `validate --all` will call it stale. Graded through validate's own\n // functions, so the two cannot answer differently.\n const staleViews = await staleGeneratedViews(config.docsDir);\n\n if (json) {\n emitJson({\n ...payload(true),\n // The original boolean keeps its exact meaning — `architecture/subsystems.likec4`\n // and nothing else — because a payload key's meaning is frozen; the list\n // beside it is the additive answer that can name the second file. Both are\n // omitted when nothing is stale, exactly as the boolean always was.\n ...(staleViews.length === 0 ? {} : { staleViews }),\n ...(staleViews.includes(\"architecture/subsystems.likec4\") ? { subsystemViewsStale: true } : {}),\n });\n return;\n }\n console.log(`\\n archived: features/${dirName} → features/archive/${dirName}`);\n console.log(` snapshot: features/archive/${dirName}/${SNAPSHOT_DIR}/ — \\`loam unarchive ${id}\\` puts it back`);\n // The closing line is a claim about the whole docs repo, and it is the line a\n // reader stops at. It may be printed only when this archive left nothing the\n // next `validate --all` will fail on — a service with no model, or a gate the\n // caller told it to merge past. Printing it over either is how a red fleet\n // gets reported as a finished one.\n const incomplete = planWarns.filter((w) => w.code === \"service.no-model\");\n if (incomplete.length === 0 && overridden.length === 0 && staleViews.length === 0) {\n console.log(\" living spec + landscape are now complete + current.\");\n return;\n }\n // One line per stale file rather than one line listing them: each names a file\n // a reader opens, and a comma-joined series would have to choose a verb that\n // reads wrong for one of the two counts.\n for (const path of staleViews) {\n console.log(` ⚠ ${path} no longer matches the tree and this map — run \\`loam subsystem sync\\`.`);\n }\n for (const w of incomplete) console.log(` ⚠ ${w.message}`);\n if (overridden.length > 0) {\n console.log(\n ` ⚠ merged past ${overridden.length} gating issue(s) with --approve — the living docs carry them now; \\`loam validate --all\\` says what they cost.`,\n );\n }\n}\n\n/**\n * Which generated files would the next `validate --all` report\n * `subsystem.views-stale` on? Docs-relative paths, sorted, empty for none.\n *\n * Asked through validate's OWN functions rather than a second compare, so the\n * warning archive prints and the error validate raises can never disagree —\n * including about the gate validate holds: a map that does not parse is\n * `landscape.invalid`'s business, and grading a generated file against a map\n * nobody can read would cascade a second complaint behind the first. An\n * unreadable map therefore answers \"no claim\", exactly as validate does.\n *\n * BOTH generated files, because this merge just changed the map and the\n * per-service overviews are a function of it in a way the subsystem views are\n * not: a delta adding one edge changes exactly one service's peer set, and a\n * delta binding a new element adds a whole view. Naming only the file loam\n * happened to check first would let a repo be reported current while the very\n * next `validate --all` calls it stale — the one thing this advisory exists to\n * prevent.\n */\nasync function staleGeneratedViews(docsDir: DocsDir): Promise<string[]> {\n try {\n const doc = await loadArchitecture(docsDir);\n if (doc.errors.length > 0) return [];\n const tree = await listFleetTree(docsDir);\n const stale: string[] = [];\n if (!(await viewsState(subsystemViewsPath(docsDir), tree, doc)).agrees) stale.push(\"architecture/subsystems.likec4\");\n if (!(await serviceViewsState(serviceViewsPath(docsDir), tree, doc)).agrees) {\n stale.push(\"architecture/services.likec4\");\n }\n return stale.sort();\n } catch {\n // Tolerant for the reason the snapshot resolver above is: a docs repo with\n // no `services/` at all still archives a landscape-only feature, and this\n // question is an ADVISORY printed after a commit that already succeeded.\n // Nothing here may turn a landed archive into a non-zero exit.\n return [];\n }\n}\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `archive` writes down about the verification a feature ships with: the
|
|
3
|
+
* digest of the checklist it asks at the moment of the merge, captured into
|
|
4
|
+
* the undo snapshot's manifest (`core/staging/snapshot/manifest.ts`,
|
|
5
|
+
* `readSnapshotChecklist`).
|
|
6
|
+
*
|
|
7
|
+
* Archive reads no verdict — verify never gates the merge, and nothing here
|
|
8
|
+
* changes that: a record's state decides nothing about whether the archive
|
|
9
|
+
* runs. But once archived, a record is frozen history, and the checklist it
|
|
10
|
+
* could be held to is gone — the merge moves the feature's operations into the
|
|
11
|
+
* living contract, so a derivation after it can only mismatch. That made
|
|
12
|
+
* archiving the cheapest way past `loam gate --since`: a record gone stale
|
|
13
|
+
* read `verified` again the moment its feature shipped. With the question as
|
|
14
|
+
* it stood at the merge written down beside the record, the gate holds the
|
|
15
|
+
* frozen record to the feature that actually shipped, and `list`, `status` and
|
|
16
|
+
* `verify` keep reading it as the frozen history they always did.
|
|
17
|
+
*
|
|
18
|
+
* A module of its own rather than lines in `./run.ts`, which sequences the
|
|
19
|
+
* commit and is near the line limit; this is the one place archive asks the
|
|
20
|
+
* done-check anything.
|
|
21
|
+
*/
|
|
22
|
+
import { featureChecklist } from "../../core/verify/checklist.js";
|
|
23
|
+
import { readVerificationState } from "../../core/verify/read/file.js";
|
|
24
|
+
/**
|
|
25
|
+
* The digest a fresh `loam verify` would derive for the feature right now —
|
|
26
|
+
* call it before the first byte of the merge lands — or undefined when there
|
|
27
|
+
* is nothing worth capturing.
|
|
28
|
+
*
|
|
29
|
+
* Only a feature that carries a READABLE record pays for the derivation (it
|
|
30
|
+
* loads the delta into a LikeC4 workspace): with no record, or one nothing can
|
|
31
|
+
* read, the gate's answer is "absent" or "unreadable" whatever the checklist
|
|
32
|
+
* was, so a capture would buy nothing.
|
|
33
|
+
*
|
|
34
|
+
* Every failure is "nothing captured", never a refusal — verify does not gate
|
|
35
|
+
* the archive, and a derivation that could not run must not start to. The
|
|
36
|
+
* gate reads an absent capture as frozen history and says so.
|
|
37
|
+
*/
|
|
38
|
+
export async function checklistAtArchive(read, feature) {
|
|
39
|
+
try {
|
|
40
|
+
const record = await readVerificationState(feature.featureDir);
|
|
41
|
+
if (record.state !== "ok")
|
|
42
|
+
return undefined;
|
|
43
|
+
return (await featureChecklist(read.docsDir, feature.featureDir, feature.id, read.fleet)).digest;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=shipped.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shipped.js","sourceRoot":"","sources":["../../../src/commands/archive/shipped.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAIvE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAA+C,EAC/C,OAA+C;IAE/C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/D,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,SAAS,CAAC;QAC5C,OAAO,CAAC,MAAM,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACnG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["/**\n * What `archive` writes down about the verification a feature ships with: the\n * digest of the checklist it asks at the moment of the merge, captured into\n * the undo snapshot's manifest (`core/staging/snapshot/manifest.ts`,\n * `readSnapshotChecklist`).\n *\n * Archive reads no verdict — verify never gates the merge, and nothing here\n * changes that: a record's state decides nothing about whether the archive\n * runs. But once archived, a record is frozen history, and the checklist it\n * could be held to is gone — the merge moves the feature's operations into the\n * living contract, so a derivation after it can only mismatch. That made\n * archiving the cheapest way past `loam gate --since`: a record gone stale\n * read `verified` again the moment its feature shipped. With the question as\n * it stood at the merge written down beside the record, the gate holds the\n * frozen record to the feature that actually shipped, and `list`, `status` and\n * `verify` keep reading it as the frozen history they always did.\n *\n * A module of its own rather than lines in `./run.ts`, which sequences the\n * commit and is near the line limit; this is the one place archive asks the\n * done-check anything.\n */\nimport { featureChecklist } from \"../../core/verify/checklist.js\";\nimport { readVerificationState } from \"../../core/verify/read/file.js\";\nimport type { FleetContext } from \"../../core/fleet-context.js\";\nimport type { DocsDir, FeatureDir } from \"../../core/kernel/ids/dirs.js\";\n\n/**\n * The digest a fresh `loam verify` would derive for the feature right now —\n * call it before the first byte of the merge lands — or undefined when there\n * is nothing worth capturing.\n *\n * Only a feature that carries a READABLE record pays for the derivation (it\n * loads the delta into a LikeC4 workspace): with no record, or one nothing can\n * read, the gate's answer is \"absent\" or \"unreadable\" whatever the checklist\n * was, so a capture would buy nothing.\n *\n * Every failure is \"nothing captured\", never a refusal — verify does not gate\n * the archive, and a derivation that could not run must not start to. The\n * gate reads an absent capture as frozen history and says so.\n */\nexport async function checklistAtArchive(\n read: { docsDir: DocsDir; fleet: FleetContext },\n feature: { id: string; featureDir: FeatureDir },\n): Promise<string | undefined> {\n try {\n const record = await readVerificationState(feature.featureDir);\n if (record.state !== \"ok\") return undefined;\n return (await featureChecklist(read.docsDir, feature.featureDir, feature.id, read.fleet)).digest;\n } catch {\n return undefined;\n }\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { emitJson, fail, reportNoConfig } from "../../core/envelope/json.js";
|
|
1
|
+
import { configOrRefuse, emitJson, fail } from "../../core/envelope/json.js";
|
|
3
2
|
import { parseServiceId } from "../../core/kernel/ids/service.js";
|
|
4
3
|
import { FleetContext } from "../../core/fleet-context.js";
|
|
5
4
|
import { assemblePack, packHoles } from "../../core/pack/pack.js";
|
|
@@ -17,12 +16,10 @@ export function registerContext(program) {
|
|
|
17
16
|
.option("--json", "emit the machine contract instead of the human view")
|
|
18
17
|
.action(async (serviceArg, opts) => {
|
|
19
18
|
const json = opts.json === true;
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
reportNoConfig(json, loaded);
|
|
19
|
+
const config = await configOrRefuse(json);
|
|
20
|
+
if (config === null)
|
|
23
21
|
return;
|
|
24
|
-
}
|
|
25
|
-
const { docsDir } = loaded.config;
|
|
22
|
+
const { docsDir } = config;
|
|
26
23
|
// `services`, not `docs`: the pack is a statement about one service in
|
|
27
24
|
// the fleet, and an empty pack read out of a directory that is not a
|
|
28
25
|
// docs repo would say "nothing is documented here" about a repo nobody
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/commands/context/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/commands/context/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAqB,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,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AAM,IAAI,GAAG,MAAM,YAAY,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;YACtE,oEAAoE;YACpE,sEAAsE;YACtE,mEAAmE;YACnE,sEAAsE;YACtE,qEAAqE;YACrE,sEAAsE;YACtE,sCAAsC;YACtC,IAAI,SAAS,CAAC,IAAI,CAAC;gBAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YAE1C,IAAI,IAAI,EAAE,CAAC;gBACT,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;gBACnD,OAAO;YACT,CAAC;YACD,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,wBAAwB,EAAE,CAAC;gBAC5C,mBAAmB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;gBAC/B,OAAO;YACT,CAAC;YACD,sEAAsE;YACtE,uEAAuE;YACvE,sEAAsE;YACtE,sEAAsE;YACtE,2BAA2B,CAAC,IAAI,EAAE,GAAG,EAAE,sCAAsC,EAAE,OAAO,CAAC,CAAC;QAC1F,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Command } from \"commander\";\nimport { configOrRefuse, emitJson, fail } from \"../../core/envelope/json.js\";\nimport { parseServiceId } from \"../../core/kernel/ids/service.js\";\nimport { FleetContext } from \"../../core/fleet-context.js\";\nimport { assemblePack, packHoles } from \"../../core/pack/pack.js\";\nimport { nearestIds, type FeatureEntry } from \"../../core/repo/entries.js\";\nimport { missingFeatureMessage, resolveFeature } from \"../../core/repo/repo.js\";\nimport { DocsRepoUnavailableError } from \"../../core/repo/state.js\";\nimport { docsRepoReady, reportDocsRepoError, reportRepositoryUnavailable } from \"../policy/gate.js\";\nimport { printPack } from \"./print.js\";\n\ninterface ContextOptions {\n feature?: string;\n json?: boolean;\n}\n\nexport function registerContext(program: Command): void {\n program\n .command(\"context\")\n .argument(\"<service>\", \"service id, e.g. payment-service\")\n .description(\n \"Assemble one service's docs slice — spec, contracts, edges, permissions, capabilities, and the deltas in flight over it — as one deterministic briefing; writes nothing\",\n )\n .option(\"--feature <FEAT>\", \"narrow the in-flight section to this one feature\")\n .option(\"--json\", \"emit the machine contract instead of the human view\")\n .action(async (serviceArg: string, opts: ContextOptions) => {\n const json = opts.json === true;\n\n const config = await configOrRefuse(json);\n if (config === null) return;\n const { docsDir } = config;\n // `services`, not `docs`: the pack is a statement about one service in\n // the fleet, and an empty pack read out of a directory that is not a\n // docs repo would say \"nothing is documented here\" about a repo nobody\n // looked in.\n if (!docsRepoReady(json, docsDir, \"services\")) return;\n\n const context = new FleetContext();\n try {\n // The feature is resolved BEFORE the service is looked up (delta's\n // ordering): its refusal is about the flag, and it must not depend on\n // whether the service half of the invocation was right.\n let feature: FeatureEntry | null = null;\n if (opts.feature !== undefined) {\n feature = await resolveFeature(docsDir, opts.feature, \"exclude\", context);\n if (!feature) {\n fail(json, \"unknown-target\", await missingFeatureMessage(docsDir, opts.feature, context));\n return;\n }\n }\n\n // The enumeration answers first and the grammar second —\n // core/repo/service-target.ts's settled order, and the pack is exactly\n // the case its banner argues from: `services/payment service/` is a\n // directory `validate --all` grades and `service.id-invalid` tells the\n // team to rename, so refusing it on the grammar would make the one\n // service loam complains about the one service nobody can be briefed\n // on. The enumerated id is safe to use onward — a readdir produced it,\n // which is `RawServiceId`'s whole provenance. A name that is neither\n // enumerated nor legal is refused before any path is built; a legal\n // name with no directory is `unknown-service`, because a typo must\n // never be indistinguishable from an undocumented service — an EMPTY\n // pack reads as \"nothing to know here\".\n const entries = await context.listServices(docsDir);\n const entry = entries.find((e) => e.id === serviceArg);\n if (entry === undefined) {\n const parsed = parseServiceId(serviceArg, \"service\");\n if (!parsed.ok) {\n fail(json, \"invalid-option\", parsed.problem);\n return;\n }\n const near = nearestIds(serviceArg, entries.map((e) => e.id));\n fail(\n json,\n \"unknown-service\",\n `No service '${serviceArg}' under ${docsDir}/services/.` +\n (near.length === 0 ? \"\" : ` Did you mean ${near.map((n) => `'${n}'`).join(\" or \")}?`),\n );\n return;\n }\n\n const pack = await assemblePack({ docsDir, entry, feature, context });\n // A document behind the pack that exists but does not parse empties\n // its section, and an agent loading the pack as a briefing would read\n // that as \"nothing here\" — the vacuously-green pattern. The output\n // stays as informative as ever (and `ok` stays true under --json: the\n // command ran); the exit code is what stops a pipeline from building\n // on it, so it is set BEFORE the format fork — the guard is about the\n // pack, not about how it is rendered.\n if (packHoles(pack)) process.exitCode = 1;\n\n if (json) {\n emitJson({ command: \"context\", docsDir, ...pack });\n return;\n }\n printPack(pack);\n } catch (err) {\n if (err instanceof DocsRepoUnavailableError) {\n reportDocsRepoError(json, err);\n return;\n }\n // The assembly is all-or-nothing, like explore's scan: it reads every\n // document the pack quotes, so the honest answer to an unreadable FILE\n // (a directory where a document belongs, bytes that are not UTF-8) is\n // a refusal naming the path, not a briefing with a silent hole in it.\n reportRepositoryUnavailable(json, err, \"the pack would be missing a document\", docsDir);\n }\n });\n}\n"]}
|
|
@@ -60,7 +60,7 @@ export function printPack(pack) {
|
|
|
60
60
|
console.log();
|
|
61
61
|
}
|
|
62
62
|
if (pack.asyncapi.unreadable) {
|
|
63
|
-
console.log(`! asyncapi.yaml does not
|
|
63
|
+
console.log(`! asyncapi.yaml does not read as AsyncAPI 3.0 — nothing here lists what ${pack.service} publishes or consumes`);
|
|
64
64
|
if (pack.asyncapi.error !== undefined)
|
|
65
65
|
console.log(` ${pack.asyncapi.error}`);
|
|
66
66
|
console.log();
|
|
@@ -243,7 +243,7 @@ function printFeature(f, service) {
|
|
|
243
243
|
console.log();
|
|
244
244
|
}
|
|
245
245
|
if (f.events.unreadable) {
|
|
246
|
-
console.log("Events: asyncapi.yaml does not
|
|
246
|
+
console.log("Events: asyncapi.yaml does not read as AsyncAPI 3.0");
|
|
247
247
|
if (f.events.error !== undefined)
|
|
248
248
|
console.log(` ${f.events.error}`);
|
|
249
249
|
console.log();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print.js","sourceRoot":"","sources":["../../../src/commands/context/print.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAwB,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAoB,MAAM,6BAA6B,CAAC;AAE/D,MAAM,UAAU,SAAS,CAAC,IAAiB;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnG,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChF,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,KAAK,IAAI;QAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC,CAAC;IAC7G,2EAA2E;IAC3E,4EAA4E;IAC5E,IAAI,IAAI,CAAC,WAAW,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,CAAC,GAAG,CA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IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AAClE,CAAC;AAED,+FAA+F;AAC/F,SAAS,cAAc,CAAC,EAAU;IAChC,OAAO,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC","sourcesContent":["/**\n * The context pack as a Markdown document on stdout — for pasting into an\n * agent's context, or reading in a terminal that renders neither.\n *\n * Rendering only. Everything printed here comes from `core/pack/`, which is\n * also what `--json` emits, so a printed section can never disagree with the\n * payload beside it. Requirement bodies and Given/When/Then lines go out\n * VERBATIM — they are the acceptance criteria, and paraphrasing them here\n * would put a second wording of the contract in front of whoever implements\n * it. The living sections use the canonical `### Requirement:` /\n * `#### Scenario:` heading levels; the in-flight blocks print the same lines\n * one level deeper, because each sits under its feature's own `###` heading.\n */\nimport { type ContextPack } from \"../../core/pack/pack.js\";\nimport { type PackRequirement } from \"../../core/pack/living.js\";\nimport { type PackFeature } from \"../../core/pack/features.js\";\n\nexport function printPack(pack: ContextPack): void {\n console.log(`# ${pack.service} — context pack\\n`);\n const badge = [pack.frontmatter.status, pack.frontmatter.owner].filter((s) => s !== null);\n console.log(`${pack.path} · ${pack.maturity}${badge.length > 0 ? ` · ${badge.join(\" · \")}` : \"\"}`);\n if (pack.missing.length > 0) console.log(`missing: ${pack.missing.join(\", \")}`);\n if (pack.frontmatter.last_verified !== null) console.log(`last_verified: ${pack.frontmatter.last_verified}`);\n // Under the date it qualifies: that vouch read the sections this names and\n // no others, so `verified` above covers less of the document than it looks.\n if (pack.frontmatter.vouch_scope !== null) {\n console.log(`vouch_scope: ${pack.frontmatter.vouch_scope} — the rest was not read at that vouch`);\n }\n // Per axis and named, `show`'s discipline: the sample is per FILE, so one\n // run can read a short spec.md in full and stamp a long arch.spec.md\n // sampled. Printing only the first line said `verified` over arch\n // requirements this pack then reproduced verbatim, half of them unread.\n if (pack.archSpec.vouch_scope !== null) {\n console.log(\n `archSpec.vouch_scope: ${pack.archSpec.vouch_scope} — the rest of arch.spec.md was not read at that vouch`,\n );\n }\n for (const s of pack.frontmatter.sources) console.log(`sources: ${s}`);\n console.log();\n\n // Unreadable documents are said FIRST and without hedging (explore's print\n // discipline): every empty section below could otherwise be read as \"nothing\n // here\", which is the one conclusion an unreadable document never supports.\n if (pack.landscape.present && !pack.landscape.parses) {\n // The `architecture/` PROJECT is what `parses` answers for, so the document\n // at fault is very often a SIBLING beside a landscape that reads perfectly\n // — and naming the landscape sent a reader to bytes loam read fine\n // (verification 2026-09-04). `adopt` and `validate --all` name the file; so\n // does this. The project keeps the fallback: a failure LikeC4 reports with\n // no source document behind it is still a project that does not parse.\n const broken = pack.landscape.broken;\n const named = broken.length === 0 ? \"the fleet map (architecture/)\" : broken.join(\", \");\n // `> 1`, not `=== 1`: the empty arm's subject is the singular \"fleet map\".\n const verb = broken.length > 1 ? \"do\" : \"does\";\n console.log(`! ${named} ${verb} not parse — no edge below is derived, and none is missing either\\n`);\n }\n if (pack.openapi.unreadable) {\n console.log(`! openapi.yaml does not parse — nothing here lists what ${pack.service} exposes`);\n if (pack.openapi.error !== undefined) console.log(` ${pack.openapi.error}`);\n console.log();\n }\n if (pack.asyncapi.unreadable) {\n console.log(`! asyncapi.yaml does not parse — nothing here lists what ${pack.service} publishes or consumes`);\n if (pack.asyncapi.error !== undefined) console.log(` ${pack.asyncapi.error}`);\n console.log();\n }\n // The vocabulary failures lead with the contract failures: each empties a\n // section below into something that reads as an answer (\"declared: false\"\n // on every permission, \"(none realized here)\"), and a warning printed down\n // beside the section is a warning a reader pasting the top of the pack\n // never sees.\n if (pack.permissionsVocabulary.invalid !== undefined) {\n console.log(\"! architecture/permissions.yaml does not read as a vocabulary — every permission below reports declared: false because nobody could look\");\n console.log(` ${pack.permissionsVocabulary.invalid}`);\n console.log();\n }\n if (pack.capabilitiesVocabulary.invalid !== undefined) {\n console.log(\"! architecture/capabilities.yaml does not read as a vocabulary — no capability below is derived, and none is missing either\");\n console.log(` ${pack.capabilitiesVocabulary.invalid}`);\n console.log();\n }\n for (const path of pack.capabilitiesUnread) {\n console.log(`! ${path} could not be read while joining capabilities — that service's realizations are missing from the rollup this pack filtered`);\n }\n if (pack.capabilitiesUnread.length > 0) console.log();\n if (pack.useCaseScan.unreadable) {\n console.log(\"! architecture/ does not parse as one LikeC4 project — every use case below is missing because nobody could look, not because none is drawn\");\n if (pack.useCaseScan.error !== undefined) console.log(` ${pack.useCaseScan.error}`);\n console.log();\n }\n\n printRequirements(\"Requirements\", pack.requirements);\n printRequirements(\"Arch requirements\", pack.archRequirements);\n\n console.log(\"## Operations\\n\");\n if (pack.operations.length === 0) console.log(pack.openapi.unreadable ? \"(unreadable — see above)\\n\" : \"(none)\\n\");\n for (const op of pack.operations) {\n const by = op.governedBy.length > 0\n ? `governed by ${op.governedBy.map((n) => `\"${n}\"`).join(\", \")}`\n : \"not governed by any requirement\";\n console.log(`- ${op.method} ${op.path} ${op.id} — ${by}`);\n }\n if (pack.operations.length > 0) console.log();\n\n console.log(\"## Messages\\n\");\n if (pack.messages.length === 0) console.log(pack.asyncapi.unreadable ? \"(unreadable — see above)\\n\" : \"(none)\\n\");\n for (const m of pack.messages) {\n const direction = m.direction === null ? \"declared, not wired\" : m.direction.toUpperCase();\n console.log(`- ${direction} ${m.name} (${m.slot})`);\n }\n if (pack.messages.length > 0) console.log();\n\n console.log(\"## Permissions\\n\");\n if (pack.permissions.length === 0) console.log(\"(none required)\\n\");\n for (const p of pack.permissions) {\n if (!p.declared) {\n console.log(`- ${p.id} — not declared in architecture/permissions.yaml`);\n continue;\n }\n const notes = [\n ...(p.description === undefined ? [] : [p.description]),\n ...(p.ownedBy === undefined ? [] : [`owned by ${p.ownedBy}`]),\n ...(p.enforcedBy.length === 0 ? [] : [`enforced by ${p.enforcedBy.join(\", \")}`]),\n ];\n console.log(`- ${p.id}${notes.length > 0 ? ` — ${notes.join(\"; \")}` : \"\"}`);\n }\n if (pack.permissions.length > 0) console.log();\n\n console.log(\"## Capabilities\\n\");\n if (pack.capabilities.length === 0) {\n console.log(pack.capabilitiesVocabulary.invalid !== undefined ? \"(unreadable — see above)\\n\" : \"(none realized here)\\n\");\n }\n for (const c of pack.capabilities) {\n const label = c.description === undefined ? c.id : `${c.id} — ${c.description}`;\n console.log(`- ${label} (realized by: ${c.requirements.map((n) => `\"${n}\"`).join(\", \")})`);\n // The flows that claim the capability, fleet-wide — the answer to \"what is\n // this requirement FOR\", which the requirement's own text rarely gives.\n for (const flow of c.useCases) console.log(` - flow: ${flow.title ?? flow.id} [${flow.id}] ${flow.file}`);\n }\n if (pack.capabilities.length > 0) console.log();\n\n console.log(\"## Use cases\\n\");\n if (pack.useCaseSteps.length === 0) {\n console.log(pack.useCaseScan.unreadable ? \"(unreadable — see above)\\n\" : \"(no declared flow draws this service)\\n\");\n }\n for (const flow of pack.useCaseSteps) {\n console.log(`- ${flow.title ?? flow.id} [${flow.id}] ${flow.file}`);\n for (const step of flow.steps) {\n const label = step.title === undefined ? \"\" : ` '${step.title}'`;\n console.log(` - step ${step.ordinal}${label}: ${step.source} -> ${step.target}`);\n }\n }\n if (pack.useCaseSteps.length > 0) console.log();\n\n console.log(\"## Landscape\\n\");\n if (!pack.landscape.present) console.log(\"(no architecture/landscape.likec4)\\n\");\n else if (!pack.landscape.parses) console.log(\"(unreadable — see above)\\n\");\n else {\n if (!pack.landscape.modelled) console.log(`${pack.service} is not in the fleet map — no edge into it can be checked`);\n for (const e of pack.landscape.inbound) console.log(`- ← ${e.service}${edgeNote(e.op, e.title)}`);\n for (const e of pack.landscape.outbound) console.log(`- → ${e.service}${edgeNote(e.op, e.title)}`);\n if (pack.landscape.modelled && pack.landscape.inbound.length === 0 && pack.landscape.outbound.length === 0) {\n console.log(\"(modelled, no edges touch it)\");\n }\n console.log();\n }\n\n console.log(\"## Pointers\\n\");\n const mark = (present: boolean): string => (present ? \"present\" : \"absent\");\n console.log(`- runbook: ${mark(pack.pointers.runbook.present)} (${pack.pointers.runbook.path})`);\n console.log(`- health: ${mark(pack.pointers.health.present)} (${pack.pointers.health.path})`);\n console.log(`- adrs: ${pack.pointers.adrs.count} (${pack.pointers.adrs.path})`);\n console.log();\n\n // The narrowing is said in the heading: a narrowed pack differs from the\n // default only by what it leaves OUT, and a reader (or a diff) must not\n // mistake one for a fleet gone quiet.\n console.log(pack.feature === null ? \"## In flight\\n\" : `## In flight (narrowed to ${pack.feature})\\n`);\n if (pack.features.length === 0) console.log(\"(no active feature touches this service)\");\n for (const f of pack.features) printFeature(f, pack.service);\n}\n\nfunction printRequirements(label: string, reqs: PackRequirement[], level = \"##\"): void {\n console.log(`${level} ${label}\\n`);\n if (reqs.length === 0) console.log(\"(none)\\n\");\n for (const r of reqs) {\n const tag = r.kind === \"BASE\" ? \"\" : `[${r.kind}] `;\n console.log(`${level}# Requirement: ${tag}${r.name}`);\n if (r.text.length > 0) console.log(r.text);\n for (const s of r.scenarios) {\n console.log(`\\n${level}## Scenario: ${s.name}`);\n // Verbatim, bullets and markdown emphasis included: these lines are the\n // acceptance criteria.\n for (const line of s.lines) console.log(line);\n }\n console.log();\n }\n}\n\nfunction printFeature(f: PackFeature, service: string): void {\n console.log(`### ${f.feature} (${f.path})\\n`);\n if (!f.services.includes(service)) {\n console.log(`(no delta for ${service} — ${f.feature} touches: ${f.services.length > 0 ? f.services.join(\", \") : \"(no services)\"})\\n`);\n }\n // Intent prose arrives with its own headings — usually an H1 title — and\n // pasted raw under this feature's `###` those restructure the whole pack: a\n // second H1 splits the document, and an intent section named \"Operations\"\n // collides with the pack's own. Demoted three levels (below the feature\n // heading), capped at H6 because a seventh `#` renders as literal text.\n // Body lines are untouched — the demotion is structural, not a paraphrase.\n if (f.intent !== null && f.intent.length > 0) console.log(`${demoteHeadings(f.intent)}\\n`);\n if (f.requirements.length > 0) printRequirements(\"Requirement delta\", f.requirements, \"###\");\n if (f.archRequirements.length > 0) printRequirements(\"Arch requirement delta\", f.archRequirements, \"###\");\n\n if (f.openapi.unreadable) {\n // Worded like the delta brief's answer for the same failure, and without a\n // \"run `loam validate`\" hint: the parser's own message is quoted and the\n // exit code carries the failure.\n console.log(\"API: openapi.yaml does not parse\");\n if (f.openapi.error !== undefined) console.log(` ${f.openapi.error}`);\n console.log();\n } else if (f.api.length > 0) {\n console.log(\"API changes:\");\n for (const op of f.api) {\n const marker = op.remove ? \"REMOVE \" : \"\";\n console.log(`- ${marker}${op.method} ${op.path} ${op.operationId}${op.summary === null ? \"\" : ` — ${op.summary}`}`);\n }\n console.log();\n }\n\n if (f.events.unreadable) {\n console.log(\"Events: asyncapi.yaml does not parse\");\n if (f.events.error !== undefined) console.log(` ${f.events.error}`);\n console.log();\n } else if (f.events.changes.length > 0) {\n console.log(\"Event changes:\");\n for (const m of f.events.changes) {\n const marker = m.remove ? \"REMOVE \" : \"\";\n const direction = m.direction === null ? \"\" : `${m.direction.toUpperCase()} `;\n console.log(`- ${marker}${direction}${m.message} (${m.slot})`);\n }\n console.log();\n }\n\n const arch = f.architecture;\n if (arch.errors.length > 0) {\n console.log(\"Architecture: delta.likec4 has errors\");\n for (const e of arch.errors) console.log(` ${e}`);\n console.log();\n } else if (arch.isNew || arch.inbound.length > 0 || arch.outbound.length > 0) {\n console.log(\"Architecture:\");\n if (arch.isNew) console.log(`- NEW service — create ${service}`);\n for (const e of arch.outbound) console.log(`- → ${e.service}${edgeNote(e.op, e.title)}`);\n for (const e of arch.inbound) console.log(`- ← ${e.service}${edgeNote(e.op, e.title)}`);\n console.log();\n }\n\n // Both interpolants passed their grammars at the boundary — the service\n // through assertServiceId, the feature id as the CANONICAL id the\n // enumeration derived — so the printed command parses. That property is the\n // exact lesson explore's `--as` records: this line is assembled from data,\n // which is the one shape test/agent-commands-runnable.test.ts cannot see.\n console.log(`next: loam delta ${f.feature} --service ${service}\\n`);\n}\n\nfunction edgeNote(op: string | null, title: string | null): string {\n if (op !== null) return ` ${op}`;\n return title !== null && title.length > 0 ? ` \"${title}\"` : \"\";\n}\n\n/** Every ATX heading pushed three levels down, capped at H6 — see the intent comment above. */\nfunction demoteHeadings(md: string): string {\n return md.replace(/^(#{1,6})(?= )/gm, (h) => \"#\".repeat(Math.min(6, h.length + 3)));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"print.js","sourceRoot":"","sources":["../../../src/commands/context/print.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAwB,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAoB,MAAM,6BAA6B,CAAC;AAE/D,MAAM,UAAU,SAAS,CAAC,IAAiB;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnG,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChF,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,KAAK,IAAI;Q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C,oBAAoB,CAAC,CAAC,OAAO,cAAc,OAAO,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,QAAQ,CAAC,EAAiB,EAAE,KAAoB;IACvD,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,KAAK,EAAE,EAAE,CAAC;IAClC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AAClE,CAAC;AAED,+FAA+F;AAC/F,SAAS,cAAc,CAAC,EAAU;IAChC,OAAO,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC","sourcesContent":["/**\n * The context pack as a Markdown document on stdout — for pasting into an\n * agent's context, or reading in a terminal that renders neither.\n *\n * Rendering only. Everything printed here comes from `core/pack/`, which is\n * also what `--json` emits, so a printed section can never disagree with the\n * payload beside it. Requirement bodies and Given/When/Then lines go out\n * VERBATIM — they are the acceptance criteria, and paraphrasing them here\n * would put a second wording of the contract in front of whoever implements\n * it. The living sections use the canonical `### Requirement:` /\n * `#### Scenario:` heading levels; the in-flight blocks print the same lines\n * one level deeper, because each sits under its feature's own `###` heading.\n */\nimport { type ContextPack } from \"../../core/pack/pack.js\";\nimport { type PackRequirement } from \"../../core/pack/living.js\";\nimport { type PackFeature } from \"../../core/pack/features.js\";\n\nexport function printPack(pack: ContextPack): void {\n console.log(`# ${pack.service} — context pack\\n`);\n const badge = [pack.frontmatter.status, pack.frontmatter.owner].filter((s) => s !== null);\n console.log(`${pack.path} · ${pack.maturity}${badge.length > 0 ? ` · ${badge.join(\" · \")}` : \"\"}`);\n if (pack.missing.length > 0) console.log(`missing: ${pack.missing.join(\", \")}`);\n if (pack.frontmatter.last_verified !== null) console.log(`last_verified: ${pack.frontmatter.last_verified}`);\n // Under the date it qualifies: that vouch read the sections this names and\n // no others, so `verified` above covers less of the document than it looks.\n if (pack.frontmatter.vouch_scope !== null) {\n console.log(`vouch_scope: ${pack.frontmatter.vouch_scope} — the rest was not read at that vouch`);\n }\n // Per axis and named, `show`'s discipline: the sample is per FILE, so one\n // run can read a short spec.md in full and stamp a long arch.spec.md\n // sampled. Printing only the first line said `verified` over arch\n // requirements this pack then reproduced verbatim, half of them unread.\n if (pack.archSpec.vouch_scope !== null) {\n console.log(\n `archSpec.vouch_scope: ${pack.archSpec.vouch_scope} — the rest of arch.spec.md was not read at that vouch`,\n );\n }\n for (const s of pack.frontmatter.sources) console.log(`sources: ${s}`);\n console.log();\n\n // Unreadable documents are said FIRST and without hedging (explore's print\n // discipline): every empty section below could otherwise be read as \"nothing\n // here\", which is the one conclusion an unreadable document never supports.\n if (pack.landscape.present && !pack.landscape.parses) {\n // The `architecture/` PROJECT is what `parses` answers for, so the document\n // at fault is very often a SIBLING beside a landscape that reads perfectly\n // — and naming the landscape sent a reader to bytes loam read fine\n // (verification 2026-09-04). `adopt` and `validate --all` name the file; so\n // does this. The project keeps the fallback: a failure LikeC4 reports with\n // no source document behind it is still a project that does not parse.\n const broken = pack.landscape.broken;\n const named = broken.length === 0 ? \"the fleet map (architecture/)\" : broken.join(\", \");\n // `> 1`, not `=== 1`: the empty arm's subject is the singular \"fleet map\".\n const verb = broken.length > 1 ? \"do\" : \"does\";\n console.log(`! ${named} ${verb} not parse — no edge below is derived, and none is missing either\\n`);\n }\n if (pack.openapi.unreadable) {\n console.log(`! openapi.yaml does not parse — nothing here lists what ${pack.service} exposes`);\n if (pack.openapi.error !== undefined) console.log(` ${pack.openapi.error}`);\n console.log();\n }\n if (pack.asyncapi.unreadable) {\n console.log(`! asyncapi.yaml does not read as AsyncAPI 3.0 — nothing here lists what ${pack.service} publishes or consumes`);\n if (pack.asyncapi.error !== undefined) console.log(` ${pack.asyncapi.error}`);\n console.log();\n }\n // The vocabulary failures lead with the contract failures: each empties a\n // section below into something that reads as an answer (\"declared: false\"\n // on every permission, \"(none realized here)\"), and a warning printed down\n // beside the section is a warning a reader pasting the top of the pack\n // never sees.\n if (pack.permissionsVocabulary.invalid !== undefined) {\n console.log(\"! architecture/permissions.yaml does not read as a vocabulary — every permission below reports declared: false because nobody could look\");\n console.log(` ${pack.permissionsVocabulary.invalid}`);\n console.log();\n }\n if (pack.capabilitiesVocabulary.invalid !== undefined) {\n console.log(\"! architecture/capabilities.yaml does not read as a vocabulary — no capability below is derived, and none is missing either\");\n console.log(` ${pack.capabilitiesVocabulary.invalid}`);\n console.log();\n }\n for (const path of pack.capabilitiesUnread) {\n console.log(`! ${path} could not be read while joining capabilities — that service's realizations are missing from the rollup this pack filtered`);\n }\n if (pack.capabilitiesUnread.length > 0) console.log();\n if (pack.useCaseScan.unreadable) {\n console.log(\"! architecture/ does not parse as one LikeC4 project — every use case below is missing because nobody could look, not because none is drawn\");\n if (pack.useCaseScan.error !== undefined) console.log(` ${pack.useCaseScan.error}`);\n console.log();\n }\n\n printRequirements(\"Requirements\", pack.requirements);\n printRequirements(\"Arch requirements\", pack.archRequirements);\n\n console.log(\"## Operations\\n\");\n if (pack.operations.length === 0) console.log(pack.openapi.unreadable ? \"(unreadable — see above)\\n\" : \"(none)\\n\");\n for (const op of pack.operations) {\n const by = op.governedBy.length > 0\n ? `governed by ${op.governedBy.map((n) => `\"${n}\"`).join(\", \")}`\n : \"not governed by any requirement\";\n console.log(`- ${op.method} ${op.path} ${op.id} — ${by}`);\n }\n if (pack.operations.length > 0) console.log();\n\n console.log(\"## Messages\\n\");\n if (pack.messages.length === 0) console.log(pack.asyncapi.unreadable ? \"(unreadable — see above)\\n\" : \"(none)\\n\");\n for (const m of pack.messages) {\n const direction = m.direction === null ? \"declared, not wired\" : m.direction.toUpperCase();\n console.log(`- ${direction} ${m.name} (${m.slot})`);\n }\n if (pack.messages.length > 0) console.log();\n\n console.log(\"## Permissions\\n\");\n if (pack.permissions.length === 0) console.log(\"(none required)\\n\");\n for (const p of pack.permissions) {\n if (!p.declared) {\n console.log(`- ${p.id} — not declared in architecture/permissions.yaml`);\n continue;\n }\n const notes = [\n ...(p.description === undefined ? [] : [p.description]),\n ...(p.ownedBy === undefined ? [] : [`owned by ${p.ownedBy}`]),\n ...(p.enforcedBy.length === 0 ? [] : [`enforced by ${p.enforcedBy.join(\", \")}`]),\n ];\n console.log(`- ${p.id}${notes.length > 0 ? ` — ${notes.join(\"; \")}` : \"\"}`);\n }\n if (pack.permissions.length > 0) console.log();\n\n console.log(\"## Capabilities\\n\");\n if (pack.capabilities.length === 0) {\n console.log(pack.capabilitiesVocabulary.invalid !== undefined ? \"(unreadable — see above)\\n\" : \"(none realized here)\\n\");\n }\n for (const c of pack.capabilities) {\n const label = c.description === undefined ? c.id : `${c.id} — ${c.description}`;\n console.log(`- ${label} (realized by: ${c.requirements.map((n) => `\"${n}\"`).join(\", \")})`);\n // The flows that claim the capability, fleet-wide — the answer to \"what is\n // this requirement FOR\", which the requirement's own text rarely gives.\n for (const flow of c.useCases) console.log(` - flow: ${flow.title ?? flow.id} [${flow.id}] ${flow.file}`);\n }\n if (pack.capabilities.length > 0) console.log();\n\n console.log(\"## Use cases\\n\");\n if (pack.useCaseSteps.length === 0) {\n console.log(pack.useCaseScan.unreadable ? \"(unreadable — see above)\\n\" : \"(no declared flow draws this service)\\n\");\n }\n for (const flow of pack.useCaseSteps) {\n console.log(`- ${flow.title ?? flow.id} [${flow.id}] ${flow.file}`);\n for (const step of flow.steps) {\n const label = step.title === undefined ? \"\" : ` '${step.title}'`;\n console.log(` - step ${step.ordinal}${label}: ${step.source} -> ${step.target}`);\n }\n }\n if (pack.useCaseSteps.length > 0) console.log();\n\n console.log(\"## Landscape\\n\");\n if (!pack.landscape.present) console.log(\"(no architecture/landscape.likec4)\\n\");\n else if (!pack.landscape.parses) console.log(\"(unreadable — see above)\\n\");\n else {\n if (!pack.landscape.modelled) console.log(`${pack.service} is not in the fleet map — no edge into it can be checked`);\n for (const e of pack.landscape.inbound) console.log(`- ← ${e.service}${edgeNote(e.op, e.title)}`);\n for (const e of pack.landscape.outbound) console.log(`- → ${e.service}${edgeNote(e.op, e.title)}`);\n if (pack.landscape.modelled && pack.landscape.inbound.length === 0 && pack.landscape.outbound.length === 0) {\n console.log(\"(modelled, no edges touch it)\");\n }\n console.log();\n }\n\n console.log(\"## Pointers\\n\");\n const mark = (present: boolean): string => (present ? \"present\" : \"absent\");\n console.log(`- runbook: ${mark(pack.pointers.runbook.present)} (${pack.pointers.runbook.path})`);\n console.log(`- health: ${mark(pack.pointers.health.present)} (${pack.pointers.health.path})`);\n console.log(`- adrs: ${pack.pointers.adrs.count} (${pack.pointers.adrs.path})`);\n console.log();\n\n // The narrowing is said in the heading: a narrowed pack differs from the\n // default only by what it leaves OUT, and a reader (or a diff) must not\n // mistake one for a fleet gone quiet.\n console.log(pack.feature === null ? \"## In flight\\n\" : `## In flight (narrowed to ${pack.feature})\\n`);\n if (pack.features.length === 0) console.log(\"(no active feature touches this service)\");\n for (const f of pack.features) printFeature(f, pack.service);\n}\n\nfunction printRequirements(label: string, reqs: PackRequirement[], level = \"##\"): void {\n console.log(`${level} ${label}\\n`);\n if (reqs.length === 0) console.log(\"(none)\\n\");\n for (const r of reqs) {\n const tag = r.kind === \"BASE\" ? \"\" : `[${r.kind}] `;\n console.log(`${level}# Requirement: ${tag}${r.name}`);\n if (r.text.length > 0) console.log(r.text);\n for (const s of r.scenarios) {\n console.log(`\\n${level}## Scenario: ${s.name}`);\n // Verbatim, bullets and markdown emphasis included: these lines are the\n // acceptance criteria.\n for (const line of s.lines) console.log(line);\n }\n console.log();\n }\n}\n\nfunction printFeature(f: PackFeature, service: string): void {\n console.log(`### ${f.feature} (${f.path})\\n`);\n if (!f.services.includes(service)) {\n console.log(`(no delta for ${service} — ${f.feature} touches: ${f.services.length > 0 ? f.services.join(\", \") : \"(no services)\"})\\n`);\n }\n // Intent prose arrives with its own headings — usually an H1 title — and\n // pasted raw under this feature's `###` those restructure the whole pack: a\n // second H1 splits the document, and an intent section named \"Operations\"\n // collides with the pack's own. Demoted three levels (below the feature\n // heading), capped at H6 because a seventh `#` renders as literal text.\n // Body lines are untouched — the demotion is structural, not a paraphrase.\n if (f.intent !== null && f.intent.length > 0) console.log(`${demoteHeadings(f.intent)}\\n`);\n if (f.requirements.length > 0) printRequirements(\"Requirement delta\", f.requirements, \"###\");\n if (f.archRequirements.length > 0) printRequirements(\"Arch requirement delta\", f.archRequirements, \"###\");\n\n if (f.openapi.unreadable) {\n // Worded like the delta brief's answer for the same failure, and without a\n // \"run `loam validate`\" hint: the parser's own message is quoted and the\n // exit code carries the failure.\n console.log(\"API: openapi.yaml does not parse\");\n if (f.openapi.error !== undefined) console.log(` ${f.openapi.error}`);\n console.log();\n } else if (f.api.length > 0) {\n console.log(\"API changes:\");\n for (const op of f.api) {\n const marker = op.remove ? \"REMOVE \" : \"\";\n console.log(`- ${marker}${op.method} ${op.path} ${op.operationId}${op.summary === null ? \"\" : ` — ${op.summary}`}`);\n }\n console.log();\n }\n\n if (f.events.unreadable) {\n console.log(\"Events: asyncapi.yaml does not read as AsyncAPI 3.0\");\n if (f.events.error !== undefined) console.log(` ${f.events.error}`);\n console.log();\n } else if (f.events.changes.length > 0) {\n console.log(\"Event changes:\");\n for (const m of f.events.changes) {\n const marker = m.remove ? \"REMOVE \" : \"\";\n const direction = m.direction === null ? \"\" : `${m.direction.toUpperCase()} `;\n console.log(`- ${marker}${direction}${m.message} (${m.slot})`);\n }\n console.log();\n }\n\n const arch = f.architecture;\n if (arch.errors.length > 0) {\n console.log(\"Architecture: delta.likec4 has errors\");\n for (const e of arch.errors) console.log(` ${e}`);\n console.log();\n } else if (arch.isNew || arch.inbound.length > 0 || arch.outbound.length > 0) {\n console.log(\"Architecture:\");\n if (arch.isNew) console.log(`- NEW service — create ${service}`);\n for (const e of arch.outbound) console.log(`- → ${e.service}${edgeNote(e.op, e.title)}`);\n for (const e of arch.inbound) console.log(`- ← ${e.service}${edgeNote(e.op, e.title)}`);\n console.log();\n }\n\n // Both interpolants passed their grammars at the boundary — the service\n // through assertServiceId, the feature id as the CANONICAL id the\n // enumeration derived — so the printed command parses. That property is the\n // exact lesson explore's `--as` records: this line is assembled from data,\n // which is the one shape test/agent-commands-runnable.test.ts cannot see.\n console.log(`next: loam delta ${f.feature} --service ${service}\\n`);\n}\n\nfunction edgeNote(op: string | null, title: string | null): string {\n if (op !== null) return ` ${op}`;\n return title !== null && title.length > 0 ? ` \"${title}\"` : \"\";\n}\n\n/** Every ATX heading pushed three levels down, capped at H6 — see the intent comment above. */\nfunction demoteHeadings(md: string): string {\n return md.replace(/^(#{1,6})(?= )/gm, (h) => \"#\".repeat(Math.min(6, h.length + 3)));\n}\n"]}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
|
-
import { loadConfig } from "../../core/envelope/config.js";
|
|
4
3
|
import { InvalidIdError, assertServiceId } from "../../core/kernel/ids/service.js";
|
|
5
|
-
import { emitJson, emitJsonError, fail, repoPath,
|
|
4
|
+
import { configOrRefuse, emitJson, emitJsonError, fail, repoPath, sayExplain } from "../../core/envelope/json.js";
|
|
6
5
|
import { loadFile } from "../../core/c4/likec4.js";
|
|
7
6
|
import { compareIds, nearestIds } from "../../core/repo/entries.js";
|
|
8
7
|
import { featurePaths, featureSpecPaths } from "../../core/repo/paths.js";
|
|
9
8
|
import { missingFeatureMessage, resolveFeature } from "../../core/repo/repo.js";
|
|
10
9
|
import { parseRequirements } from "../../core/document/parse.js";
|
|
11
10
|
import {} from "../../core/document/spec.js";
|
|
11
|
+
import {} from "../../core/gherkin/digest.js";
|
|
12
|
+
import { scenarioDigest } from "../../core/gherkin/stamp.js";
|
|
12
13
|
import { stripFrontmatter } from "../../core/document/frontmatter.js";
|
|
13
14
|
import { apiChanges } from "../../core/projection/api.js";
|
|
14
15
|
import { eventChanges } from "../../core/projection/events.js";
|
|
@@ -27,12 +28,9 @@ export function registerDelta(program) {
|
|
|
27
28
|
.option("--json", "emit the machine contract instead of the human view")
|
|
28
29
|
.action(async (featureId, opts) => {
|
|
29
30
|
const json = opts.json === true;
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
reportNoConfig(json, loaded);
|
|
31
|
+
const config = await configOrRefuse(json);
|
|
32
|
+
if (config === null)
|
|
33
33
|
return;
|
|
34
|
-
}
|
|
35
|
-
const config = loaded.config;
|
|
36
34
|
// The id grammar first, and on the RAW argument: `--service ../../etc`
|
|
37
35
|
// reaches `featureSpecPaths` and reads from outside the feature directory.
|
|
38
36
|
// One grammar for the whole tool (core/kernel/ids/service.ts).
|
|
@@ -183,16 +181,49 @@ export function registerDelta(program) {
|
|
|
183
181
|
if (arch.errors.length > 0 || api.unreadable || events.unreadable)
|
|
184
182
|
process.exitCode = 1;
|
|
185
183
|
if (json) {
|
|
186
|
-
|
|
184
|
+
// `axis` is a parameter and `service` stays in the closure, because the
|
|
185
|
+
// scenario digest is salted by BOTH and only one of them varies per
|
|
186
|
+
// call — the same Given/When/Then under `spec.md` and under
|
|
187
|
+
// `arch.spec.md` are two different claims, and one hash for both would
|
|
188
|
+
// let a green business run answer an integration test nobody wrote
|
|
189
|
+
// (core/gherkin/digest.ts owns that reasoning and the recipe).
|
|
190
|
+
const reqJson = (r, axis) => ({
|
|
187
191
|
kind: r.kind,
|
|
188
192
|
id: r.id,
|
|
193
|
+
// Where the requirement sits in the document it was parsed from, so a
|
|
194
|
+
// consumer can send an author to the line rather than to the file.
|
|
195
|
+
line: r.line,
|
|
196
|
+
basedOn: r.basedOn,
|
|
189
197
|
name: r.name,
|
|
190
198
|
text: r.text.join("\n").trim(),
|
|
191
199
|
operations: r.operations,
|
|
192
200
|
covers: r.covers,
|
|
201
|
+
// The five joins this projection used to drop on the floor. Every one
|
|
202
|
+
// of them is already written on the requirement and every one names
|
|
203
|
+
// work: which permission gates it, which capability it belongs to,
|
|
204
|
+
// which named promise it realizes, and which messages it produces and
|
|
205
|
+
// consumes. An implementer handed "add the endpoint" and none of this
|
|
206
|
+
// has to go read the markdown the payload claims to have projected.
|
|
207
|
+
requires: r.requires,
|
|
208
|
+
capabilities: r.capabilities,
|
|
209
|
+
realizes: r.realizes,
|
|
210
|
+
publishes: r.publishes,
|
|
211
|
+
consumes: r.consumes,
|
|
193
212
|
// Scenarios go out verbatim: they are the acceptance criteria and the
|
|
194
213
|
// source for the tests whoever picks this up is expected to write.
|
|
195
|
-
|
|
214
|
+
//
|
|
215
|
+
// `digest` is the EXACT join key the rest of the toolchain uses —
|
|
216
|
+
// `loam gherkin` stamps it on the generated scenario as
|
|
217
|
+
// `@loam-digest-<16hex>` (core/gherkin/stamp.ts) and `loam verify`
|
|
218
|
+
// matches a cucumber report's scenarios on it. Without it a consumer
|
|
219
|
+
// of this brief could name the acceptance criteria but not the test
|
|
220
|
+
// that answers them, and had to regenerate the suite to find out.
|
|
221
|
+
scenarios: r.scenarios.map((s) => ({
|
|
222
|
+
name: s.name,
|
|
223
|
+
lines: s.lines,
|
|
224
|
+
line: s.line,
|
|
225
|
+
digest: scenarioDigest(service, s.lines, axis),
|
|
226
|
+
})),
|
|
196
227
|
});
|
|
197
228
|
emitJson({
|
|
198
229
|
command: "delta",
|
|
@@ -201,11 +232,12 @@ export function registerDelta(program) {
|
|
|
201
232
|
services: featureServices,
|
|
202
233
|
path: repoPath(config.docsDir, feature.dir),
|
|
203
234
|
intent,
|
|
204
|
-
requirements: reqs.map(reqJson),
|
|
235
|
+
requirements: reqs.map((r) => reqJson(r, "business")),
|
|
205
236
|
// Same shape, separate section: an arch requirement's scenarios are
|
|
206
237
|
// integration/ops tests, and a consumer must not have to parse prose
|
|
207
|
-
// to tell the two apart.
|
|
208
|
-
|
|
238
|
+
// to tell the two apart. The axis is passed rather than inferred
|
|
239
|
+
// because it is a digest SALT, not a label — see `reqJson` above.
|
|
240
|
+
archRequirements: archReqs.map((r) => reqJson(r, "arch")),
|
|
209
241
|
api: api.changes,
|
|
210
242
|
// `api` stays exactly the operations array it has always been — a
|
|
211
243
|
// consumer indexing it must not have to learn a new shape — so the
|