@ybotok/loam 0.1.0-beta.3 → 0.2.0-alpha.13
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 +5992 -82
- package/COMPARISON.md +168 -63
- package/CONTRIBUTING.md +121 -0
- package/MIGRATING-from-OpenSpec.md +238 -55
- package/QUICKSTART.md +302 -0
- package/README.md +653 -144
- package/ROADMAP.md +1035 -0
- package/SCHEMA.md +3916 -263
- package/SECURITY.md +21 -3
- package/WORKFLOW.md +927 -0
- package/dist/cli.js +133 -21
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt/adopt.js +204 -0
- package/dist/commands/adopt/adopt.js.map +1 -0
- package/dist/commands/adopt/render.js +309 -0
- package/dist/commands/adopt/render.js.map +1 -0
- package/dist/commands/archive/archive.js +74 -0
- package/dist/commands/archive/archive.js.map +1 -0
- package/dist/commands/archive/closing.js +42 -0
- package/dist/commands/archive/closing.js.map +1 -0
- package/dist/commands/archive/plan/contracts/asyncapi.js +172 -0
- package/dist/commands/archive/plan/contracts/asyncapi.js.map +1 -0
- 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 +193 -0
- package/dist/commands/archive/plan/contracts/openapi.js.map +1 -0
- package/dist/commands/archive/plan/contracts/verdict-lines.js +103 -0
- package/dist/commands/archive/plan/contracts/verdict-lines.js.map +1 -0
- package/dist/commands/archive/plan/document/head.js +151 -0
- package/dist/commands/archive/plan/document/head.js.map +1 -0
- package/dist/commands/archive/plan/document/links.js +284 -0
- package/dist/commands/archive/plan/document/links.js.map +1 -0
- package/dist/commands/archive/plan/document/run.js +136 -0
- package/dist/commands/archive/plan/document/run.js.map +1 -0
- package/dist/commands/archive/plan/gate.js +319 -0
- package/dist/commands/archive/plan/gate.js.map +1 -0
- package/dist/commands/archive/plan/landscape.js +298 -0
- package/dist/commands/archive/plan/landscape.js.map +1 -0
- package/dist/commands/archive/plan/model/extending.js +85 -0
- package/dist/commands/archive/plan/model/extending.js.map +1 -0
- package/dist/commands/archive/plan/refusal.js +106 -0
- package/dist/commands/archive/plan/refusal.js.map +1 -0
- package/dist/commands/archive/plan/specs.js +318 -0
- package/dist/commands/archive/plan/specs.js.map +1 -0
- package/dist/commands/archive/plan/state.js +30 -0
- package/dist/commands/archive/plan/state.js.map +1 -0
- package/dist/commands/archive/run.js +355 -0
- package/dist/commands/archive/run.js.map +1 -0
- package/dist/commands/archive/shipped.js +49 -0
- package/dist/commands/archive/shipped.js.map +1 -0
- package/dist/commands/context/context.js +166 -0
- package/dist/commands/context/context.js.map +1 -0
- package/dist/commands/context/print.js +305 -0
- package/dist/commands/context/print.js.map +1 -0
- package/dist/commands/delta/delta.js +367 -0
- package/dist/commands/delta/delta.js.map +1 -0
- package/dist/commands/delta/print.js +221 -0
- package/dist/commands/delta/print.js.map +1 -0
- package/dist/commands/dependencies.js +6 -8
- package/dist/commands/dependencies.js.map +1 -1
- package/dist/commands/diff/diff.js +86 -0
- package/dist/commands/diff/diff.js.map +1 -0
- package/dist/commands/diff/print.js +38 -0
- package/dist/commands/diff/print.js.map +1 -0
- package/dist/commands/doctor.js +65 -5
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/explain/explain.js +227 -0
- package/dist/commands/explain/explain.js.map +1 -0
- package/dist/commands/explore.js +39 -28
- package/dist/commands/explore.js.map +1 -1
- package/dist/commands/gate/gate.js +152 -0
- package/dist/commands/gate/gate.js.map +1 -0
- package/dist/commands/gate/print.js +66 -0
- package/dist/commands/gate/print.js.map +1 -0
- package/dist/commands/gherkin/commit.js +105 -0
- package/dist/commands/gherkin/commit.js.map +1 -0
- package/dist/commands/gherkin/gherkin.js +262 -0
- package/dist/commands/gherkin/gherkin.js.map +1 -0
- package/dist/commands/gherkin/reconcile.js +146 -0
- package/dist/commands/gherkin/reconcile.js.map +1 -0
- package/dist/commands/gherkin/render.js +77 -0
- package/dist/commands/gherkin/render.js.map +1 -0
- package/dist/commands/init/example.js +204 -0
- package/dist/commands/init/example.js.map +1 -0
- package/dist/commands/init/first-hour.js +72 -0
- package/dist/commands/init/first-hour.js.map +1 -0
- package/dist/commands/{init.js → init/init.js} +142 -71
- package/dist/commands/init/init.js.map +1 -0
- package/dist/commands/init/mcp.js +131 -0
- package/dist/commands/init/mcp.js.map +1 -0
- package/dist/commands/init/options.js +78 -0
- package/dist/commands/init/options.js.map +1 -0
- package/dist/commands/instructions.js +72 -14
- package/dist/commands/instructions.js.map +1 -1
- package/dist/commands/list/campaign/campaign.js +63 -0
- package/dist/commands/list/campaign/campaign.js.map +1 -0
- package/dist/commands/list/campaign/owners.js +65 -0
- package/dist/commands/list/campaign/owners.js.map +1 -0
- package/dist/commands/list/json.js +155 -0
- package/dist/commands/list/json.js.map +1 -0
- package/dist/commands/list/list.js +358 -0
- package/dist/commands/list/list.js.map +1 -0
- package/dist/commands/list/print.js +344 -0
- package/dist/commands/list/print.js.map +1 -0
- package/dist/commands/list/review.js +120 -0
- package/dist/commands/list/review.js.map +1 -0
- 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 +108 -0
- package/dist/commands/list/views.js.map +1 -0
- package/dist/commands/mcp/dispatch.js +238 -0
- package/dist/commands/mcp/dispatch.js.map +1 -0
- package/dist/commands/mcp/mcp.js +75 -0
- package/dist/commands/mcp/mcp.js.map +1 -0
- package/dist/commands/mcp/serve.js +55 -0
- package/dist/commands/mcp/serve.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/active.js +175 -0
- package/dist/commands/migrate-openspec/materialize/active.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/feature.js +41 -0
- package/dist/commands/migrate-openspec/materialize/feature.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/living.js +62 -0
- package/dist/commands/migrate-openspec/materialize/living.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/stage.js +143 -0
- package/dist/commands/migrate-openspec/materialize/stage.js.map +1 -0
- package/dist/commands/migrate-openspec/materialize/target.js +219 -0
- package/dist/commands/migrate-openspec/materialize/target.js.map +1 -0
- package/dist/commands/migrate-openspec/migrate-openspec.js +142 -0
- package/dist/commands/migrate-openspec/migrate-openspec.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/decisions.js +86 -0
- package/dist/commands/migrate-openspec/openspec/decisions.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/error.js +18 -0
- package/dist/commands/migrate-openspec/openspec/error.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/mapping.js +162 -0
- package/dist/commands/migrate-openspec/openspec/mapping.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/paths.js +40 -0
- package/dist/commands/migrate-openspec/openspec/paths.js.map +1 -0
- package/dist/commands/migrate-openspec/openspec/read.js +49 -0
- package/dist/commands/migrate-openspec/openspec/read.js.map +1 -0
- package/dist/commands/migrate-openspec/print.js +89 -0
- package/dist/commands/migrate-openspec/print.js.map +1 -0
- 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 +62 -0
- package/dist/commands/new/commit.js.map +1 -0
- package/dist/commands/new/modifies.js +206 -0
- package/dist/commands/new/modifies.js.map +1 -0
- package/dist/commands/new/new.js +328 -0
- package/dist/commands/new/new.js.map +1 -0
- package/dist/commands/new/templates.js +279 -0
- package/dist/commands/new/templates.js.map +1 -0
- package/dist/commands/open.js +199 -0
- package/dist/commands/open.js.map +1 -0
- package/dist/commands/policy/format.js +152 -0
- package/dist/commands/policy/format.js.map +1 -0
- package/dist/commands/{docs-repo-gate.js → policy/gate.js} +38 -11
- package/dist/commands/policy/gate.js.map +1 -0
- package/dist/commands/rebase/edit.js +106 -0
- package/dist/commands/rebase/edit.js.map +1 -0
- package/dist/commands/rebase/living.js +185 -0
- package/dist/commands/rebase/living.js.map +1 -0
- package/dist/commands/rebase/plan.js +245 -0
- package/dist/commands/rebase/plan.js.map +1 -0
- package/dist/commands/rebase/rebase.js +300 -0
- package/dist/commands/rebase/rebase.js.map +1 -0
- package/dist/commands/seed/commit.js +221 -0
- package/dist/commands/seed/commit.js.map +1 -0
- package/dist/commands/seed/plan.js +278 -0
- package/dist/commands/seed/plan.js.map +1 -0
- package/dist/commands/seed/seed.js +174 -0
- package/dist/commands/seed/seed.js.map +1 -0
- package/dist/commands/show/feature.js +182 -0
- package/dist/commands/show/feature.js.map +1 -0
- package/dist/commands/show/introduced.js +157 -0
- package/dist/commands/show/introduced.js.map +1 -0
- package/dist/commands/show/marks.js +53 -0
- package/dist/commands/show/marks.js.map +1 -0
- package/dist/commands/show/service.js +239 -0
- package/dist/commands/show/service.js.map +1 -0
- package/dist/commands/show/show.js +87 -0
- package/dist/commands/show/show.js.map +1 -0
- package/dist/commands/status/fleet-next.js +90 -0
- package/dist/commands/status/fleet-next.js.map +1 -0
- package/dist/commands/status/json.js +47 -0
- package/dist/commands/status/json.js.map +1 -0
- package/dist/commands/status/print.js +209 -0
- package/dist/commands/status/print.js.map +1 -0
- package/dist/commands/status/status.js +115 -0
- package/dist/commands/status/status.js.map +1 -0
- package/dist/commands/steps/steps.js +269 -0
- package/dist/commands/steps/steps.js.map +1 -0
- package/dist/commands/subsystem/edit.js +192 -0
- package/dist/commands/subsystem/edit.js.map +1 -0
- package/dist/commands/subsystem/move.js +325 -0
- package/dist/commands/subsystem/move.js.map +1 -0
- package/dist/commands/subsystem/query.js +113 -0
- package/dist/commands/subsystem/query.js.map +1 -0
- package/dist/commands/subsystem/subsystem.js +98 -0
- package/dist/commands/subsystem/subsystem.js.map +1 -0
- package/dist/commands/subsystem/sync.js +318 -0
- package/dist/commands/subsystem/sync.js.map +1 -0
- package/dist/commands/subsystem/txn/exclude.js +132 -0
- package/dist/commands/subsystem/txn/exclude.js.map +1 -0
- package/dist/commands/subsystem/txn/links.js +128 -0
- package/dist/commands/subsystem/txn/links.js.map +1 -0
- package/dist/commands/subsystem/txn/report.js +174 -0
- package/dist/commands/subsystem/txn/report.js.map +1 -0
- package/dist/commands/subsystem/txn/txn.js +196 -0
- package/dist/commands/subsystem/txn/txn.js.map +1 -0
- package/dist/commands/subsystem/txn/views.js +249 -0
- package/dist/commands/subsystem/txn/views.js.map +1 -0
- package/dist/commands/tasks/actions.js +107 -0
- package/dist/commands/tasks/actions.js.map +1 -0
- package/dist/commands/tasks/render.js +253 -0
- package/dist/commands/tasks/render.js.map +1 -0
- package/dist/commands/tasks/tasks.js +119 -0
- package/dist/commands/tasks/tasks.js.map +1 -0
- package/dist/commands/unarchive/manifest.js +176 -0
- package/dist/commands/unarchive/manifest.js.map +1 -0
- package/dist/commands/unarchive/restore.js +254 -0
- package/dist/commands/unarchive/restore.js.map +1 -0
- package/dist/commands/unarchive/unarchive.js +59 -0
- package/dist/commands/unarchive/unarchive.js.map +1 -0
- package/dist/commands/validate/arch-coverage.js +245 -0
- package/dist/commands/validate/arch-coverage.js.map +1 -0
- package/dist/commands/validate/checks/fleet-shape.js +204 -0
- package/dist/commands/validate/checks/fleet-shape.js.map +1 -0
- package/dist/commands/validate/checks/health-deps.js +58 -0
- package/dist/commands/validate/checks/health-deps.js.map +1 -0
- package/dist/commands/validate/checks/introduced.js +102 -0
- package/dist/commands/validate/checks/introduced.js.map +1 -0
- package/dist/commands/validate/checks/requirements.js +264 -0
- package/dist/commands/validate/checks/requirements.js.map +1 -0
- package/dist/commands/validate/checks/sources.js +85 -0
- package/dist/commands/validate/checks/sources.js.map +1 -0
- package/dist/commands/validate/coverage/covers-after.js +105 -0
- package/dist/commands/validate/coverage/covers-after.js.map +1 -0
- package/dist/commands/validate/feature.js +222 -0
- package/dist/commands/validate/feature.js.map +1 -0
- package/dist/commands/validate/fleet/census.js +93 -0
- package/dist/commands/validate/fleet/census.js.map +1 -0
- package/dist/commands/validate/fleet/kind-tags.js +39 -0
- package/dist/commands/validate/fleet/kind-tags.js.map +1 -0
- package/dist/commands/validate/fleet/landscape.js +371 -0
- package/dist/commands/validate/fleet/landscape.js.map +1 -0
- package/dist/commands/validate/fleet/load.js +118 -0
- package/dist/commands/validate/fleet/load.js.map +1 -0
- package/dist/commands/validate/fleet/map/attest.js +98 -0
- package/dist/commands/validate/fleet/map/attest.js.map +1 -0
- package/dist/commands/validate/fleet/map/bindings.js +107 -0
- package/dist/commands/validate/fleet/map/bindings.js.map +1 -0
- package/dist/commands/validate/fleet/map/consumers.js +244 -0
- package/dist/commands/validate/fleet/map/consumers.js.map +1 -0
- package/dist/commands/validate/fleet/map/isolation.js +116 -0
- package/dist/commands/validate/fleet/map/isolation.js.map +1 -0
- package/dist/commands/validate/fleet/map/usecases.js +54 -0
- package/dist/commands/validate/fleet/map/usecases.js.map +1 -0
- package/dist/commands/validate/fleet/obligations.js +266 -0
- package/dist/commands/validate/fleet/obligations.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/adoption.js +102 -0
- package/dist/commands/validate/fleet/scorecard/adoption.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/contracts.js +98 -0
- package/dist/commands/validate/fleet/scorecard/contracts.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/print.js +71 -0
- package/dist/commands/validate/fleet/scorecard/print.js.map +1 -0
- package/dist/commands/validate/fleet/scorecard/scorecard.js +162 -0
- package/dist/commands/validate/fleet/scorecard/scorecard.js.map +1 -0
- package/dist/commands/validate/fleet/usecases/place.js +13 -0
- package/dist/commands/validate/fleet/usecases/place.js.map +1 -0
- package/dist/commands/validate/fleet/views/fleet-project.js +217 -0
- package/dist/commands/validate/fleet/views/fleet-project.js.map +1 -0
- package/dist/commands/validate/fleet/views/ids.js +75 -0
- package/dist/commands/validate/fleet/views/ids.js.map +1 -0
- package/dist/commands/validate/fleet/views/projects.js +278 -0
- package/dist/commands/validate/fleet/views/projects.js.map +1 -0
- package/dist/commands/validate/fleet/views/root-documents.js +83 -0
- package/dist/commands/validate/fleet/views/root-documents.js.map +1 -0
- package/dist/commands/validate/fleet/views/stale.js +52 -0
- package/dist/commands/validate/fleet/views/stale.js.map +1 -0
- package/dist/commands/validate/links/corpus.js +89 -0
- package/dist/commands/validate/links/corpus.js.map +1 -0
- package/dist/commands/validate/links/glossary.js +75 -0
- package/dist/commands/validate/links/glossary.js.map +1 -0
- package/dist/commands/validate/render/repeats.js +63 -0
- package/dist/commands/validate/render/repeats.js.map +1 -0
- package/dist/commands/validate/render/rollups.js +115 -0
- package/dist/commands/validate/render/rollups.js.map +1 -0
- package/dist/commands/validate/render/text.js +199 -0
- package/dist/commands/validate/render/text.js.map +1 -0
- package/dist/commands/validate/report.js +145 -0
- package/dist/commands/validate/report.js.map +1 -0
- package/dist/commands/validate/scope.js +113 -0
- package/dist/commands/validate/scope.js.map +1 -0
- package/dist/commands/validate/service/api.js +252 -0
- package/dist/commands/validate/service/api.js.map +1 -0
- 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 +241 -0
- package/dist/commands/validate/service/events/events.js.map +1 -0
- package/dist/commands/validate/service/events/message-producers.js +77 -0
- package/dist/commands/validate/service/events/message-producers.js.map +1 -0
- package/dist/commands/validate/service/evidence-pins.js +177 -0
- package/dist/commands/validate/service/evidence-pins.js.map +1 -0
- package/dist/commands/validate/service/model/diverged.js +226 -0
- package/dist/commands/validate/service/model/diverged.js.map +1 -0
- package/dist/commands/validate/service/model/grade.js +163 -0
- package/dist/commands/validate/service/model/grade.js.map +1 -0
- package/dist/commands/validate/service/service.js +310 -0
- package/dist/commands/validate/service/service.js.map +1 -0
- package/dist/commands/validate/service/specs.js +279 -0
- package/dist/commands/validate/service/specs.js.map +1 -0
- package/dist/commands/validate/service/spine.js +148 -0
- package/dist/commands/validate/service/spine.js.map +1 -0
- package/dist/commands/validate/service/usecases/tags.js +113 -0
- package/dist/commands/validate/service/usecases/tags.js.map +1 -0
- package/dist/commands/validate/service/usecases/usecases.js +209 -0
- package/dist/commands/validate/service/usecases/usecases.js.map +1 -0
- package/dist/commands/validate/validate.js +363 -0
- package/dist/commands/validate/validate.js.map +1 -0
- package/dist/commands/verify/cross/diff.js +178 -0
- package/dist/commands/verify/cross/diff.js.map +1 -0
- package/dist/commands/verify/evidence/contract.js +32 -0
- package/dist/commands/verify/evidence/contract.js.map +1 -0
- package/dist/commands/verify/evidence/pins.js +52 -0
- package/dist/commands/verify/evidence/pins.js.map +1 -0
- package/dist/commands/verify/evidence/read.js +81 -0
- package/dist/commands/verify/evidence/read.js.map +1 -0
- package/dist/commands/verify/frozen.js +263 -0
- package/dist/commands/verify/frozen.js.map +1 -0
- package/dist/commands/verify/record.js +278 -0
- package/dist/commands/verify/record.js.map +1 -0
- package/dist/commands/verify/report.js +206 -0
- package/dist/commands/verify/report.js.map +1 -0
- package/dist/commands/verify/results.js +328 -0
- package/dist/commands/verify/results.js.map +1 -0
- package/dist/commands/verify/verify.js +220 -0
- package/dist/commands/verify/verify.js.map +1 -0
- package/dist/commands/vouch/contract.js +11 -0
- package/dist/commands/vouch/contract.js.map +1 -0
- package/dist/commands/vouch/pack/contract.js +2 -0
- package/dist/commands/vouch/pack/contract.js.map +1 -0
- package/dist/commands/vouch/pack/pack.js +266 -0
- package/dist/commands/vouch/pack/pack.js.map +1 -0
- package/dist/commands/vouch/pack/print.js +266 -0
- package/dist/commands/vouch/pack/print.js.map +1 -0
- package/dist/commands/vouch/pack/sections.js +141 -0
- package/dist/commands/vouch/pack/sections.js.map +1 -0
- package/dist/commands/vouch/prompt/confirm.js +46 -0
- package/dist/commands/vouch/prompt/confirm.js.map +1 -0
- package/dist/commands/vouch/report.js +101 -0
- package/dist/commands/vouch/report.js.map +1 -0
- package/dist/commands/vouch/run.js +230 -0
- package/dist/commands/vouch/run.js.map +1 -0
- package/dist/commands/vouch/sample/plan.js +111 -0
- package/dist/commands/vouch/sample/plan.js.map +1 -0
- package/dist/commands/vouch/sample/print.js +109 -0
- package/dist/commands/vouch/sample/print.js.map +1 -0
- package/dist/commands/vouch/vet/verify.js +155 -0
- package/dist/commands/vouch/vet/verify.js.map +1 -0
- package/dist/commands/vouch/vouch.js +169 -0
- package/dist/commands/vouch/vouch.js.map +1 -0
- package/dist/core/agent/agents-md/command-map.js +299 -0
- package/dist/core/agent/agents-md/command-map.js.map +1 -0
- package/dist/core/agent/agents-md/map/explain.js +46 -0
- package/dist/core/agent/agents-md/map/explain.js.map +1 -0
- package/dist/core/agent/agents-md/map/lenses/context.js +50 -0
- package/dist/core/agent/agents-md/map/lenses/context.js.map +1 -0
- package/dist/core/agent/agents-md/map/lenses/diff.js +59 -0
- package/dist/core/agent/agents-md/map/lenses/diff.js.map +1 -0
- package/dist/core/agent/agents-md/map/lenses/gate.js +65 -0
- package/dist/core/agent/agents-md/map/lenses/gate.js.map +1 -0
- package/dist/core/agent/agents-md/map/mcp.js +44 -0
- package/dist/core/agent/agents-md/map/mcp.js.map +1 -0
- package/dist/core/agent/agents-md/map/status.js +78 -0
- package/dist/core/agent/agents-md/map/status.js.map +1 -0
- package/dist/core/agent/agents-md/map/subsystem.js +104 -0
- package/dist/core/agent/agents-md/map/subsystem.js.map +1 -0
- package/dist/core/agent/agents-md/map/usecases.js +138 -0
- package/dist/core/agent/agents-md/map/usecases.js.map +1 -0
- package/dist/core/agent/agents-md/refusals.js +273 -0
- package/dist/core/agent/agents-md/refusals.js.map +1 -0
- package/dist/core/agent/agents-md.js +203 -0
- package/dist/core/agent/agents-md.js.map +1 -0
- package/dist/core/{agents-stamp.js → agent/agents-stamp.js} +60 -0
- package/dist/core/agent/agents-stamp.js.map +1 -0
- package/dist/core/agent/contract.js +2 -0
- package/dist/core/agent/contract.js.map +1 -0
- package/dist/core/agent/protocol.js +193 -0
- package/dist/core/agent/protocol.js.map +1 -0
- package/dist/core/agent/scaffold.js +254 -0
- package/dist/core/agent/scaffold.js.map +1 -0
- package/dist/core/agent/support/report.js +144 -0
- package/dist/core/agent/support/report.js.map +1 -0
- package/dist/core/agent/tools/dialects.js +151 -0
- package/dist/core/agent/tools/dialects.js.map +1 -0
- package/dist/core/agent/tools/registry.js +193 -0
- package/dist/core/agent/tools/registry.js.map +1 -0
- package/dist/core/agent/workflows/adopt.js +280 -0
- package/dist/core/agent/workflows/adopt.js.map +1 -0
- package/dist/core/agent/workflows/check.js +373 -0
- package/dist/core/agent/workflows/check.js.map +1 -0
- package/dist/core/agent/workflows/closing.js +323 -0
- package/dist/core/agent/workflows/closing.js.map +1 -0
- package/dist/core/agent/workflows/feature.js +220 -0
- package/dist/core/agent/workflows/feature.js.map +1 -0
- package/dist/core/agent/workflows/implement.js +188 -0
- package/dist/core/agent/workflows/implement.js.map +1 -0
- package/dist/core/agent/workflows/reference/authoring.js +311 -0
- package/dist/core/agent/workflows/reference/authoring.js.map +1 -0
- package/dist/core/agent/workflows/reference/codes.js +67 -0
- package/dist/core/agent/workflows/reference/codes.js.map +1 -0
- package/dist/core/agent/workflows/reference/done-check.js +210 -0
- package/dist/core/agent/workflows/reference/done-check.js.map +1 -0
- package/dist/core/agent/workflows/reference/drawing/drawing.js +253 -0
- package/dist/core/agent/workflows/reference/drawing/drawing.js.map +1 -0
- package/dist/core/agent/workflows/reference/reference.js +19 -0
- package/dist/core/agent/workflows/reference/reference.js.map +1 -0
- package/dist/core/agent/workflows/reference/spine.js +338 -0
- package/dist/core/agent/workflows/reference/spine.js.map +1 -0
- package/dist/core/asyncapi/baseline/plan.js +43 -0
- package/dist/core/asyncapi/baseline/plan.js.map +1 -0
- package/dist/core/asyncapi/baseline/surfaces.js +54 -0
- package/dist/core/asyncapi/baseline/surfaces.js.map +1 -0
- package/dist/core/asyncapi/depth.js +164 -0
- package/dist/core/asyncapi/depth.js.map +1 -0
- package/dist/core/asyncapi/digest.js +146 -0
- package/dist/core/asyncapi/digest.js.map +1 -0
- package/dist/core/asyncapi/merge/components.js +92 -0
- package/dist/core/asyncapi/merge/components.js.map +1 -0
- package/dist/core/asyncapi/merge/error.js +38 -0
- package/dist/core/asyncapi/merge/error.js.map +1 -0
- package/dist/core/asyncapi/merge/markers.js +290 -0
- package/dist/core/asyncapi/merge/markers.js.map +1 -0
- package/dist/core/asyncapi/merge/merge.js +195 -0
- package/dist/core/asyncapi/merge/merge.js.map +1 -0
- package/dist/core/asyncapi/merge/pin.js +83 -0
- package/dist/core/asyncapi/merge/pin.js.map +1 -0
- package/dist/core/asyncapi/model.js +11 -0
- package/dist/core/asyncapi/model.js.map +1 -0
- package/dist/core/asyncapi/producers.js +50 -0
- package/dist/core/asyncapi/producers.js.map +1 -0
- package/dist/core/asyncapi/read.js +263 -0
- package/dist/core/asyncapi/read.js.map +1 -0
- package/dist/core/brief/brief.js +285 -0
- package/dist/core/brief/brief.js.map +1 -0
- package/dist/core/brief/checks.js +385 -0
- package/dist/core/brief/checks.js.map +1 -0
- package/dist/core/brief/landscape.js +273 -0
- package/dist/core/brief/landscape.js.map +1 -0
- package/dist/core/brief/map/extend.js +84 -0
- package/dist/core/brief/map/extend.js.map +1 -0
- package/dist/core/brief/map/owed.js +266 -0
- package/dist/core/brief/map/owed.js.map +1 -0
- package/dist/core/brief/targets.js +304 -0
- package/dist/core/brief/targets.js.map +1 -0
- package/dist/core/brief/unchecked.js +58 -0
- package/dist/core/brief/unchecked.js.map +1 -0
- package/dist/core/c4/arch.js +190 -0
- package/dist/core/c4/arch.js.map +1 -0
- package/dist/core/c4/direction/direction.js +114 -0
- package/dist/core/c4/direction/direction.js.map +1 -0
- package/dist/core/c4/likec4.js +243 -0
- package/dist/core/c4/likec4.js.map +1 -0
- package/dist/core/c4/locate/unlocated.js +150 -0
- package/dist/core/c4/locate/unlocated.js.map +1 -0
- package/dist/core/c4/parsed/deployment.js +160 -0
- package/dist/core/c4/parsed/deployment.js.map +1 -0
- package/dist/core/c4/parsed/dynamic-views.js +132 -0
- package/dist/core/c4/parsed/dynamic-views.js.map +1 -0
- package/dist/core/c4/parsed/specification.js +78 -0
- package/dist/core/c4/parsed/specification.js.map +1 -0
- package/dist/core/c4/parsed/values.js +110 -0
- package/dist/core/c4/parsed/values.js.map +1 -0
- package/dist/core/c4/parsed/view-ids.js +113 -0
- package/dist/core/c4/parsed/view-ids.js.map +1 -0
- package/dist/core/c4/prefetch/fleet.js +134 -0
- package/dist/core/c4/prefetch/fleet.js.map +1 -0
- package/dist/core/c4/project/architecture.js +161 -0
- package/dist/core/c4/project/architecture.js.map +1 -0
- package/dist/core/c4/project/batch.js +140 -0
- package/dist/core/c4/project/batch.js.map +1 -0
- package/dist/core/c4/project/documents.js +89 -0
- package/dist/core/c4/project/documents.js.map +1 -0
- package/dist/core/c4/project/load.js +219 -0
- package/dist/core/c4/project/load.js.map +1 -0
- package/dist/core/c4/project/staged.js +277 -0
- package/dist/core/c4/project/staged.js.map +1 -0
- package/dist/core/c4/resolve/attested.js +0 -0
- package/dist/core/c4/resolve/attested.js.map +1 -0
- 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 +174 -0
- package/dist/core/c4/resolve/service.js.map +1 -0
- package/dist/core/c4/resolve/steps.js +290 -0
- package/dist/core/c4/resolve/steps.js.map +1 -0
- package/dist/core/c4/resolve/systems.js +154 -0
- package/dist/core/c4/resolve/systems.js.map +1 -0
- package/dist/core/c4/root-project/exclude.js +352 -0
- package/dist/core/c4/root-project/exclude.js.map +1 -0
- package/dist/core/c4/seed/fleet-file.js +201 -0
- package/dist/core/c4/seed/fleet-file.js.map +1 -0
- package/dist/core/c4/seed/items.js +91 -0
- package/dist/core/c4/seed/items.js.map +1 -0
- package/dist/core/c4/seed/stamp.js +48 -0
- package/dist/core/c4/seed/stamp.js.map +1 -0
- package/dist/core/c4/seed/template.js +173 -0
- package/dist/core/c4/seed/template.js.map +1 -0
- package/dist/core/c4/service-model/created/models.js +96 -0
- package/dist/core/c4/service-model/created/models.js.map +1 -0
- package/dist/core/c4/service-model/documents.js +47 -0
- package/dist/core/c4/service-model/documents.js.map +1 -0
- package/dist/core/c4/service-model/fleet/extending.js +82 -0
- package/dist/core/c4/service-model/fleet/extending.js.map +1 -0
- package/dist/core/c4/service-model/load.js +165 -0
- package/dist/core/c4/service-model/load.js.map +1 -0
- package/dist/core/c4/service-model/renderer.js +128 -0
- package/dist/core/c4/service-model/renderer.js.map +1 -0
- package/dist/core/c4/service-model/shape.js +106 -0
- package/dist/core/c4/service-model/shape.js.map +1 -0
- package/dist/core/c4/service-model/slice.js +188 -0
- package/dist/core/c4/service-model/slice.js.map +1 -0
- package/dist/core/c4/source-mask.js +369 -0
- package/dist/core/c4/source-mask.js.map +1 -0
- package/dist/core/c4/source-scan.js +308 -0
- package/dist/core/c4/source-scan.js.map +1 -0
- package/dist/core/c4/splice/authored-source.js +167 -0
- package/dist/core/c4/splice/authored-source.js.map +1 -0
- package/dist/core/c4/splice/contract.js +30 -0
- package/dist/core/c4/splice/contract.js.map +1 -0
- package/dist/core/c4/splice/delta-blocks.js +126 -0
- package/dist/core/c4/splice/delta-blocks.js.map +1 -0
- package/dist/core/c4/splice/identity/declared.js +87 -0
- package/dist/core/c4/splice/identity/declared.js.map +1 -0
- package/dist/core/c4/splice/identity/edges.js +73 -0
- package/dist/core/c4/splice/identity/edges.js.map +1 -0
- package/dist/core/c4/splice/identity/existing.js +80 -0
- package/dist/core/c4/splice/identity/existing.js.map +1 -0
- package/dist/core/c4/splice/identity/interior.js +80 -0
- package/dist/core/c4/splice/identity/interior.js.map +1 -0
- package/dist/core/c4/splice/identity/owner.js +50 -0
- package/dist/core/c4/splice/identity/owner.js.map +1 -0
- package/dist/core/c4/splice/landscape-merge.js +337 -0
- package/dist/core/c4/splice/landscape-merge.js.map +1 -0
- package/dist/core/c4/splice/model/merge.js +151 -0
- package/dist/core/c4/splice/model/merge.js.map +1 -0
- package/dist/core/c4/splice/placement.js +298 -0
- package/dist/core/c4/splice/placement.js.map +1 -0
- package/dist/core/c4/splice/text/spot.js +131 -0
- package/dist/core/c4/splice/text/spot.js.map +1 -0
- package/dist/core/c4/workspace.js +166 -0
- package/dist/core/c4/workspace.js.map +1 -0
- package/dist/core/capabilities/authoring/notes.js +141 -0
- package/dist/core/capabilities/authoring/notes.js.map +1 -0
- package/dist/core/capabilities/capabilities.js +124 -0
- package/dist/core/capabilities/capabilities.js.map +1 -0
- package/dist/core/capabilities/delta/doc.js +47 -0
- package/dist/core/capabilities/delta/doc.js.map +1 -0
- package/dist/core/capabilities/delta/overlay.js +129 -0
- package/dist/core/capabilities/delta/overlay.js.map +1 -0
- package/dist/core/capabilities/delta/summary.js +57 -0
- package/dist/core/capabilities/delta/summary.js.map +1 -0
- package/dist/core/capabilities/delta/tree.js +43 -0
- package/dist/core/capabilities/delta/tree.js.map +1 -0
- package/dist/core/capabilities/delta/uncovered.js +222 -0
- package/dist/core/capabilities/delta/uncovered.js.map +1 -0
- package/dist/core/capabilities/findings.js +338 -0
- package/dist/core/capabilities/findings.js.map +1 -0
- package/dist/core/capabilities/realizes/findings.js +174 -0
- package/dist/core/capabilities/realizes/findings.js.map +1 -0
- package/dist/core/capabilities/realizes/join.js +123 -0
- package/dist/core/capabilities/realizes/join.js.map +1 -0
- package/dist/core/capabilities/rollup.js +205 -0
- package/dist/core/capabilities/rollup.js.map +1 -0
- package/dist/core/capabilities/tree.js +104 -0
- package/dist/core/capabilities/tree.js.map +1 -0
- package/dist/core/capabilities/usecase-join.js +267 -0
- package/dist/core/capabilities/usecase-join.js.map +1 -0
- package/dist/core/coherence/authoring/scaffold.js +185 -0
- package/dist/core/coherence/authoring/scaffold.js.map +1 -0
- package/dist/core/coherence/authoring/sentinels.js +75 -0
- package/dist/core/coherence/authoring/sentinels.js.map +1 -0
- package/dist/core/coherence/calls/called.js +52 -0
- package/dist/core/coherence/calls/called.js.map +1 -0
- package/dist/core/coherence/coherence.js +332 -0
- package/dist/core/coherence/coherence.js.map +1 -0
- 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/covers/health.js +85 -0
- package/dist/core/coherence/covers/health.js.map +1 -0
- package/dist/core/coherence/declared.js +295 -0
- package/dist/core/coherence/declared.js.map +1 -0
- package/dist/core/coherence/events/declared.js +191 -0
- package/dist/core/coherence/events/declared.js.map +1 -0
- package/dist/core/coherence/events/events.js +335 -0
- package/dist/core/coherence/events/events.js.map +1 -0
- package/dist/core/coherence/events/grades.js +189 -0
- package/dist/core/coherence/events/grades.js.map +1 -0
- package/dist/core/coherence/events/lookups.js +63 -0
- package/dist/core/coherence/events/lookups.js.map +1 -0
- package/dist/core/coherence/events/produced.js +100 -0
- package/dist/core/coherence/events/produced.js.map +1 -0
- package/dist/core/coherence/living.js +198 -0
- package/dist/core/coherence/living.js.map +1 -0
- package/dist/core/coherence/lookups.js +95 -0
- package/dist/core/coherence/lookups.js.map +1 -0
- package/dist/core/coherence/pending.js +39 -0
- package/dist/core/coherence/pending.js.map +1 -0
- 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/conflict-markers.js +60 -0
- package/dist/core/conflict-markers.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/claims.js +73 -0
- package/dist/core/delta/claims.js.map +1 -0
- package/dist/core/delta/delta.js +341 -0
- package/dist/core/delta/delta.js.map +1 -0
- package/dist/core/delta/document.js +177 -0
- package/dist/core/delta/document.js.map +1 -0
- package/dist/core/delta/scope.js +48 -0
- package/dist/core/delta/scope.js.map +1 -0
- package/dist/core/delta/select.js +237 -0
- package/dist/core/delta/select.js.map +1 -0
- package/dist/core/dependencies/dependencies.js +141 -0
- package/dist/core/dependencies/dependencies.js.map +1 -0
- package/dist/core/dependencies/facts.js +165 -0
- package/dist/core/dependencies/facts.js.map +1 -0
- package/dist/core/dependencies/fanin.js +88 -0
- package/dist/core/dependencies/fanin.js.map +1 -0
- package/dist/core/dependencies/graph.js +106 -0
- package/dist/core/dependencies/graph.js.map +1 -0
- package/dist/core/deployment/delta.js +191 -0
- package/dist/core/deployment/delta.js.map +1 -0
- package/dist/core/deployment/objects.js +145 -0
- package/dist/core/deployment/objects.js.map +1 -0
- package/dist/core/diff/base-git.js +230 -0
- package/dist/core/diff/base-git.js.map +1 -0
- package/dist/core/diff/base-state.js +237 -0
- package/dist/core/diff/base-state.js.map +1 -0
- 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 +204 -0
- package/dist/core/diff/scope/changed-paths.js.map +1 -0
- 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 +312 -0
- package/dist/core/diff/semantic.js.map +1 -0
- package/dist/core/docs.js +37 -85
- package/dist/core/docs.js.map +1 -1
- package/dist/core/doctor/agents.js +238 -0
- package/dist/core/doctor/agents.js.map +1 -0
- package/dist/core/doctor/config.js +139 -0
- package/dist/core/doctor/config.js.map +1 -0
- package/dist/core/doctor/doctor.js +355 -0
- package/dist/core/doctor/doctor.js.map +1 -0
- package/dist/core/doctor/report.js +13 -0
- package/dist/core/doctor/report.js.map +1 -0
- package/dist/core/doctor/reports/scan.js +242 -0
- package/dist/core/doctor/reports/scan.js.map +1 -0
- package/dist/core/doctor/residue.js +110 -0
- package/dist/core/doctor/residue.js.map +1 -0
- package/dist/core/document/apply.js +224 -0
- package/dist/core/document/apply.js.map +1 -0
- package/dist/core/{frontmatter.js → document/frontmatter.js} +103 -2
- package/dist/core/document/frontmatter.js.map +1 -0
- package/dist/core/document/grammar/directives.js +143 -0
- package/dist/core/document/grammar/directives.js.map +1 -0
- package/dist/core/document/parse.js +286 -0
- package/dist/core/document/parse.js.map +1 -0
- package/dist/core/document/scenarios.js +238 -0
- package/dist/core/document/scenarios.js.map +1 -0
- package/dist/core/document/spec.js +234 -0
- package/dist/core/document/spec.js.map +1 -0
- package/dist/core/{config.js → envelope/config.js} +89 -18
- package/dist/core/envelope/config.js.map +1 -0
- package/dist/core/envelope/json.js +209 -0
- package/dist/core/envelope/json.js.map +1 -0
- package/dist/core/{version.js → envelope/version.js} +3 -3
- package/dist/core/envelope/version.js.map +1 -0
- package/dist/core/explain/families.js +180 -0
- package/dist/core/explain/families.js.map +1 -0
- package/dist/core/explain/fix-tables.js +178 -0
- package/dist/core/explain/fix-tables.js.map +1 -0
- package/dist/core/explain/lookup.js +194 -0
- package/dist/core/explain/lookup.js.map +1 -0
- package/dist/core/explain/refusals.js +49 -0
- package/dist/core/explain/refusals.js.map +1 -0
- package/dist/core/explain/terms/documents.js +227 -0
- package/dist/core/explain/terms/documents.js.map +1 -0
- package/dist/core/explain/terms/done-check.js +144 -0
- package/dist/core/explain/terms/done-check.js.map +1 -0
- package/dist/core/explain/terms/entry.js +14 -0
- package/dist/core/explain/terms/entry.js.map +1 -0
- package/dist/core/explain/terms/stages.js +71 -0
- package/dist/core/explain/terms/stages.js.map +1 -0
- package/dist/core/explain/terms/tasks.js +97 -0
- package/dist/core/explain/terms/tasks.js.map +1 -0
- package/dist/core/explain/terms.js +103 -0
- package/dist/core/explain/terms.js.map +1 -0
- package/dist/core/explore/describe.js +105 -0
- package/dist/core/explore/describe.js.map +1 -0
- package/dist/core/explore/explore.js +204 -0
- package/dist/core/explore/explore.js.map +1 -0
- package/dist/core/fleet-context.js +174 -146
- package/dist/core/fleet-context.js.map +1 -1
- package/dist/core/gate/checks.js +208 -0
- package/dist/core/gate/checks.js.map +1 -0
- package/dist/core/gate/partners.js +246 -0
- package/dist/core/gate/partners.js.map +1 -0
- package/dist/core/gate/report.js +47 -0
- package/dist/core/gate/report.js.map +1 -0
- package/dist/core/gate/verification.js +176 -0
- package/dist/core/gate/verification.js.map +1 -0
- package/dist/core/gherkin/digest.js +60 -0
- package/dist/core/gherkin/digest.js.map +1 -0
- package/dist/core/gherkin/emit.js +177 -0
- package/dist/core/gherkin/emit.js.map +1 -0
- package/dist/core/gherkin/read.js +76 -0
- package/dist/core/gherkin/read.js.map +1 -0
- package/dist/core/gherkin/stale.js +210 -0
- package/dist/core/gherkin/stale.js.map +1 -0
- package/dist/core/gherkin/stamp.js +77 -0
- package/dist/core/gherkin/stamp.js.map +1 -0
- package/dist/core/gherkin/steps/catalogue.js +154 -0
- package/dist/core/gherkin/steps/catalogue.js.map +1 -0
- package/dist/core/gherkin/steps/inventory.js +98 -0
- package/dist/core/gherkin/steps/inventory.js.map +1 -0
- package/dist/core/gherkin/steps/phrase.js +72 -0
- package/dist/core/gherkin/steps/phrase.js.map +1 -0
- package/dist/core/glossary/delta.js +109 -0
- package/dist/core/glossary/delta.js.map +1 -0
- package/dist/core/glossary/tree.js +73 -0
- package/dist/core/glossary/tree.js.map +1 -0
- package/dist/core/{concurrency.js → kernel/concurrency.js} +19 -0
- package/dist/core/kernel/concurrency.js.map +1 -0
- package/dist/core/{document-bytes.js → kernel/document-bytes.js} +1 -1
- package/dist/core/kernel/document-bytes.js.map +1 -0
- package/dist/core/kernel/fences.js +42 -0
- package/dist/core/kernel/fences.js.map +1 -0
- package/dist/core/kernel/ids/capability.js +72 -0
- package/dist/core/kernel/ids/capability.js.map +1 -0
- package/dist/core/kernel/ids/dirs.js +33 -0
- package/dist/core/kernel/ids/dirs.js.map +1 -0
- package/dist/core/kernel/ids/feature.js +75 -0
- package/dist/core/kernel/ids/feature.js.map +1 -0
- package/dist/core/kernel/ids/fqn/ancestors.js +65 -0
- package/dist/core/kernel/ids/fqn/ancestors.js.map +1 -0
- package/dist/core/kernel/ids/service.js +156 -0
- package/dist/core/kernel/ids/service.js.map +1 -0
- package/dist/core/kernel/ids/subsystem.js +63 -0
- package/dist/core/kernel/ids/subsystem.js.map +1 -0
- package/dist/core/{path-safety.js → kernel/path-safety.js} +56 -4
- package/dist/core/kernel/path-safety.js.map +1 -0
- package/dist/core/{records.js → kernel/records.js} +11 -0
- package/dist/core/kernel/records.js.map +1 -0
- package/dist/core/links/backlinks.js +66 -0
- package/dist/core/links/backlinks.js.map +1 -0
- package/dist/core/links/case.js +74 -0
- package/dist/core/links/case.js.map +1 -0
- package/dist/core/links/corpus.js +118 -0
- package/dist/core/links/corpus.js.map +1 -0
- package/dist/core/links/findings.js +110 -0
- package/dist/core/links/findings.js.map +1 -0
- package/dist/core/links/parse.js +265 -0
- package/dist/core/links/parse.js.map +1 -0
- package/dist/core/mcp/argv.js +212 -0
- package/dist/core/mcp/argv.js.map +1 -0
- package/dist/core/mcp/author-tools.js +73 -0
- package/dist/core/mcp/author-tools.js.map +1 -0
- package/dist/core/mcp/framing.js +46 -0
- package/dist/core/mcp/framing.js.map +1 -0
- package/dist/core/mcp/protocol.js +280 -0
- package/dist/core/mcp/protocol.js.map +1 -0
- package/dist/core/mcp/tools.js +324 -0
- package/dist/core/mcp/tools.js.map +1 -0
- package/dist/core/obligations/obligations.js +106 -0
- package/dist/core/obligations/obligations.js.map +1 -0
- package/dist/core/openapi/baseline/gate.js +207 -0
- package/dist/core/openapi/baseline/gate.js.map +1 -0
- package/dist/core/openapi/baseline/plan.js +142 -0
- package/dist/core/openapi/baseline/plan.js.map +1 -0
- package/dist/core/openapi/baseline/record.js +174 -0
- package/dist/core/openapi/baseline/record.js.map +1 -0
- 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 +301 -0
- package/dist/core/openapi/contract-tree.js.map +1 -0
- package/dist/core/openapi/depth.js +136 -0
- package/dist/core/openapi/depth.js.map +1 -0
- package/dist/core/openapi/digest.js +239 -0
- package/dist/core/openapi/digest.js.map +1 -0
- package/dist/core/{openapi.js → openapi/doc.js} +54 -108
- package/dist/core/openapi/doc.js.map +1 -0
- package/dist/core/openapi/merge/components.js +199 -0
- package/dist/core/openapi/merge/components.js.map +1 -0
- package/dist/core/openapi/merge/error.js +16 -0
- package/dist/core/openapi/merge/error.js.map +1 -0
- package/dist/core/openapi/merge/markers.js +204 -0
- package/dist/core/openapi/merge/markers.js.map +1 -0
- package/dist/core/openapi/merge/merge.js +232 -0
- package/dist/core/openapi/merge/merge.js.map +1 -0
- package/dist/core/openapi/merge/pin.js +110 -0
- package/dist/core/openapi/merge/pin.js.map +1 -0
- package/dist/core/openspec/decide/capabilities.js +244 -0
- package/dist/core/openspec/decide/capabilities.js.map +1 -0
- package/dist/core/openspec/decide/dispositions.js +63 -0
- package/dist/core/openspec/decide/dispositions.js.map +1 -0
- package/dist/core/openspec/decide/renames.js +179 -0
- package/dist/core/openspec/decide/renames.js.map +1 -0
- package/dist/core/openspec/decide/verdict.js +84 -0
- package/dist/core/openspec/decide/verdict.js.map +1 -0
- package/dist/core/openspec/inventory.js +220 -0
- package/dist/core/openspec/inventory.js.map +1 -0
- package/dist/core/openspec/model/mapping.js +78 -0
- package/dist/core/openspec/model/mapping.js.map +1 -0
- package/dist/core/openspec/model/model.js +70 -0
- package/dist/core/openspec/model/model.js.map +1 -0
- package/dist/core/openspec/scan/changes.js +241 -0
- package/dist/core/openspec/scan/changes.js.map +1 -0
- package/dist/core/openspec/scan/config.js +191 -0
- package/dist/core/openspec/scan/config.js.map +1 -0
- package/dist/core/openspec/scan/shape.js +304 -0
- package/dist/core/openspec/scan/shape.js.map +1 -0
- package/dist/core/openspec/scan/walk.js +116 -0
- package/dist/core/openspec/scan/walk.js.map +1 -0
- package/dist/core/openspec/scan/workspace.js +71 -0
- package/dist/core/openspec/scan/workspace.js.map +1 -0
- package/dist/core/owners/codeowners.js +141 -0
- package/dist/core/owners/codeowners.js.map +1 -0
- package/dist/core/pack/features.js +120 -0
- package/dist/core/pack/features.js.map +1 -0
- package/dist/core/pack/joins.js +112 -0
- package/dist/core/pack/joins.js.map +1 -0
- package/dist/core/pack/living.js +157 -0
- package/dist/core/pack/living.js.map +1 -0
- package/dist/core/pack/pack.js +120 -0
- package/dist/core/pack/pack.js.map +1 -0
- package/dist/core/permissions/permissions.js +87 -0
- package/dist/core/permissions/permissions.js.map +1 -0
- package/dist/core/projection/api.js +84 -0
- package/dist/core/projection/api.js.map +1 -0
- package/dist/core/projection/arch-slice.js +63 -0
- package/dist/core/projection/arch-slice.js.map +1 -0
- package/dist/core/projection/events.js +34 -0
- package/dist/core/projection/events.js.map +1 -0
- package/dist/core/projection/introduced.js +14 -0
- package/dist/core/projection/introduced.js.map +1 -0
- package/dist/core/provenance/findings.js +244 -0
- package/dist/core/provenance/findings.js.map +1 -0
- package/dist/core/provenance/git.js +201 -0
- package/dist/core/provenance/git.js.map +1 -0
- package/dist/core/provenance/gitq/moves.js +139 -0
- package/dist/core/provenance/gitq/moves.js.map +1 -0
- package/dist/core/provenance/gitq/vouched-ancestor.js +179 -0
- package/dist/core/provenance/gitq/vouched-ancestor.js.map +1 -0
- package/dist/core/provenance/sample/scope.js +238 -0
- package/dist/core/provenance/sample/scope.js.map +1 -0
- package/dist/core/provenance/sample/sections.js +61 -0
- package/dist/core/provenance/sample/sections.js.map +1 -0
- package/dist/core/provenance/sources.js +280 -0
- package/dist/core/provenance/sources.js.map +1 -0
- package/dist/core/provenance/stamp.js +220 -0
- package/dist/core/provenance/stamp.js.map +1 -0
- package/dist/core/provenance/walk.js +157 -0
- package/dist/core/provenance/walk.js.map +1 -0
- package/dist/core/repo/authored/paths.js +210 -0
- package/dist/core/repo/authored/paths.js.map +1 -0
- package/dist/core/repo/entries.js +126 -0
- package/dist/core/repo/entries.js.map +1 -0
- package/dist/core/repo/paths.js +322 -0
- package/dist/core/repo/paths.js.map +1 -0
- package/dist/core/repo/repo.js +308 -0
- package/dist/core/repo/repo.js.map +1 -0
- package/dist/core/repo/service-target.js +153 -0
- package/dist/core/repo/service-target.js.map +1 -0
- package/dist/core/repo/state.js +58 -0
- package/dist/core/repo/state.js.map +1 -0
- package/dist/core/repo/tree/find.js +61 -0
- package/dist/core/repo/tree/find.js.map +1 -0
- package/dist/core/repo/tree/fs.js +90 -0
- package/dist/core/repo/tree/fs.js.map +1 -0
- package/dist/core/repo/tree/marker.js +61 -0
- package/dist/core/repo/tree/marker.js.map +1 -0
- package/dist/core/repo/tree/render/body.js +258 -0
- package/dist/core/repo/tree/render/body.js.map +1 -0
- package/dist/core/repo/tree/render/projects.js +182 -0
- package/dist/core/repo/tree/render/projects.js.map +1 -0
- package/dist/core/repo/tree/render/service/header.js +125 -0
- package/dist/core/repo/tree/render/service/header.js.map +1 -0
- package/dist/core/repo/tree/render/service/peers.js +28 -0
- package/dist/core/repo/tree/render/service/peers.js.map +1 -0
- package/dist/core/repo/tree/render/service/view-id.js +67 -0
- package/dist/core/repo/tree/render/service/view-id.js.map +1 -0
- package/dist/core/repo/tree/render/service/views.js +78 -0
- package/dist/core/repo/tree/render/service/views.js.map +1 -0
- package/dist/core/repo/tree/render/stale.js +42 -0
- package/dist/core/repo/tree/render/stale.js.map +1 -0
- package/dist/core/repo/tree/render/text.js +84 -0
- package/dist/core/repo/tree/render/text.js.map +1 -0
- package/dist/core/repo/tree/render/views.js +293 -0
- package/dist/core/repo/tree/render/views.js.map +1 -0
- package/dist/core/repo/tree/walk.js +255 -0
- package/dist/core/repo/tree/walk.js.map +1 -0
- package/dist/core/results.js +146 -14
- package/dist/core/results.js.map +1 -1
- package/dist/core/scaffold/landscape.js +239 -0
- package/dist/core/scaffold/landscape.js.map +1 -0
- package/dist/core/scaffold/legacy.js +271 -0
- package/dist/core/scaffold/legacy.js.map +1 -0
- package/dist/core/scaffold/readme.js +84 -0
- package/dist/core/scaffold/readme.js.map +1 -0
- package/dist/core/staging/commit.js +252 -0
- package/dist/core/staging/commit.js.map +1 -0
- package/dist/core/staging/interrupted.js +96 -0
- package/dist/core/staging/interrupted.js.map +1 -0
- package/dist/core/staging/lock.js +268 -0
- package/dist/core/staging/lock.js.map +1 -0
- package/dist/core/staging/recovery/finding.js +35 -0
- package/dist/core/staging/recovery/finding.js.map +1 -0
- package/dist/core/staging/recovery/intent.js +95 -0
- package/dist/core/staging/recovery/intent.js.map +1 -0
- package/dist/core/staging/recovery/recover.js +204 -0
- package/dist/core/staging/recovery/recover.js.map +1 -0
- package/dist/core/staging/recovery/residue.js +62 -0
- package/dist/core/staging/recovery/residue.js.map +1 -0
- package/dist/core/staging/snapshot/manifest.js +188 -0
- package/dist/core/staging/snapshot/manifest.js.map +1 -0
- package/dist/core/staging/snapshot/snapshot.js +196 -0
- package/dist/core/staging/snapshot/snapshot.js.map +1 -0
- package/dist/core/staging/txn/forward.js +181 -0
- package/dist/core/staging/txn/forward.js.map +1 -0
- package/dist/core/staging/txn/journal.js +139 -0
- package/dist/core/staging/txn/journal.js.map +1 -0
- package/dist/core/staging/txn/transaction.js +75 -0
- package/dist/core/staging/txn/transaction.js.map +1 -0
- package/dist/core/staging/writes.js +113 -0
- package/dist/core/staging/writes.js.map +1 -0
- package/dist/core/status/actions/execution.js +60 -0
- package/dist/core/status/actions/execution.js.map +1 -0
- package/dist/core/status/contracts.js +126 -0
- package/dist/core/status/contracts.js.map +1 -0
- package/dist/core/status/feature/artifacts.js +196 -0
- package/dist/core/status/feature/artifacts.js.map +1 -0
- package/dist/core/status/feature/feature.js +214 -0
- package/dist/core/status/feature/feature.js.map +1 -0
- package/dist/core/status/feature/next.js +163 -0
- package/dist/core/status/feature/next.js.map +1 -0
- package/dist/core/status/feature/state.js +21 -0
- package/dist/core/status/feature/state.js.map +1 -0
- package/dist/core/status/feature/words.js +96 -0
- package/dist/core/status/feature/words.js.map +1 -0
- package/dist/core/status/fleet/fleet.js +216 -0
- package/dist/core/status/fleet/fleet.js.map +1 -0
- package/dist/core/status/fleet/next.js +302 -0
- package/dist/core/status/fleet/next.js.map +1 -0
- package/dist/core/status/interrupted.js +97 -0
- package/dist/core/status/interrupted.js.map +1 -0
- package/dist/core/status/report.js +31 -0
- package/dist/core/status/report.js.map +1 -0
- package/dist/core/status/scan.js +41 -0
- package/dist/core/status/scan.js.map +1 -0
- package/dist/core/status/verification.js +216 -0
- package/dist/core/status/verification.js.map +1 -0
- package/dist/core/tasks/packet.js +199 -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 +166 -0
- package/dist/core/usecases/capability.js.map +1 -0
- package/dist/core/usecases/delta/claims.js +140 -0
- package/dist/core/usecases/delta/claims.js.map +1 -0
- package/dist/core/usecases/delta/flows.js +101 -0
- package/dist/core/usecases/delta/flows.js.map +1 -0
- package/dist/core/usecases/delta/modified.js +315 -0
- package/dist/core/usecases/delta/modified.js.map +1 -0
- package/dist/core/usecases/delta/overlay.js +76 -0
- package/dist/core/usecases/delta/overlay.js.map +1 -0
- package/dist/core/usecases/fleet.js +296 -0
- package/dist/core/usecases/fleet.js.map +1 -0
- package/dist/core/usecases/grade/capability-tag.js +93 -0
- package/dist/core/usecases/grade/capability-tag.js.map +1 -0
- package/dist/core/usecases/grade/feature.js +88 -0
- package/dist/core/usecases/grade/feature.js.map +1 -0
- package/dist/core/usecases/grade/requirement-tag.js +94 -0
- package/dist/core/usecases/grade/requirement-tag.js.map +1 -0
- package/dist/core/usecases/grade/steps.js +266 -0
- package/dist/core/usecases/grade/steps.js.map +1 -0
- package/dist/core/usecases/grade/usecases.js +112 -0
- package/dist/core/usecases/grade/usecases.js.map +1 -0
- package/dist/core/usecases/operations.js +123 -0
- package/dist/core/usecases/operations.js.map +1 -0
- package/dist/core/usecases/place.js +44 -0
- package/dist/core/usecases/place.js.map +1 -0
- package/dist/core/usecases/service/exclude.js +119 -0
- package/dist/core/usecases/service/exclude.js.map +1 -0
- package/dist/core/usecases/service/flows.js +164 -0
- package/dist/core/usecases/service/flows.js.map +1 -0
- 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/usecases/touch.js +101 -0
- package/dist/core/usecases/touch.js.map +1 -0
- package/dist/core/verify/answers.js +180 -0
- package/dist/core/verify/answers.js.map +1 -0
- package/dist/core/verify/build.js +170 -0
- package/dist/core/verify/build.js.map +1 -0
- package/dist/core/verify/checklist.js +259 -0
- package/dist/core/verify/checklist.js.map +1 -0
- package/dist/core/verify/claims/identity.js +61 -0
- package/dist/core/verify/claims/identity.js.map +1 -0
- package/dist/core/verify/cross/diff.js +97 -0
- package/dist/core/verify/cross/diff.js.map +1 -0
- package/dist/core/verify/evidence/contract.js +169 -0
- package/dist/core/verify/evidence/contract.js.map +1 -0
- package/dist/core/verify/location.js +67 -0
- package/dist/core/verify/location.js.map +1 -0
- package/dist/core/verify/pins/lint.js +158 -0
- package/dist/core/verify/pins/lint.js.map +1 -0
- package/dist/core/verify/pins/pin.js +95 -0
- package/dist/core/verify/pins/pin.js.map +1 -0
- package/dist/core/verify/read/file.js +224 -0
- package/dist/core/verify/read/file.js.map +1 -0
- package/dist/core/verify/read/shape.js +169 -0
- 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 +165 -0
- package/dist/core/verify/record.js.map +1 -0
- package/dist/core/verify/store/commit.js +99 -0
- package/dist/core/verify/store/commit.js.map +1 -0
- package/dist/core/verify/store/render.js +61 -0
- package/dist/core/verify/store/render.js.map +1 -0
- package/dist/core/vocabulary/health.js +91 -0
- package/dist/core/vocabulary/health.js.map +1 -0
- package/dist/core/vocabulary/issue.js +59 -0
- package/dist/core/vocabulary/issue.js.map +1 -0
- package/dist/core/vocabulary/maturity.js +216 -0
- package/dist/core/vocabulary/maturity.js.map +1 -0
- package/dist/core/vocabulary/report.js +90 -0
- package/dist/core/vocabulary/report.js.map +1 -0
- package/dist/core/vocabulary/steps.js +266 -0
- package/dist/core/vocabulary/steps.js.map +1 -0
- package/dist/core/workspace/discover.js +239 -0
- package/dist/core/workspace/discover.js.map +1 -0
- package/dist/core/workspace/render.js +52 -0
- package/dist/core/workspace/render.js.map +1 -0
- package/examples/README.md +232 -0
- package/examples/docs/architecture/adrs/0001-transactional-outbox.md +33 -0
- package/examples/docs/architecture/capabilities.yaml +31 -0
- package/examples/docs/architecture/landscape.likec4 +336 -0
- package/examples/docs/architecture/obligations.yaml +23 -0
- package/examples/docs/architecture/permissions.yaml +50 -0
- package/examples/docs/architecture/services.likec4 +70 -0
- package/examples/docs/architecture/subsystems.likec4 +18 -0
- package/examples/docs/architecture/usecases/order-notification.likec4 +74 -0
- package/examples/docs/capabilities/checkout/spec.md +55 -0
- package/examples/docs/capabilities/identity/tokens/spec.md +42 -0
- package/examples/docs/capabilities/order-notifications/spec.md +43 -0
- package/examples/docs/features/FEAT-101-payment-splitting/adrs/0001-dedicated-split-service.md +18 -0
- package/examples/docs/features/FEAT-101-payment-splitting/delta.likec4 +94 -0
- package/examples/docs/features/FEAT-101-payment-splitting/intent.md +44 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/checkout-web/spec.md +21 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-service/asyncapi.yaml +132 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-service/spec.md +36 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/arch.spec.md +40 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/openapi.yaml +116 -0
- package/examples/docs/features/FEAT-101-payment-splitting/specs/payment-split-service/spec.md +55 -0
- package/examples/docs/features/FEAT-112-retire-order-v1/intent.md +35 -0
- package/examples/docs/features/FEAT-112-retire-order-v1/specs/order-service/openapi.yaml +31 -0
- package/examples/docs/features/FEAT-112-retire-order-v1/specs/order-service/spec.md +17 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/architecture/landscape.likec4 +253 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/services/order-service/spec.md +121 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/services/payment-service/openapi.yaml +111 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/files/services/payment-service/spec.md +58 -0
- package/examples/docs/features/archive/FEAT-088-refunds/.loam-before/manifest.json +32 -0
- package/examples/docs/features/archive/FEAT-088-refunds/adrs/0001-refunds-stay-in-payment-service.md +26 -0
- package/examples/docs/features/archive/FEAT-088-refunds/delta.likec4 +28 -0
- package/examples/docs/features/archive/FEAT-088-refunds/intent.md +26 -0
- package/examples/docs/features/archive/FEAT-088-refunds/specs/order-service/spec.md +37 -0
- package/examples/docs/features/archive/FEAT-088-refunds/specs/payment-service/openapi.yaml +73 -0
- package/examples/docs/features/archive/FEAT-088-refunds/specs/payment-service/spec.md +23 -0
- package/examples/docs/features/archive/FEAT-088-refunds/verification.yaml +76 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/architecture/landscape.likec4 +275 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/payment-service/asyncapi.yaml +96 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/payment-service/spec.md +82 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/platform/notification-service/asyncapi.yaml +164 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/files/services/platform/notification-service/spec.md +91 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/.loam-before/manifest.json +46 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/delta.likec4 +36 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/intent.md +22 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/scenario-report.json +10 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/notification-service/asyncapi.yaml +208 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/notification-service/spec.md +24 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/payment-service/asyncapi.yaml +137 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/specs/payment-service/spec.md +31 -0
- package/examples/docs/features/archive/FEAT-120-refund-notification/verification.yaml +84 -0
- package/examples/docs/glossary/order.md +15 -0
- package/examples/docs/glossary/payments/authorization.md +14 -0
- package/examples/docs/likec4.config.json +8 -0
- package/examples/docs/loam.json +3 -0
- package/examples/docs/services/checkout-web/model.likec4 +92 -0
- package/examples/docs/services/checkout-web/spec.md +91 -0
- package/examples/docs/services/checkout-web/ui/pages/checkout.page.yaml +40 -0
- package/examples/docs/services/checkout-web/ui/pages/order-status.page.yaml +24 -0
- package/examples/docs/services/checkout-web/ui/pages/split-payment.page.yaml +26 -0
- package/examples/docs/services/order-service/adrs/0001-orchestrated-order-lifecycle.md +52 -0
- package/examples/docs/services/order-service/arch.spec.md +134 -0
- package/examples/docs/services/order-service/asyncapi.yaml +109 -0
- package/examples/docs/services/order-service/health.yaml +57 -0
- package/examples/docs/services/order-service/model.likec4 +126 -0
- package/examples/docs/services/order-service/openapi.yaml +257 -0
- package/examples/docs/services/order-service/runbook.md +62 -0
- package/examples/docs/services/order-service/spec.md +134 -0
- package/examples/docs/services/payment-service/adrs/0001-payments-outbox.md +18 -0
- package/examples/docs/services/payment-service/adrs/0002-idempotency-keys-on-authorization.md +27 -0
- package/examples/docs/services/payment-service/arch.spec.md +76 -0
- package/examples/docs/services/payment-service/asyncapi.yaml +130 -0
- package/examples/docs/services/payment-service/health.yaml +39 -0
- package/examples/docs/services/payment-service/model.likec4 +68 -0
- package/examples/docs/services/payment-service/openapi.yaml +151 -0
- package/examples/docs/services/payment-service/runbook.md +37 -0
- package/examples/docs/services/payment-service/spec.md +88 -0
- package/examples/docs/services/platform/identity-service/adrs/0001-token-introspection-over-local-validation.md +60 -0
- package/examples/docs/services/platform/identity-service/arch.spec.md +120 -0
- package/examples/docs/services/platform/identity-service/health.yaml +70 -0
- package/examples/docs/services/platform/identity-service/model.likec4 +81 -0
- package/examples/docs/services/platform/identity-service/openapi.yaml +197 -0
- package/examples/docs/services/platform/identity-service/runbook.md +95 -0
- package/examples/docs/services/platform/identity-service/spec.md +119 -0
- package/examples/docs/services/platform/notification-service/asyncapi.yaml +200 -0
- package/examples/docs/services/platform/notification-service/health.yaml +40 -0
- package/examples/docs/services/platform/notification-service/model.likec4 +97 -0
- package/examples/docs/services/platform/notification-service/runbook.md +48 -0
- package/examples/docs/services/platform/notification-service/spec.md +112 -0
- package/examples/docs/services/platform/subsystem.yaml +2 -0
- package/examples/fleet.yaml +57 -0
- package/package.json +19 -6
- package/dist/commands/adopt.js +0 -240
- package/dist/commands/adopt.js.map +0 -1
- package/dist/commands/archive.js +0 -1313
- package/dist/commands/archive.js.map +0 -1
- package/dist/commands/delta.js +0 -388
- package/dist/commands/delta.js.map +0 -1
- package/dist/commands/docs-repo-gate.js.map +0 -1
- package/dist/commands/format.js +0 -17
- package/dist/commands/format.js.map +0 -1
- package/dist/commands/gherkin.js +0 -309
- package/dist/commands/gherkin.js.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/list.js +0 -295
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/migrate-openspec.js +0 -950
- package/dist/commands/migrate-openspec.js.map +0 -1
- package/dist/commands/new.js +0 -413
- package/dist/commands/new.js.map +0 -1
- package/dist/commands/rebase.js +0 -356
- package/dist/commands/rebase.js.map +0 -1
- package/dist/commands/show.js +0 -320
- package/dist/commands/show.js.map +0 -1
- package/dist/commands/status.js +0 -262
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/unarchive.js +0 -317
- package/dist/commands/unarchive.js.map +0 -1
- package/dist/commands/validate.js +0 -1773
- package/dist/commands/validate.js.map +0 -1
- package/dist/commands/verify.js +0 -775
- package/dist/commands/verify.js.map +0 -1
- package/dist/commands/vouch.js +0 -421
- package/dist/commands/vouch.js.map +0 -1
- package/dist/core/agent.js +0 -2173
- package/dist/core/agent.js.map +0 -1
- package/dist/core/agents-stamp.js.map +0 -1
- package/dist/core/arch.js +0 -130
- package/dist/core/arch.js.map +0 -1
- package/dist/core/asyncapi.js +0 -253
- package/dist/core/asyncapi.js.map +0 -1
- package/dist/core/brief.js +0 -755
- package/dist/core/brief.js.map +0 -1
- package/dist/core/coherence.js +0 -577
- package/dist/core/coherence.js.map +0 -1
- package/dist/core/concurrency.js.map +0 -1
- package/dist/core/config.js.map +0 -1
- package/dist/core/delta.js +0 -476
- package/dist/core/delta.js.map +0 -1
- package/dist/core/dependencies.js +0 -356
- package/dist/core/dependencies.js.map +0 -1
- package/dist/core/doctor.js +0 -596
- package/dist/core/doctor.js.map +0 -1
- package/dist/core/document-bytes.js.map +0 -1
- package/dist/core/explore.js +0 -225
- package/dist/core/explore.js.map +0 -1
- package/dist/core/frontmatter.js.map +0 -1
- package/dist/core/gherkin.js +0 -463
- package/dist/core/gherkin.js.map +0 -1
- package/dist/core/health.js +0 -67
- package/dist/core/health.js.map +0 -1
- package/dist/core/ids.js +0 -122
- package/dist/core/ids.js.map +0 -1
- package/dist/core/issue.js +0 -9
- package/dist/core/issue.js.map +0 -1
- package/dist/core/json.js +0 -74
- package/dist/core/json.js.map +0 -1
- package/dist/core/likec4.js +0 -489
- package/dist/core/likec4.js.map +0 -1
- package/dist/core/maturity.js +0 -66
- package/dist/core/maturity.js.map +0 -1
- package/dist/core/openapi-merge.js +0 -552
- package/dist/core/openapi-merge.js.map +0 -1
- package/dist/core/openapi.js.map +0 -1
- package/dist/core/openspec-inventory.js +0 -1440
- package/dist/core/openspec-inventory.js.map +0 -1
- package/dist/core/path-safety.js.map +0 -1
- package/dist/core/provenance.js +0 -787
- package/dist/core/provenance.js.map +0 -1
- package/dist/core/records.js.map +0 -1
- package/dist/core/repo.js +0 -438
- package/dist/core/repo.js.map +0 -1
- package/dist/core/report.js +0 -47
- package/dist/core/report.js.map +0 -1
- package/dist/core/spec.js +0 -505
- package/dist/core/spec.js.map +0 -1
- package/dist/core/staging.js +0 -890
- package/dist/core/staging.js.map +0 -1
- package/dist/core/status.js +0 -1132
- package/dist/core/status.js.map +0 -1
- package/dist/core/steps.js +0 -72
- package/dist/core/steps.js.map +0 -1
- package/dist/core/verify.js +0 -807
- package/dist/core/verify.js.map +0 -1
- package/dist/core/version.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../src/commands/verify/verify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAuB,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,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ACvB,OAAO,EAAE,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE;oBACrC,QAAQ,EAAE,QAAQ,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI;iBAC1G,EACD,IAAI,CACL,CAAC;gBACF,OAAO;YACT,CAAC;YAED,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE;gBACtE,IAAI,EAAE,IAAI,CAAC,OAAO;gBAClB,KAAK,EAAE,MAAM,CAAC,OAAO;aACtB,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,uEAAuE;YACvE,gEAAgE;YAChE,IAAI,WAAW,KAAK,IAAI;gBAAE,MAAM,WAAW,EAAE,CAAC;QAChD,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { Command } from \"commander\";\nimport { configOrRefuse, fail, repoPath } from \"../../core/envelope/json.js\";\nimport { missingFeatureMessage, resolveFeature } from \"../../core/repo/repo.js\";\nimport { type CommitRecovery } from \"../../core/staging/interrupted.js\";\nimport { LOCK_WAIT_MS } from \"../../core/staging/lock.js\";\nimport { openCommitWindow } from \"../../core/staging/recovery/recover.js\";\nimport { docsRepoReady } from \"../policy/gate.js\";\nimport { featureChecklist } from \"../../core/verify/checklist.js\";\nimport { readVerificationState } from \"../../core/verify/read/file.js\";\nimport { report } from \"./report.js\";\nimport { reportFrozen } from \"./frozen.js\";\nimport { record } from \"./record.js\";\nimport { type VerifyOptions } from \"./record.js\";\nimport { diffAnswers, type AnswerFiles } from \"./cross/diff.js\";\n\n\nexport function registerVerify(program: Command): void {\n program\n .command(\"verify\")\n .argument(\"<featureId>\", \"feature id, e.g. FEAT-101\")\n .description(\"Check a feature against its own promises: derive the claims, record the answers with evidence\")\n .option(\"--record <file>\", \"record a JSON answer set against the current checklist\")\n .option(\n \"--results <file>\",\n \"answer the scenario.tested claims mechanically from a test report: cucumber JSON, or loam's runner-neutral loamScenarioReport JSON for any other runner\",\n )\n .option(\n \"--contract-results <file>\",\n \"answer the api.exposes claims mechanically from an API contract-test report (loam's generic contract-results JSON)\",\n )\n .option(\n \"--diff-answers <files...>\",\n \"cross-examine two independent answer sets against the current checklist (reads only, writes nothing)\",\n )\n .option(\n \"--service <id>\",\n \"record only this service's claims, bound to the current repository commit\",\n )\n .option(\"--json\", \"emit the machine contract instead of the human view\")\n .action(async (featureId: string, opts: VerifyOptions) => {\n const json = opts.json === true;\n\n const config = await configOrRefuse(json);\n if (config === null) return;\n const { docsDir } = config;\n const recording =\n opts.record !== undefined || opts.results !== undefined || opts.contractResults !== undefined;\n\n // --diff-answers is a third READ form (see the WRITING/READING split\n // below): it validates two answer sets against the same checklist and\n // writes nothing, so combining it with any recording flag is a\n // contradiction refused up front — before the binding, before the lock —\n // rather than a mode silently picked between the two.\n let diffFiles: AnswerFiles | null = null;\n if (opts.diffAnswers !== undefined) {\n if (recording) {\n return fail(\n json,\n \"invalid-option\",\n \"--diff-answers is a read-only cross-examination: it validates both files and writes nothing, \" +\n \"so it cannot be combined with --record, --results or --contract-results. \" +\n \"Diff first, then record the answer set you stand behind.\",\n );\n }\n // Commander's variadic form consumes arguments until the next --flag,\n // so a featureId placed AFTER the flag arrives here as a third file —\n // this refusal is what turns that mistake into a sentence instead of a\n // diff of the wrong files.\n const [a, b] = opts.diffAnswers;\n if (opts.diffAnswers.length !== 2 || a === undefined || b === undefined) {\n return fail(\n json,\n \"invalid-option\",\n \"--diff-answers takes exactly two answer files: --diff-answers a.json b.json\",\n );\n }\n diffFiles = { a, b };\n }\n\n // WRITING is bound to the repository; READING is not. An attestation\n // pins claims to this repo's git HEAD and to file:line evidence inside\n // it, so writing (--record, --results or --contract-results) with\n // `--service X` may only run where loam.json says this repo IS X —\n // vouch's and gherkin's refusal, for vouch's reason: from anywhere\n // else, that repository is somebody else's. Reading takes\n // `--service` as a pure lens (which claims are checkout-web's, and what\n // has it said?) and needs no binding at all, because it writes nothing.\n if (recording && opts.service !== undefined) {\n if (config.service === undefined) {\n return fail(\n json,\n \"repository-unavailable\",\n `Cannot attest for '${opts.service}' from here: this is not a service repo — loam.json declares no \\`service\\`. ` +\n `A federated attestation binds the answers to this repository's git HEAD and to evidence inside it, so the repository has to say which service it is. ` +\n `Add \"service\": \"${opts.service}\" to loam.json, or record it from that service's own repo.`,\n );\n }\n if (config.service !== opts.service) {\n return fail(\n json,\n \"service-mismatch\",\n `This repository is configured as service '${config.service}', so it cannot attest claims for '${opts.service}'.`,\n );\n }\n }\n\n // Before the lock, because the lock is a file INSIDE the docs repo: a\n // `docsDir` pointing at nothing used to surface as the lock file's own\n // ENOENT — an `internal` where the read side of this same command names\n // the misconfiguration. \"docs\", not \"services\", in BOTH modes — and that\n // is a pinned contract, not looseness: the legacy all-at-once form\n // records against a features-only docs repo with no `services/` at all,\n // and it has always exited 0 there. The cost is real and accepted: a\n // typo'd `docsDir` pointing at some existing non-docs directory gets a\n // `.loam-lock` created and removed inside it. The gate above only\n // guarantees the directory exists.\n if (!docsRepoReady(json, docsDir, \"docs\")) return;\n\n // A record is a merge over the docs repo, so recording takes the docs\n // lock — the same one archive, unarchive and rebase hold — and takes it\n // HERE, before the feature is even resolved. Behind the lock, an archive\n // can rename this feature's directory into features/archive/ at any\n // moment; a feature resolved before the lock could have its record\n // written into the pre-move path, a file nothing will ever read again.\n // The waiting form rather than archive's refuse-fast one, because two\n // recorders for different services of one feature are both supposed to\n // land: the second waits out the first's sub-second window and merges\n // over what it left. Reading stays lock-free — it writes nothing.\n //\n // A journal under the lock means the last writer never finished. The\n // record's own authoritative read is about to happen; reading it over\n // a half-commit would merge against bytes no run ever produced — the\n // last docs-repo writer that could still silently treat a half-commit\n // as healthy. That refusal must release the lock like every other path\n // out, and once did not; `openCommitWindow` releases it before it answers.\n let releaseLock: (() => Promise<void>) | null = null;\n let recovered: CommitRecovery | null = null;\n if (recording) {\n const opened = await openCommitWindow(docsDir, LOCK_WAIT_MS);\n if (!opened.ok) return fail(json, opened.code, opened.message);\n releaseLock = opened.release;\n recovered = opened.recovered;\n }\n try {\n // Archived features resolve too: a shipped feature's verification is worth\n // reading back, and it travelled into the archive with everything else.\n const feature = await resolveFeature(docsDir, featureId, \"include\");\n if (!feature) {\n // repo.ts's sentence, not a second copy of it. Resolving with \"include\"\n // means the archived branch inside it cannot fire here — an archived\n // feature resolves — so the text is exactly what it was; what changes is\n // that a reworded miss message can no longer leave this one behind.\n return fail(json, \"unknown-target\", await missingFeatureMessage(docsDir, featureId));\n }\n\n // The cross-examination lens leaves BEFORE the record is read below:\n // it never consumes verification.yaml, and the moment a\n // cross-examination is most needed is exactly when the record on disk\n // is too damaged to read and somebody is about to re-record over it —\n // the record-unreadable refusal must not bar the one command that\n // would inform that re-recording. The archived refusal still applies,\n // with the recording branch's code and reason: there is no current\n // checklist to answer, so the wrong thing is the option, not the\n // answer sets.\n if (diffFiles !== null) {\n if (feature.archived) {\n return fail(\n json,\n \"invalid-option\",\n `${feature.id} is archived — there is no current checklist to answer, so there is nothing to cross-examine; its record is frozen history. \\`loam unarchive ${feature.id}\\` first if the claims really need re-answering.`,\n );\n }\n await diffAnswers(\n { docsDir, featureDir: feature.dir, json },\n await featureChecklist(docsDir, feature.dir, feature.id),\n diffFiles,\n { lens: opts.service },\n );\n return;\n }\n\n // Before anything else: a record file that exists but will not read\n // is a refusal, not an absence. It holds somebody's answers and — in a\n // fleet — other repositories' attestations; treating it as \"not verified\"\n // let the next --record silently overwrite all of it, and made the read\n // view say \"no record\" about a file sitting right there.\n //\n // The path is the one FILE that failed, and the advice is that file's:\n // the record is several files now, and the recipe that is safe for a\n // service's own attestation file (delete it, record that service again)\n // is the one that erases a fleet's evidence when the file is the shared\n // one-file record — which is what this refusal used to tell everyone,\n // and what a miscounted record's \"record again\" looped back into.\n //\n // An in-flight feature's checklist is derived FIRST, because which of\n // those files count depends on it: a record kept as per-service files\n // answers the question being asked now, and only the caller knows what\n // that is (`core/verify/read/union.ts`). Read without it, a service\n // that recorded the current checklist could lose a same-day tie to one\n // that recorded an older one, and this view called the whole record\n // stale. An archived feature derives nothing — see below.\n const checklist = feature.archived ? null : await featureChecklist(docsDir, feature.dir, feature.id);\n const existing = await readVerificationState(feature.dir, checklist?.digest);\n if (existing.state === \"unreadable\") {\n return fail(\n json,\n \"record-unreadable\",\n `${repoPath(docsDir, existing.path)} exists but cannot be read as a verification record: ${existing.reason}. ` +\n `${existing.advice} loam will not overwrite a record it could not read.`,\n );\n }\n const recorded = existing.state === \"ok\" ? existing.verification : null;\n\n // But an archived feature never gets a re-derived checklist — see the\n // header. Its record is frozen history, and --record / --results refuse\n // alike: the code is `invalid-option` rather than `answers-mismatch`\n // because the answers were never compared to anything — there is no\n // current checklist to answer, so the wrong thing here is the option,\n // not the answer set. (`checklist` is null exactly when the feature is\n // archived — the test is spelled on it so the compiler knows the\n // in-flight path below has one.)\n if (checklist === null) {\n if (recording) {\n return fail(\n json,\n \"invalid-option\",\n `${feature.id} is archived — its verification is history now. \\`loam unarchive ${feature.id}\\` first if the answers really need to change.`,\n );\n }\n reportFrozen({ docsDir, featureDir: feature.dir, json }, feature.id, recorded);\n return;\n }\n\n if (recording) {\n // Standing in a service repo, `--service` is what the repo already\n // says: omitting it must not fall back to the legacy all-at-once form,\n // which claims the whole fleet's checklist on this one repo's word.\n //\n // The repo root, not the cwd — `vouch`'s and `gherkin`'s reason. An\n // attestation names a commit and rests on evidence resolved inside\n // \"this repository\", and `config.root` is the directory loam.json was\n // actually found in. Off `process.cwd()`, running from a subdirectory\n // silently changed all three: evidence resolved against the\n // subdirectory, `--results` had to live in it, and `git rev-parse` ran\n // there — a submodule or nested checkout under it would have named\n // somebody else's commit on this repository's attestation.\n //\n // `config.service` and not `opts.service ?? config.service`, though\n // the two are the same value: the binding refusal above lets a\n // recording `--service` through only when it EQUALS the configured\n // service. Taking the configured one keeps its brand — loam.json's\n // reader validated it against the id grammar — and that brand is\n // what `serviceRecordPath` demands before it joins the id into a\n // file name. The raw flag never reaches the join.\n await record(\n { docsDir, featureDir: feature.dir, json, recovered },\n checklist,\n {\n service: config.service,\n repoDir: config.root ?? process.cwd(),\n previous: existing.state === \"ok\" ? { verification: existing.verification, files: existing.files } : null,\n },\n opts,\n );\n return;\n }\n\n report({ docsDir, featureDir: feature.dir, json }, checklist, recorded, {\n lens: opts.service,\n bound: config.service,\n });\n } finally {\n // Released on every path out — a refusal that kept the lock would turn\n // one bad answer set into a wedged docs repo for everyone else.\n if (releaseLock !== null) await releaseLock();\n }\n });\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a vouch IS: the request, the stamp it writes, and every way it can
|
|
3
|
+
* refuse.
|
|
4
|
+
*
|
|
5
|
+
* The outcome is a union rather than a result plus an error field because the
|
|
6
|
+
* command prints a different shape for each arm, and the stamp only exists on
|
|
7
|
+
* the arm that wrote one. A flat record would have every reader assert what the
|
|
8
|
+
* writer already knew.
|
|
9
|
+
*/
|
|
10
|
+
import {} from "../../core/envelope/json.js";
|
|
11
|
+
//# sourceMappingURL=contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../src/commands/vouch/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAkB,MAAM,6BAA6B,CAAC","sourcesContent":["/**\n * What a vouch IS: the request, the stamp it writes, and every way it can\n * refuse.\n *\n * The outcome is a union rather than a result plus an error field because the\n * command prints a different shape for each arm, and the stamp only exists on\n * the arm that wrote one. A flat record would have every reader assert what the\n * writer already knew.\n */\nimport { type ErrorCode } from \"../../core/envelope/json.js\";\nimport type { DocsDir } from \"../../core/kernel/ids/dirs.js\";\nimport type { PathableService } from \"../../core/kernel/ids/service.js\";\nimport type { CommitRecovery } from \"../../core/staging/interrupted.js\";\nimport type { VouchScope } from \"../../core/provenance/sample/scope.js\";\nimport type { SkippedSource } from \"../../core/provenance/walk.js\";\n// The plan's shapes live with the pass that derives them (`sample/plan.ts`),\n// the way pack's `SectionDelta` lives with `pack/sections.ts`. The import\n// direction is parent-from-child, which is the only one the package graph\n// allows here: a sub-package that reached back up into this file would close\n// the cycle `vet/verify.ts` was moved down to avoid.\nimport type { SamplePlan } from \"./sample/plan.js\";\n\nexport interface VouchRequest {\n docsDir: DocsDir;\n service: PathableService;\n /** The service's own repo — what `sources` resolve against. */\n repoDir: string;\n /** The date to stamp. Injected rather than read off the clock, so it can be pinned. */\n today: string;\n /**\n * Who is vouching, as `vouched_by` is stamped — git's identity for `repoDir`.\n * Injected for the same reason `today` is: this function must be reproducible\n * from its arguments, and the resolution (and its refusal) belongs to the\n * command that can talk to a person about it.\n */\n vouchedBy: string;\n /**\n * The sample a person was shown before they answered, under `--sample <n>`.\n * Absent for an ordinary vouch — and its absence is what CLEARS a prior\n * sampled stamp, since a full run deletes `vouch_scope` from every file it\n * writes.\n */\n sample?: SamplePlan;\n}\n\n/** One spec-axis file's share of a successful vouch. */\nexport interface StampedSpec {\n /** Absolute path of the file that was stamped. */\n path: string;\n /** The axis's filename — \"spec.md\" or \"arch.spec.md\". */\n file: string;\n /** Digest of the sources, as stamped into `sources_digest`. */\n digest: string;\n /** Digest of the document's own body, as stamped into `content_digest`. */\n contentDigest: string;\n /** The `sources` entries, as written in the frontmatter. */\n sources: string[];\n /** How many files those entries expanded to. */\n files: number;\n /**\n * Paths under those entries the digest would not hash. A vouch over a spec\n * with a skipped path is still a vouch — the person read what they read — but\n * they are told, because the stamp cannot go stale over bytes it never saw.\n */\n skipped: SkippedSource[];\n /**\n * What was written into `vouch_scope`, or null when the file was read in\n * full and the field was deleted. The report describes what the stamp\n * ACTUALLY says rather than what the plan asked for: a file whose section\n * count was at or under `--sample <n>` is stamped as a full vouch, and the\n * screen the person is looking at has to say so.\n */\n vouchScope: VouchScope | null;\n}\n\nexport type VouchOutcome =\n | {\n ok: true;\n status: \"verified\";\n lastVerified: string;\n /** The identity stamped into every file this vouch touched. */\n vouchedBy: string;\n /**\n * Non-null when this run first rolled a predecessor's interrupted\n * commit forward — the caller reports it, because docs changing beyond\n * the stamp would otherwise read as this vouch's doing.\n */\n recovered: CommitRecovery | null;\n /**\n * Every spec-axis file stamped. Named, not ordered: spec.md is required\n * for a vouch to happen at all, and arch.spec.md is the only other file\n * one can touch, so the type is what says which is which. An array said it\n * in a comment instead, and every reader had to assert non-emptiness to\n * reach the file that comment promised was there.\n */\n stamped: { spec: StampedSpec; archSpec: StampedSpec | null };\n }\n | {\n ok: false;\n // The last three are the commit phase failing: `vouch-raced` says the\n // document moved under the run and nothing was written at all,\n // `merge-failed` says the rollback held (nothing was stamped, re-running\n // can work), `rollback-incomplete` says it did not and the message lists\n // the files.\n code: Extract<\n ErrorCode,\n | \"unknown-target\"\n | \"sources-absent\"\n | \"sources-path-missing\"\n // The spec is there but is not UTF-8 text: a diagnosable state, not the\n // unexpected throw `internal` is for.\n | \"repository-unavailable\"\n | \"vouch-raced\"\n | \"merge-failed\"\n | \"rollback-incomplete\"\n // The commit window now takes the docs lock and reads the journal:\n // another writer can hold the one, a predecessor's crash can leave\n // the other. Both are the codes every other journaled writer answers.\n | \"docs-busy\"\n | \"commit-interrupted\"\n >;\n message: string;\n };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../../src/commands/vouch/pack/contract.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * What a reading pack IS: the request, the per-axis verdicts, and the one way\n * it can refuse. The same seam as `../contract.ts` one level up — the shapes\n * live apart from the derivation so the printer can name what it renders\n * without importing how it was computed.\n *\n * Every verdict is a discriminated union rather than optional-field soup, and\n * the arms are exactly the honest answers: a body is unchanged, or diffable\n * from a NAMED ancestor, or a full read with the reason — never a guessed\n * diff; sources are unchanged, a named delta, a counted-but-nameless move, a\n * state the re-vouch itself would refuse over, or simply unvouched.\n */\nimport type { DocsDir } from \"../../../core/kernel/ids/dirs.js\";\nimport type { PathableService } from \"../../../core/kernel/ids/service.js\";\nimport type { SkippedSource } from \"../../../core/provenance/walk.js\";\nimport type { LandscapeEdge } from \"../../../core/vocabulary/maturity.js\";\nimport type { PackSample, PackVouchScope, SectionDelta } from \"./sections.js\";\n\nexport interface PackRequest {\n docsDir: DocsDir;\n service: PathableService;\n /** The service's own repo — what the source delta resolves `sources` against. */\n repoDir: string;\n /**\n * `--sample <n>`, when the pack is being read as the reading list for a\n * SAMPLED vouch. The pack then prescribes exactly the sections that\n * `loam vouch --sample <n>` will stamp for, through the same seeded\n * derivation — a pack and a stamp that disagreed about which sections were\n * read would make the record worse than no record.\n */\n sample?: number;\n}\n\n/** The body half of one axis's pack: what to read of the document itself. */\nexport type PackBody =\n | { kind: \"unchanged\" }\n | { kind: \"diff\"; ancestorCommit: string; diff: string; sections: SectionDelta }\n | { kind: \"full-read\"; reason: string };\n\n/** The source half: what moved under the code the document was written from. */\nexport type PackSources =\n | { kind: \"unchanged\" }\n | { kind: \"delta\"; added: string[]; changed: string[]; removed: string[] }\n /**\n * The digest moved but the stamp cannot name the paths — the count-only\n * >100-file fallback (`countThen` known) or an index that contradicts its\n * own digest (`countThen` null when even the count is unreadable).\n */\n | { kind: \"uncounted\"; countThen: number | null; countNow: number }\n /** The re-vouch itself would refuse over these sources; the reason IS the worklist. */\n | { kind: \"unavailable\"; reason: string }\n /** Sources resolve but carry no stamp — nothing to diff against yet. */\n | { kind: \"unvouched\" };\n\nexport interface PackAxis {\n /** Docs-relative, `/`-separated — the contract's path spelling. */\n path: string;\n /** The axis's filename — \"spec.md\" or \"arch.spec.md\". */\n file: string;\n /** The stamp's own fields, read back for the \"already covered\" listing. */\n vouchedBy?: string;\n lastVerified?: string;\n body: PackBody;\n sources: PackSources;\n /**\n * Paths under the listed sources the digest recompute would not hash —\n * walk.ts's skip record, carried on the axis because it is orthogonal to\n * the sources verdict (it can accompany unchanged, delta and unvouched\n * alike). Never dropped: these are the parts of the tree the re-vouch's\n * promise will NOT cover, and the pack is now the screen a person reads\n * BEFORE staking that promise. Empty when the vetting itself refused —\n * nobody walked, so nobody can name what a walk would skip.\n */\n skipped: SkippedSource[];\n /**\n * Every H2 heading of the current body — set whenever the whole file is the\n * read (`body.kind === \"full-read\"`: a first vouch, a never-vouched axis, a\n * body whose vouched ancestor cannot be reached), because a full read is\n * exactly where the listing IS the reading plan. Per axis, not per mode:\n * an arch.spec.md created after the last vouch gets its plan inside a\n * re-vouch pack.\n */\n headings?: string[];\n /**\n * The LAST vouch's scope, when that vouch was sampled — present-but-\n * undecodable included, because an unreadable scope on a verified document\n * must never read as a full vouch. Its presence withdraws the \"already\n * covered\" licence for this axis: `unchanged` says the text did not move,\n * and after a sampled vouch that is not the same fact as \"somebody read it\".\n */\n vouchScope?: PackVouchScope;\n /**\n * What a `--sample <n>` vouch would cover, under `--pack --sample <n>`. The\n * forward direction, where `vouchScope` above is the backward one: one says\n * what the next stamp will claim, the other what the last one did.\n */\n sample?: PackSample;\n}\n\n/** What the fleet map says about the service — the first read of a first vouch. */\nexport type PackLandscape =\n | { kind: \"edges\"; inbound: LandscapeEdge[]; outbound: LandscapeEdge[] }\n | { kind: \"silent\"; reason: string };\n\nexport interface PackReport {\n service: string;\n /** \"first-vouch\" when spec.md carries neither digest — nothing exists to diff against. */\n packMode: \"re-vouch\" | \"first-vouch\";\n /**\n * A predecessor's interrupted docs-repo commit journal exists, so what is\n * on disk may predate the write it was killed inside — including the very\n * stamps this pack read. The pack cannot roll the journal forward (recovery\n * is itself a write, and this command may not write), so it says so instead\n * of silently describing a state the next journaled writer will replace.\n */\n pendingCommit: boolean;\n spec: PackAxis;\n archSpec: PackAxis | null;\n /** First-vouch only (null otherwise): landscape claims come first in the reading order. */\n landscape: PackLandscape | null;\n}\n\nexport type PackOutcome =\n | { ok: true; report: PackReport }\n | { ok: false; code: \"unknown-target\"; message: string };\n"]}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The re-vouch reading pack: everything `loam vouch --pack` computes and
|
|
3
|
+
* nothing it prints. Three derivations per spec-axis file, all read-only and
|
|
4
|
+
* all from stamps `loam vouch` already writes — (a) the body's diff from the
|
|
5
|
+
* last commit whose version of the file hashes to the stamped
|
|
6
|
+
* `content_digest`, (b) the source files that moved against the stamped
|
|
7
|
+
* per-file index, (c) the sections whose text is identical to the vouched
|
|
8
|
+
* ancestor's, which the person need not re-read. Nothing here writes, locks
|
|
9
|
+
* or stamps; a "pack" in vouch's vocabulary is always the READING pack — the
|
|
10
|
+
* context pack (`core/pack/`) is a different artifact for a different reader.
|
|
11
|
+
*
|
|
12
|
+
* Why this mode may relax vouch's unattended refusal: the vouch gates
|
|
13
|
+
* (identity, TTY, `--yes`, the docs lock) all defend the WRITE — a
|
|
14
|
+
* `status: verified` no person stood behind. The pack writes nothing and can
|
|
15
|
+
* stamp nothing, so refusing it unattended would only stop agents from doing
|
|
16
|
+
* the one thing they are supposed to do here: prepare the exact reading list
|
|
17
|
+
* a HUMAN then works through before running the vouch itself, which keeps
|
|
18
|
+
* every one of its gates. That is also why `--pack --yes` is refused at the
|
|
19
|
+
* flag boundary (vouch.ts): the two flags point at opposite halves of the
|
|
20
|
+
* act, and a pack that stamped would defeat the read it just prescribed.
|
|
21
|
+
* Journal recovery is different in kind: it is not a gate but a read-side
|
|
22
|
+
* NEED (run.ts rolls it forward "before verification reads a byte" precisely
|
|
23
|
+
* because it changes files a reader has already read), and the pack cannot
|
|
24
|
+
* perform it because recovery is itself a write — so `buildPack` detects the
|
|
25
|
+
* pending journal and reports it instead. What survives unchanged is the
|
|
26
|
+
* wrong-repo gate — the source delta resolves `sources` against the
|
|
27
|
+
* service's own repo, so from anywhere else the paths are someone else's.
|
|
28
|
+
*
|
|
29
|
+
* The fail-closed doctrine, stated once for all three parts: when git cannot
|
|
30
|
+
* answer — no repository, no history, the walk's cap passed, a decline
|
|
31
|
+
* mid-walk — the body degrades to "full read", never to a guessed diff; and
|
|
32
|
+
* an unanswerable question never shrinks the list, because "nobody could
|
|
33
|
+
* look" is not "nothing changed". Only the axis's UNCHANGED list may licence
|
|
34
|
+
* skipping a section, and it is only ever computed from a found ancestor or
|
|
35
|
+
* a digest-equal body.
|
|
36
|
+
*/
|
|
37
|
+
import { existsSync } from "node:fs";
|
|
38
|
+
import { join } from "node:path";
|
|
39
|
+
import { loadFile } from "../../../core/c4/likec4.js";
|
|
40
|
+
import { serviceResolver } from "../../../core/c4/resolve/service.js";
|
|
41
|
+
import { repoPath } from "../../../core/envelope/json.js";
|
|
42
|
+
import { contentDigest, parseFrontmatter, rawBody, stringField } from "../../../core/document/frontmatter.js";
|
|
43
|
+
import { sectionHeadings } from "../../../core/document/parse.js";
|
|
44
|
+
import { bodyDiffText, findVouchedAncestor } from "../../../core/provenance/gitq/vouched-ancestor.js";
|
|
45
|
+
import { decodeSourceIndex, sourceDelta } from "../../../core/provenance/stamp.js";
|
|
46
|
+
import { landscapePath, servicePathsAt, SPEC_AXES, unfiledServicePaths } from "../../../core/repo/paths.js";
|
|
47
|
+
import { enumeratedServices } from "../../../core/repo/service-target.js";
|
|
48
|
+
import { COMMIT_INTENT } from "../../../core/staging/interrupted.js";
|
|
49
|
+
import { NotUtf8Error, readUtf8 } from "../../../core/staging/writes.js";
|
|
50
|
+
import { landscapeEvidence } from "../../../core/vocabulary/maturity.js";
|
|
51
|
+
import { noLivingSpecMessage, verifySpec } from "../vet/verify.js";
|
|
52
|
+
import { forwardSample, priorScope, sectionDelta } from "./sections.js";
|
|
53
|
+
async function readAxis(path) {
|
|
54
|
+
try {
|
|
55
|
+
const raw = await readUtf8(path);
|
|
56
|
+
return { kind: "read", raw, fm: parseFrontmatter(raw) };
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
if (!(err instanceof NotUtf8Error))
|
|
60
|
+
throw err;
|
|
61
|
+
return { kind: "unreadable", reason: err.message };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export async function buildPack(req) {
|
|
65
|
+
// One enumeration answers both questions this function has: where the
|
|
66
|
+
// service's files live (a filed service is not at the root join), and which
|
|
67
|
+
// ids the landscape's resolver may bind to (the same `known` set every
|
|
68
|
+
// other landscape reader passes). The two-line resolution below is
|
|
69
|
+
// `locateServicePaths` (core/repo/service-target.ts) inlined — that helper
|
|
70
|
+
// enumerates internally, and calling it here would walk the tree twice.
|
|
71
|
+
const entries = await enumeratedServices(req.docsDir);
|
|
72
|
+
const entry = entries.find((s) => s.id === req.service);
|
|
73
|
+
const paths = entry === undefined ? unfiledServicePaths(req.docsDir, req.service) : servicePathsAt(entry.dir);
|
|
74
|
+
if (!existsSync(paths.spec)) {
|
|
75
|
+
// One sentence, from `vet/verify.ts`: these commands must not describe the
|
|
76
|
+
// same absence differently, and the fix — adopt first — is the same fix.
|
|
77
|
+
return { ok: false, code: "unknown-target", message: noLivingSpecMessage(paths.spec, req.service) };
|
|
78
|
+
}
|
|
79
|
+
const [specAxis, archAxis] = SPEC_AXES;
|
|
80
|
+
const specRead = await readAxis(paths[specAxis.key]);
|
|
81
|
+
// First vouch is a property of the REQUIRED axis: with neither digest
|
|
82
|
+
// stamped on spec.md there is no prior read to diff against, so the pack is
|
|
83
|
+
// the whole document, landscape claims first. A malformed or unreadable
|
|
84
|
+
// header deliberately does NOT count as first-vouch — it cannot prove the
|
|
85
|
+
// stamps absent, and claiming "first vouch" over a document that may carry
|
|
86
|
+
// one would order the read around a guess.
|
|
87
|
+
const firstVouch = specRead.kind === "read" &&
|
|
88
|
+
!specRead.fm.malformed &&
|
|
89
|
+
stringField(specRead.fm, "content_digest") === undefined &&
|
|
90
|
+
stringField(specRead.fm, "sources_digest") === undefined;
|
|
91
|
+
const spec = await packAxis(req, { path: paths[specAxis.key], file: specAxis.file, read: specRead });
|
|
92
|
+
let archSpec = null;
|
|
93
|
+
if (existsSync(paths[archAxis.key])) {
|
|
94
|
+
const archRead = await readAxis(paths[archAxis.key]);
|
|
95
|
+
archSpec = await packAxis(req, { path: paths[archAxis.key], file: archAxis.file, read: archRead });
|
|
96
|
+
}
|
|
97
|
+
const knownIds = new Set(entries.map((s) => s.id));
|
|
98
|
+
return {
|
|
99
|
+
ok: true,
|
|
100
|
+
report: {
|
|
101
|
+
service: req.service,
|
|
102
|
+
packMode: firstVouch ? "first-vouch" : "re-vouch",
|
|
103
|
+
// One existsSync, the same one run.ts pays before verification reads a
|
|
104
|
+
// byte: a predecessor's journal means the stamps just read may predate
|
|
105
|
+
// the write it was killed inside. The pack cannot recover (a write) —
|
|
106
|
+
// it warns, and the next journaled writer rolls the journal forward.
|
|
107
|
+
pendingCommit: existsSync(join(req.docsDir, COMMIT_INTENT)),
|
|
108
|
+
spec,
|
|
109
|
+
archSpec,
|
|
110
|
+
landscape: firstVouch ? await landscapeSlice(req.docsDir, req.service, knownIds) : null,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/** One spec-axis file's full share of the pack: body verdict, source verdict, stamp fields. */
|
|
115
|
+
async function packAxis(req, axis) {
|
|
116
|
+
const rel = repoPath(req.docsDir, axis.path);
|
|
117
|
+
// The source half rides on verifySpec — the vouch's own vetting, message
|
|
118
|
+
// for message. The pack never refuses over sources: "your re-vouch will
|
|
119
|
+
// refuse, fix this first" IS the worklist, so the refusal sentence travels
|
|
120
|
+
// as the `unavailable` reason instead of an exit code.
|
|
121
|
+
const vetted = await verifySpec({ service: req.service, repoDir: req.repoDir }, axis.path, axis.file);
|
|
122
|
+
// What the digest recompute would NOT hash. Empty on a refusal because
|
|
123
|
+
// nobody walked — never because there is nothing to say.
|
|
124
|
+
const skipped = vetted.ok ? vetted.skipped : [];
|
|
125
|
+
if (axis.read.kind === "unreadable") {
|
|
126
|
+
// Per-axis containment: an undecodable file suspends THIS axis with the
|
|
127
|
+
// decode error as both reasons — the sibling axis still gets its pack.
|
|
128
|
+
return {
|
|
129
|
+
path: rel,
|
|
130
|
+
file: axis.file,
|
|
131
|
+
body: { kind: "full-read", reason: axis.read.reason },
|
|
132
|
+
sources: { kind: "unavailable", reason: vetted.ok ? axis.read.reason : vetted.message },
|
|
133
|
+
skipped,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const { raw, fm } = axis.read;
|
|
137
|
+
const vouchedBy = stringField(fm, "vouched_by");
|
|
138
|
+
const lastVerified = stringField(fm, "last_verified");
|
|
139
|
+
const body = await bodyArm(req, { rel, raw, fm });
|
|
140
|
+
const sources = sourcesArm(vetted, fm);
|
|
141
|
+
const stampedScope = priorScope(fm, body.kind === "unchanged" ? rawBody(raw) : null);
|
|
142
|
+
return {
|
|
143
|
+
path: rel,
|
|
144
|
+
file: axis.file,
|
|
145
|
+
...(vouchedBy === undefined ? {} : { vouchedBy }),
|
|
146
|
+
...(lastVerified === undefined ? {} : { lastVerified }),
|
|
147
|
+
body,
|
|
148
|
+
sources,
|
|
149
|
+
skipped,
|
|
150
|
+
// A full read is exactly where the heading listing IS the reading plan —
|
|
151
|
+
// per axis, not per mode, so an arch.spec.md created after the last vouch
|
|
152
|
+
// gets its plan inside a re-vouch pack. `rawBody` first so no frontmatter
|
|
153
|
+
// line can ever masquerade as a section.
|
|
154
|
+
...(body.kind === "full-read" ? { headings: sectionHeadings(rawBody(raw)).map((h) => h.text) } : {}),
|
|
155
|
+
// Only an UNCHANGED body can license naming what the last sampled vouch
|
|
156
|
+
// read: the recompute needs the bytes that vouch was taken over, and a
|
|
157
|
+
// digest-equal body is exactly those bytes. When the body has moved the
|
|
158
|
+
// scope is still reported — it still means the document was not read in
|
|
159
|
+
// full — with no covered list behind it. Reaching back to the vouched
|
|
160
|
+
// ancestor for the older body would be more information; it would also
|
|
161
|
+
// put a git walk behind a claim about what a person read, and the answer
|
|
162
|
+
// when git cannot speak would have to be this same one.
|
|
163
|
+
...(stampedScope === null ? {} : { vouchScope: stampedScope }),
|
|
164
|
+
...(req.sample === undefined || !vetted.ok
|
|
165
|
+
? {}
|
|
166
|
+
: { sample: forwardSample({ service: req.service, raw, sourcesDigest: vetted.digest, n: req.sample }) }),
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/** The body verdict: unchanged, a diff from the vouched ancestor, or an honest full read. */
|
|
170
|
+
async function bodyArm(req, doc) {
|
|
171
|
+
// Deliberately NOT branched on the report-level first-vouch mode: the mode
|
|
172
|
+
// orders the read (landscape first), but each axis answers from its OWN
|
|
173
|
+
// stamps. In the one corpus where they disagree — spec.md hand-reverted to
|
|
174
|
+
// draft while arch.spec.md still carries a stamp — the stamped axis gets
|
|
175
|
+
// its real diff rather than a false "nobody has read this yet".
|
|
176
|
+
if (doc.fm.malformed) {
|
|
177
|
+
return {
|
|
178
|
+
kind: "full-read",
|
|
179
|
+
reason: "the frontmatter cannot be read as YAML, so whatever content_digest it carries is unreachable — fix the header, then read the whole file",
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
const stamped = stringField(doc.fm, "content_digest");
|
|
183
|
+
if (stamped === undefined) {
|
|
184
|
+
return {
|
|
185
|
+
kind: "full-read",
|
|
186
|
+
reason: stringField(doc.fm, "sources_digest") === undefined
|
|
187
|
+
? "this file has never been vouched, so the whole of it is the read"
|
|
188
|
+
: "the last vouch predates content_digest, so no vouched body exists to diff from — read the whole file",
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
// The cheap answer first, and without git: the digest recipe is byte-exact
|
|
192
|
+
// over the working-tree file, so equality here IS "no byte of the body
|
|
193
|
+
// moved since the stamp".
|
|
194
|
+
if (contentDigest(doc.raw) === stamped)
|
|
195
|
+
return { kind: "unchanged" };
|
|
196
|
+
const ancestor = await findVouchedAncestor(req.docsDir, doc.rel, stamped);
|
|
197
|
+
if (ancestor.kind !== "found") {
|
|
198
|
+
return { kind: "full-read", reason: ancestor.kind === "none" ? ancestor.reason : ancestor.detail };
|
|
199
|
+
}
|
|
200
|
+
const diff = await bodyDiffText(req.docsDir, ancestor.commit, doc.rel);
|
|
201
|
+
// An ancestor without a printable diff could still licence a section delta,
|
|
202
|
+
// but a pack that says "these sections changed, no diff shown" invites
|
|
203
|
+
// skipping the rest on this run's partial word — degrade the whole arm to
|
|
204
|
+
// the full read instead; read more, never less.
|
|
205
|
+
if (diff.kind === "failed")
|
|
206
|
+
return { kind: "full-read", reason: diff.reason };
|
|
207
|
+
return {
|
|
208
|
+
kind: "diff",
|
|
209
|
+
ancestorCommit: ancestor.commit,
|
|
210
|
+
diff: diff.diff,
|
|
211
|
+
sections: sectionDelta(rawBody(ancestor.text), rawBody(doc.raw)),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/** The source verdict, from the vouch's own vetting plus the stamped digests. */
|
|
215
|
+
function sourcesArm(vetted, fm) {
|
|
216
|
+
if (!vetted.ok)
|
|
217
|
+
return { kind: "unavailable", reason: vetted.message };
|
|
218
|
+
const stamped = stringField(fm, "sources_digest");
|
|
219
|
+
if (stamped === undefined)
|
|
220
|
+
return { kind: "unvouched" };
|
|
221
|
+
if (vetted.digest === stamped)
|
|
222
|
+
return { kind: "unchanged" };
|
|
223
|
+
const index = decodeSourceIndex(stringField(fm, "sources_files"));
|
|
224
|
+
const delta = sourceDelta(index, vetted.index);
|
|
225
|
+
if (delta === null)
|
|
226
|
+
return { kind: "uncounted", countThen: index.count ?? null, countNow: vetted.index.length };
|
|
227
|
+
return { kind: "delta", ...delta };
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The fleet map's claims about the service — a first vouch reads these before
|
|
231
|
+
* the spec, because the landscape is the one document making claims ABOUT the
|
|
232
|
+
* service that the person is not the author of. Absence and unparseability
|
|
233
|
+
* both come back as `silent`: per landscapeEvidence's own rule they prove
|
|
234
|
+
* nothing about who calls the service, and the pack says so rather than
|
|
235
|
+
* printing an empty edge list that reads as "nobody does".
|
|
236
|
+
*/
|
|
237
|
+
async function landscapeSlice(docsDir, service, known) {
|
|
238
|
+
const silent = {
|
|
239
|
+
kind: "silent",
|
|
240
|
+
reason: `the fleet map says nothing about ${service} (absent or unparseable)`,
|
|
241
|
+
};
|
|
242
|
+
const path = landscapePath(docsDir);
|
|
243
|
+
if (!existsSync(path))
|
|
244
|
+
return silent;
|
|
245
|
+
let land;
|
|
246
|
+
try {
|
|
247
|
+
land = await loadFile(path);
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
// Unreadable is not "no claims" — but for a reading list both collapse to
|
|
251
|
+
// the same honest sentence: the map cannot brief this read.
|
|
252
|
+
return silent;
|
|
253
|
+
}
|
|
254
|
+
if (land.errors.length > 0)
|
|
255
|
+
return silent;
|
|
256
|
+
const svcOf = serviceResolver(land.elements, known);
|
|
257
|
+
const evidence = landscapeEvidence({
|
|
258
|
+
id: service,
|
|
259
|
+
parses: true,
|
|
260
|
+
relationships: land.relationships,
|
|
261
|
+
elementIds: land.elements.map((e) => e.id),
|
|
262
|
+
svcOf,
|
|
263
|
+
});
|
|
264
|
+
return { kind: "edges", inbound: evidence.inbound, outbound: evidence.outbound };
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=pack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../../../../src/commands/vouch/pack/pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,EAAE,WAAW,EAAoB,MAAM,uCAAuC,CAAC;AAChI,OAAO,EAAE,eAAe,EAAE,MA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n * nothing it prints. Three derivations per spec-axis file, all read-only and\n * all from stamps `loam vouch` already writes — (a) the body's diff from the\n * last commit whose version of the file hashes to the stamped\n * `content_digest`, (b) the source files that moved against the stamped\n * per-file index, (c) the sections whose text is identical to the vouched\n * ancestor's, which the person need not re-read. Nothing here writes, locks\n * or stamps; a \"pack\" in vouch's vocabulary is always the READING pack — the\n * context pack (`core/pack/`) is a different artifact for a different reader.\n *\n * Why this mode may relax vouch's unattended refusal: the vouch gates\n * (identity, TTY, `--yes`, the docs lock) all defend the WRITE — a\n * `status: verified` no person stood behind. The pack writes nothing and can\n * stamp nothing, so refusing it unattended would only stop agents from doing\n * the one thing they are supposed to do here: prepare the exact reading list\n * a HUMAN then works through before running the vouch itself, which keeps\n * every one of its gates. That is also why `--pack --yes` is refused at the\n * flag boundary (vouch.ts): the two flags point at opposite halves of the\n * act, and a pack that stamped would defeat the read it just prescribed.\n * Journal recovery is different in kind: it is not a gate but a read-side\n * NEED (run.ts rolls it forward \"before verification reads a byte\" precisely\n * because it changes files a reader has already read), and the pack cannot\n * perform it because recovery is itself a write — so `buildPack` detects the\n * pending journal and reports it instead. What survives unchanged is the\n * wrong-repo gate — the source delta resolves `sources` against the\n * service's own repo, so from anywhere else the paths are someone else's.\n *\n * The fail-closed doctrine, stated once for all three parts: when git cannot\n * answer — no repository, no history, the walk's cap passed, a decline\n * mid-walk — the body degrades to \"full read\", never to a guessed diff; and\n * an unanswerable question never shrinks the list, because \"nobody could\n * look\" is not \"nothing changed\". Only the axis's UNCHANGED list may licence\n * skipping a section, and it is only ever computed from a found ancestor or\n * a digest-equal body.\n */\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { loadFile } from \"../../../core/c4/likec4.js\";\nimport { serviceResolver } from \"../../../core/c4/resolve/service.js\";\nimport { repoPath } from \"../../../core/envelope/json.js\";\nimport { contentDigest, parseFrontmatter, rawBody, stringField, type Frontmatter } from \"../../../core/document/frontmatter.js\";\nimport { sectionHeadings } from \"../../../core/document/parse.js\";\nimport type { DocsDir } from \"../../../core/kernel/ids/dirs.js\";\nimport { bodyDiffText, findVouchedAncestor } from \"../../../core/provenance/gitq/vouched-ancestor.js\";\nimport { decodeSourceIndex, sourceDelta } from \"../../../core/provenance/stamp.js\";\nimport { landscapePath, servicePathsAt, SPEC_AXES, unfiledServicePaths } from \"../../../core/repo/paths.js\";\nimport { enumeratedServices } from \"../../../core/repo/service-target.js\";\nimport { COMMIT_INTENT } from \"../../../core/staging/interrupted.js\";\nimport { NotUtf8Error, readUtf8 } from \"../../../core/staging/writes.js\";\nimport { landscapeEvidence } from \"../../../core/vocabulary/maturity.js\";\nimport { noLivingSpecMessage, verifySpec } from \"../vet/verify.js\";\nimport type { PackAxis, PackBody, PackLandscape, PackOutcome, PackRequest, PackSources } from \"./contract.js\";\nimport { forwardSample, priorScope, sectionDelta } from \"./sections.js\";\n\n/** One axis file off disk: its text and header, or the reason nobody could read it. */\ntype AxisRead =\n | { kind: \"read\"; raw: string; fm: Frontmatter }\n | { kind: \"unreadable\"; reason: string };\n\nasync function readAxis(path: string): Promise<AxisRead> {\n try {\n const raw = await readUtf8(path);\n return { kind: \"read\", raw, fm: parseFrontmatter(raw) };\n } catch (err) {\n if (!(err instanceof NotUtf8Error)) throw err;\n return { kind: \"unreadable\", reason: err.message };\n }\n}\n\nexport async function buildPack(req: PackRequest): Promise<PackOutcome> {\n // One enumeration answers both questions this function has: where the\n // service's files live (a filed service is not at the root join), and which\n // ids the landscape's resolver may bind to (the same `known` set every\n // other landscape reader passes). The two-line resolution below is\n // `locateServicePaths` (core/repo/service-target.ts) inlined — that helper\n // enumerates internally, and calling it here would walk the tree twice.\n const entries = await enumeratedServices(req.docsDir);\n const entry = entries.find((s) => s.id === req.service);\n const paths = entry === undefined ? unfiledServicePaths(req.docsDir, req.service) : servicePathsAt(entry.dir);\n if (!existsSync(paths.spec)) {\n // One sentence, from `vet/verify.ts`: these commands must not describe the\n // same absence differently, and the fix — adopt first — is the same fix.\n return { ok: false, code: \"unknown-target\", message: noLivingSpecMessage(paths.spec, req.service) };\n }\n const [specAxis, archAxis] = SPEC_AXES;\n const specRead = await readAxis(paths[specAxis.key]);\n\n // First vouch is a property of the REQUIRED axis: with neither digest\n // stamped on spec.md there is no prior read to diff against, so the pack is\n // the whole document, landscape claims first. A malformed or unreadable\n // header deliberately does NOT count as first-vouch — it cannot prove the\n // stamps absent, and claiming \"first vouch\" over a document that may carry\n // one would order the read around a guess.\n const firstVouch =\n specRead.kind === \"read\" &&\n !specRead.fm.malformed &&\n stringField(specRead.fm, \"content_digest\") === undefined &&\n stringField(specRead.fm, \"sources_digest\") === undefined;\n\n const spec = await packAxis(req, { path: paths[specAxis.key], file: specAxis.file, read: specRead });\n let archSpec: PackAxis | null = null;\n if (existsSync(paths[archAxis.key])) {\n const archRead = await readAxis(paths[archAxis.key]);\n archSpec = await packAxis(req, { path: paths[archAxis.key], file: archAxis.file, read: archRead });\n }\n const knownIds = new Set<string>(entries.map((s) => s.id));\n return {\n ok: true,\n report: {\n service: req.service,\n packMode: firstVouch ? \"first-vouch\" : \"re-vouch\",\n // One existsSync, the same one run.ts pays before verification reads a\n // byte: a predecessor's journal means the stamps just read may predate\n // the write it was killed inside. The pack cannot recover (a write) —\n // it warns, and the next journaled writer rolls the journal forward.\n pendingCommit: existsSync(join(req.docsDir, COMMIT_INTENT)),\n spec,\n archSpec,\n landscape: firstVouch ? await landscapeSlice(req.docsDir, req.service, knownIds) : null,\n },\n };\n}\n\n/** One spec-axis file's full share of the pack: body verdict, source verdict, stamp fields. */\nasync function packAxis(\n req: PackRequest,\n axis: { path: string; file: string; read: AxisRead },\n): Promise<PackAxis> {\n const rel = repoPath(req.docsDir, axis.path);\n // The source half rides on verifySpec — the vouch's own vetting, message\n // for message. The pack never refuses over sources: \"your re-vouch will\n // refuse, fix this first\" IS the worklist, so the refusal sentence travels\n // as the `unavailable` reason instead of an exit code.\n const vetted = await verifySpec({ service: req.service, repoDir: req.repoDir }, axis.path, axis.file);\n // What the digest recompute would NOT hash. Empty on a refusal because\n // nobody walked — never because there is nothing to say.\n const skipped = vetted.ok ? vetted.skipped : [];\n\n if (axis.read.kind === \"unreadable\") {\n // Per-axis containment: an undecodable file suspends THIS axis with the\n // decode error as both reasons — the sibling axis still gets its pack.\n return {\n path: rel,\n file: axis.file,\n body: { kind: \"full-read\", reason: axis.read.reason },\n sources: { kind: \"unavailable\", reason: vetted.ok ? axis.read.reason : vetted.message },\n skipped,\n };\n }\n const { raw, fm } = axis.read;\n const vouchedBy = stringField(fm, \"vouched_by\");\n const lastVerified = stringField(fm, \"last_verified\");\n const body = await bodyArm(req, { rel, raw, fm });\n const sources = sourcesArm(vetted, fm);\n const stampedScope = priorScope(fm, body.kind === \"unchanged\" ? rawBody(raw) : null);\n return {\n path: rel,\n file: axis.file,\n ...(vouchedBy === undefined ? {} : { vouchedBy }),\n ...(lastVerified === undefined ? {} : { lastVerified }),\n body,\n sources,\n skipped,\n // A full read is exactly where the heading listing IS the reading plan —\n // per axis, not per mode, so an arch.spec.md created after the last vouch\n // gets its plan inside a re-vouch pack. `rawBody` first so no frontmatter\n // line can ever masquerade as a section.\n ...(body.kind === \"full-read\" ? { headings: sectionHeadings(rawBody(raw)).map((h) => h.text) } : {}),\n // Only an UNCHANGED body can license naming what the last sampled vouch\n // read: the recompute needs the bytes that vouch was taken over, and a\n // digest-equal body is exactly those bytes. When the body has moved the\n // scope is still reported — it still means the document was not read in\n // full — with no covered list behind it. Reaching back to the vouched\n // ancestor for the older body would be more information; it would also\n // put a git walk behind a claim about what a person read, and the answer\n // when git cannot speak would have to be this same one.\n ...(stampedScope === null ? {} : { vouchScope: stampedScope }),\n ...(req.sample === undefined || !vetted.ok\n ? {}\n : { sample: forwardSample({ service: req.service, raw, sourcesDigest: vetted.digest, n: req.sample }) }),\n };\n}\n\n/** The body verdict: unchanged, a diff from the vouched ancestor, or an honest full read. */\nasync function bodyArm(\n req: PackRequest,\n doc: { rel: string; raw: string; fm: Frontmatter },\n): Promise<PackBody> {\n // Deliberately NOT branched on the report-level first-vouch mode: the mode\n // orders the read (landscape first), but each axis answers from its OWN\n // stamps. In the one corpus where they disagree — spec.md hand-reverted to\n // draft while arch.spec.md still carries a stamp — the stamped axis gets\n // its real diff rather than a false \"nobody has read this yet\".\n if (doc.fm.malformed) {\n return {\n kind: \"full-read\",\n reason: \"the frontmatter cannot be read as YAML, so whatever content_digest it carries is unreachable — fix the header, then read the whole file\",\n };\n }\n const stamped = stringField(doc.fm, \"content_digest\");\n if (stamped === undefined) {\n return {\n kind: \"full-read\",\n reason:\n stringField(doc.fm, \"sources_digest\") === undefined\n ? \"this file has never been vouched, so the whole of it is the read\"\n : \"the last vouch predates content_digest, so no vouched body exists to diff from — read the whole file\",\n };\n }\n // The cheap answer first, and without git: the digest recipe is byte-exact\n // over the working-tree file, so equality here IS \"no byte of the body\n // moved since the stamp\".\n if (contentDigest(doc.raw) === stamped) return { kind: \"unchanged\" };\n\n const ancestor = await findVouchedAncestor(req.docsDir, doc.rel, stamped);\n if (ancestor.kind !== \"found\") {\n return { kind: \"full-read\", reason: ancestor.kind === \"none\" ? ancestor.reason : ancestor.detail };\n }\n const diff = await bodyDiffText(req.docsDir, ancestor.commit, doc.rel);\n // An ancestor without a printable diff could still licence a section delta,\n // but a pack that says \"these sections changed, no diff shown\" invites\n // skipping the rest on this run's partial word — degrade the whole arm to\n // the full read instead; read more, never less.\n if (diff.kind === \"failed\") return { kind: \"full-read\", reason: diff.reason };\n return {\n kind: \"diff\",\n ancestorCommit: ancestor.commit,\n diff: diff.diff,\n sections: sectionDelta(rawBody(ancestor.text), rawBody(doc.raw)),\n };\n}\n\n/** The source verdict, from the vouch's own vetting plus the stamped digests. */\nfunction sourcesArm(vetted: Awaited<ReturnType<typeof verifySpec>>, fm: Frontmatter): PackSources {\n if (!vetted.ok) return { kind: \"unavailable\", reason: vetted.message };\n const stamped = stringField(fm, \"sources_digest\");\n if (stamped === undefined) return { kind: \"unvouched\" };\n if (vetted.digest === stamped) return { kind: \"unchanged\" };\n const index = decodeSourceIndex(stringField(fm, \"sources_files\"));\n const delta = sourceDelta(index, vetted.index);\n if (delta === null) return { kind: \"uncounted\", countThen: index.count ?? null, countNow: vetted.index.length };\n return { kind: \"delta\", ...delta };\n}\n\n/**\n * The fleet map's claims about the service — a first vouch reads these before\n * the spec, because the landscape is the one document making claims ABOUT the\n * service that the person is not the author of. Absence and unparseability\n * both come back as `silent`: per landscapeEvidence's own rule they prove\n * nothing about who calls the service, and the pack says so rather than\n * printing an empty edge list that reads as \"nobody does\".\n */\nasync function landscapeSlice(docsDir: DocsDir, service: string, known: Set<string>): Promise<PackLandscape> {\n const silent: PackLandscape = {\n kind: \"silent\",\n reason: `the fleet map says nothing about ${service} (absent or unparseable)`,\n };\n const path = landscapePath(docsDir);\n if (!existsSync(path)) return silent;\n let land: Awaited<ReturnType<typeof loadFile>>;\n try {\n land = await loadFile(path);\n } catch {\n // Unreadable is not \"no claims\" — but for a reading list both collapse to\n // the same honest sentence: the map cannot brief this read.\n return silent;\n }\n if (land.errors.length > 0) return silent;\n const svcOf = serviceResolver(land.elements, known);\n const evidence = landscapeEvidence({\n id: service,\n parses: true,\n relationships: land.relationships,\n elementIds: land.elements.map((e) => e.id),\n svcOf,\n });\n return { kind: \"edges\", inbound: evidence.inbound, outbound: evidence.outbound };\n}\n"]}
|