@warpgogol/forge 8.0.2 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/bin/cli.ts +26 -13
- package/dist/bin/cli.js +18 -13
- package/dist/bin/cli.js.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/adr/handlers/implement-stamp.js +1 -0
- package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
- package/dist/os/adr/types.d.ts +2 -0
- package/dist/os/adr/types.d.ts.map +1 -1
- package/dist/os/agent/agent.module.d.ts +3 -0
- package/dist/os/agent/agent.module.d.ts.map +1 -0
- package/dist/os/agent/agent.module.js +60 -0
- package/dist/os/agent/agent.module.js.map +1 -0
- package/dist/os/agent/handlers/agent-delegate.d.ts +29 -0
- package/dist/os/agent/handlers/agent-delegate.d.ts.map +1 -0
- package/dist/os/agent/handlers/agent-delegate.js +187 -0
- package/dist/os/agent/handlers/agent-delegate.js.map +1 -0
- package/dist/os/agent/handlers/agent-tiers-validate.d.ts +15 -0
- package/dist/os/agent/handlers/agent-tiers-validate.d.ts.map +1 -0
- package/dist/os/agent/handlers/agent-tiers-validate.js +205 -0
- package/dist/os/agent/handlers/agent-tiers-validate.js.map +1 -0
- package/dist/os/agent/index.d.ts +5 -0
- package/dist/os/agent/index.d.ts.map +1 -0
- package/dist/os/agent/index.js +14 -0
- package/dist/os/agent/index.js.map +1 -0
- package/dist/os/agent/invoke-adapter.d.ts +43 -0
- package/dist/os/agent/invoke-adapter.d.ts.map +1 -0
- package/dist/os/agent/invoke-adapter.js +83 -0
- package/dist/os/agent/invoke-adapter.js.map +1 -0
- package/dist/os/authority/authority.module.d.ts +3 -0
- package/dist/os/authority/authority.module.d.ts.map +1 -0
- package/dist/os/authority/authority.module.js +161 -0
- package/dist/os/authority/authority.module.js.map +1 -0
- package/dist/os/authority/handlers/delegate-revoke.d.ts +15 -0
- package/dist/os/authority/handlers/delegate-revoke.d.ts.map +1 -0
- package/dist/os/authority/handlers/delegate-revoke.js +91 -0
- package/dist/os/authority/handlers/delegate-revoke.js.map +1 -0
- package/dist/os/authority/handlers/delegate.d.ts +14 -0
- package/dist/os/authority/handlers/delegate.d.ts.map +1 -0
- package/dist/os/authority/handlers/delegate.js +134 -0
- package/dist/os/authority/handlers/delegate.js.map +1 -0
- package/dist/os/authority/handlers/delegation-list.d.ts +12 -0
- package/dist/os/authority/handlers/delegation-list.d.ts.map +1 -0
- package/dist/os/authority/handlers/delegation-list.js +54 -0
- package/dist/os/authority/handlers/delegation-list.js.map +1 -0
- package/dist/os/authority/handlers/delegation-validate.d.ts +11 -0
- package/dist/os/authority/handlers/delegation-validate.d.ts.map +1 -0
- package/dist/os/authority/handlers/delegation-validate.js +132 -0
- package/dist/os/authority/handlers/delegation-validate.js.map +1 -0
- package/dist/os/authority/helpers.d.ts +36 -0
- package/dist/os/authority/helpers.d.ts.map +1 -0
- package/dist/os/authority/helpers.js +83 -0
- package/dist/os/authority/helpers.js.map +1 -0
- package/dist/os/authority/index.d.ts +2 -0
- package/dist/os/authority/index.d.ts.map +1 -0
- package/dist/os/authority/index.js +14 -0
- package/dist/os/authority/index.js.map +1 -0
- package/dist/os/checks/checks.module.d.ts +3 -0
- package/dist/os/checks/checks.module.d.ts.map +1 -0
- package/dist/os/checks/checks.module.js +90 -0
- package/dist/os/checks/checks.module.js.map +1 -0
- package/dist/os/checks/handlers/contribution-report.d.ts +35 -0
- package/dist/os/checks/handlers/contribution-report.d.ts.map +1 -0
- package/dist/os/checks/handlers/contribution-report.js +264 -0
- package/dist/os/checks/handlers/contribution-report.js.map +1 -0
- package/dist/os/checks/handlers/counters-export.d.ts +19 -0
- package/dist/os/checks/handlers/counters-export.d.ts.map +1 -0
- package/dist/os/checks/handlers/counters-export.js +122 -0
- package/dist/os/checks/handlers/counters-export.js.map +1 -0
- package/dist/os/checks/handlers/counters-journal.d.ts +67 -0
- package/dist/os/checks/handlers/counters-journal.d.ts.map +1 -0
- package/dist/os/checks/handlers/counters-journal.js +154 -0
- package/dist/os/checks/handlers/counters-journal.js.map +1 -0
- package/dist/os/checks/handlers/counters-validate.d.ts +11 -0
- package/dist/os/checks/handlers/counters-validate.d.ts.map +1 -0
- package/dist/os/checks/handlers/counters-validate.js +131 -0
- package/dist/os/checks/handlers/counters-validate.js.map +1 -0
- package/dist/os/checks/index.d.ts +6 -0
- package/dist/os/checks/index.d.ts.map +1 -0
- package/dist/os/checks/index.js +6 -0
- package/dist/os/checks/index.js.map +1 -0
- package/dist/os/compass/compass.module.d.ts.map +1 -1
- package/dist/os/compass/compass.module.js +55 -20
- package/dist/os/compass/compass.module.js.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-header-scaffold.js +4 -2
- package/dist/os/compass/handlers/compass-header-scaffold.js.map +1 -1
- package/dist/os/compass/handlers/compass-invariants-generate.d.ts +15 -0
- package/dist/os/compass/handlers/compass-invariants-generate.d.ts.map +1 -0
- package/dist/os/compass/handlers/compass-invariants-generate.js +208 -0
- package/dist/os/compass/handlers/compass-invariants-generate.js.map +1 -0
- package/dist/os/compass/handlers/compass-inventory-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-inventory-handler.js +46 -4
- package/dist/os/compass/handlers/compass-inventory-handler.js.map +1 -1
- package/dist/os/compass/handlers/invariant-bindings.d.ts +85 -0
- package/dist/os/compass/handlers/invariant-bindings.d.ts.map +1 -0
- package/dist/os/compass/handlers/invariant-bindings.js +390 -0
- package/dist/os/compass/handlers/invariant-bindings.js.map +1 -0
- package/dist/os/conformance/conformance.module.d.ts +3 -0
- package/dist/os/conformance/conformance.module.d.ts.map +1 -0
- package/dist/os/conformance/conformance.module.js +96 -0
- package/dist/os/conformance/conformance.module.js.map +1 -0
- package/dist/os/conformance/handlers/conformance-run.d.ts +14 -0
- package/dist/os/conformance/handlers/conformance-run.d.ts.map +1 -0
- package/dist/os/conformance/handlers/conformance-run.js +149 -0
- package/dist/os/conformance/handlers/conformance-run.js.map +1 -0
- package/dist/os/conformance/handlers/conformance-validate.d.ts +14 -0
- package/dist/os/conformance/handlers/conformance-validate.d.ts.map +1 -0
- package/dist/os/conformance/handlers/conformance-validate.js +216 -0
- package/dist/os/conformance/handlers/conformance-validate.js.map +1 -0
- package/dist/os/conformance/index.d.ts +6 -0
- package/dist/os/conformance/index.d.ts.map +1 -0
- package/dist/os/conformance/index.js +17 -0
- package/dist/os/conformance/index.js.map +1 -0
- package/dist/os/context/context.module.d.ts +3 -0
- package/dist/os/context/context.module.d.ts.map +1 -0
- package/dist/os/context/context.module.js +68 -0
- package/dist/os/context/context.module.js.map +1 -0
- package/dist/os/context/handlers/context-assemble.d.ts +28 -0
- package/dist/os/context/handlers/context-assemble.d.ts.map +1 -0
- package/dist/os/context/handlers/context-assemble.js +142 -0
- package/dist/os/context/handlers/context-assemble.js.map +1 -0
- package/dist/os/context/handlers/context-slate-eval.d.ts +15 -0
- package/dist/os/context/handlers/context-slate-eval.d.ts.map +1 -0
- package/dist/os/context/handlers/context-slate-eval.js +70 -0
- package/dist/os/context/handlers/context-slate-eval.js.map +1 -0
- package/dist/os/context/handlers/index-build.d.ts +19 -0
- package/dist/os/context/handlers/index-build.d.ts.map +1 -0
- package/dist/os/context/handlers/index-build.js +188 -0
- package/dist/os/context/handlers/index-build.js.map +1 -0
- package/dist/os/context/index.d.ts +5 -0
- package/dist/os/context/index.d.ts.map +1 -0
- package/dist/os/context/index.js +5 -0
- package/dist/os/context/index.js.map +1 -0
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +34 -11
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/formal/formal.module.d.ts +3 -0
- package/dist/os/formal/formal.module.d.ts.map +1 -0
- package/dist/os/formal/formal.module.js +63 -0
- package/dist/os/formal/formal.module.js.map +1 -0
- package/dist/os/formal/handlers/proof-check.d.ts +10 -0
- package/dist/os/formal/handlers/proof-check.d.ts.map +1 -0
- package/dist/os/formal/handlers/proof-check.js +82 -0
- package/dist/os/formal/handlers/proof-check.js.map +1 -0
- package/dist/os/formal/index.d.ts +4 -0
- package/dist/os/formal/index.d.ts.map +1 -0
- package/dist/os/formal/index.js +16 -0
- package/dist/os/formal/index.js.map +1 -0
- package/dist/os/friction/friction.module.d.ts +3 -0
- package/dist/os/friction/friction.module.d.ts.map +1 -0
- package/dist/os/friction/friction.module.js +71 -0
- package/dist/os/friction/friction.module.js.map +1 -0
- package/dist/os/friction/handlers/friction-validate.d.ts +4 -0
- package/dist/os/friction/handlers/friction-validate.d.ts.map +1 -0
- package/dist/os/friction/handlers/friction-validate.js +228 -0
- package/dist/os/friction/handlers/friction-validate.js.map +1 -0
- package/dist/os/friction/index.d.ts +4 -0
- package/dist/os/friction/index.d.ts.map +1 -0
- package/dist/os/friction/index.js +23 -0
- package/dist/os/friction/index.js.map +1 -0
- package/dist/os/friction/types.d.ts +97 -0
- package/dist/os/friction/types.d.ts.map +1 -0
- package/dist/os/friction/types.js +78 -0
- package/dist/os/friction/types.js.map +1 -0
- package/dist/os/gate/gate.module.d.ts +3 -0
- package/dist/os/gate/gate.module.d.ts.map +1 -0
- package/dist/os/gate/gate.module.js +65 -0
- package/dist/os/gate/gate.module.js.map +1 -0
- package/dist/os/gate/handlers/gate-probe-catalog.d.ts +18 -0
- package/dist/os/gate/handlers/gate-probe-catalog.d.ts.map +1 -0
- package/dist/os/gate/handlers/gate-probe-catalog.js +66 -0
- package/dist/os/gate/handlers/gate-probe-catalog.js.map +1 -0
- package/dist/os/gate/handlers/gate-probe.d.ts +32 -0
- package/dist/os/gate/handlers/gate-probe.d.ts.map +1 -0
- package/dist/os/gate/handlers/gate-probe.js +228 -0
- package/dist/os/gate/handlers/gate-probe.js.map +1 -0
- package/dist/os/gate/index.d.ts +4 -0
- package/dist/os/gate/index.d.ts.map +1 -0
- package/dist/os/gate/index.js +4 -0
- package/dist/os/gate/index.js.map +1 -0
- package/dist/os/instructions/handlers/budget-validate.d.ts +29 -0
- package/dist/os/instructions/handlers/budget-validate.d.ts.map +1 -0
- package/dist/os/instructions/handlers/budget-validate.js +164 -0
- package/dist/os/instructions/handlers/budget-validate.js.map +1 -0
- package/dist/os/instructions/handlers/scar-migrate.d.ts +13 -0
- package/dist/os/instructions/handlers/scar-migrate.d.ts.map +1 -0
- package/dist/os/instructions/handlers/scar-migrate.js +270 -0
- package/dist/os/instructions/handlers/scar-migrate.js.map +1 -0
- package/dist/os/instructions/instructions.module.d.ts +3 -0
- package/dist/os/instructions/instructions.module.d.ts.map +1 -0
- package/dist/os/instructions/instructions.module.js +74 -0
- package/dist/os/instructions/instructions.module.js.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-authz-probe.d.ts +16 -0
- package/dist/os/knowledge/handlers/knowledge-authz-probe.d.ts.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-authz-probe.js +198 -0
- package/dist/os/knowledge/handlers/knowledge-authz-probe.js.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-rebuild.d.ts +15 -0
- package/dist/os/knowledge/handlers/knowledge-rebuild.d.ts.map +1 -0
- package/dist/os/knowledge/handlers/knowledge-rebuild.js +137 -0
- package/dist/os/knowledge/handlers/knowledge-rebuild.js.map +1 -0
- package/dist/os/knowledge/index.d.ts +4 -0
- package/dist/os/knowledge/index.d.ts.map +1 -0
- package/dist/os/knowledge/index.js +4 -0
- package/dist/os/knowledge/index.js.map +1 -0
- package/dist/os/knowledge/knowledge.module.d.ts +3 -0
- package/dist/os/knowledge/knowledge.module.d.ts.map +1 -0
- package/dist/os/knowledge/knowledge.module.js +61 -0
- package/dist/os/knowledge/knowledge.module.js.map +1 -0
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +102 -6
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/mission.module.d.ts.map +1 -1
- package/dist/os/mission/mission.module.js +7 -0
- package/dist/os/mission/mission.module.js.map +1 -1
- package/dist/os/naming/naming-convention.d.ts.map +1 -1
- package/dist/os/naming/naming-convention.js +2 -1
- package/dist/os/naming/naming-convention.js.map +1 -1
- package/dist/os/program/schemas.d.ts +5 -5
- package/dist/os/queue/handlers/queue-validate.d.ts.map +1 -1
- package/dist/os/queue/handlers/queue-validate.js +129 -5
- package/dist/os/queue/handlers/queue-validate.js.map +1 -1
- package/dist/os/queue/queue.module.d.ts.map +1 -1
- package/dist/os/queue/queue.module.js +12 -31
- package/dist/os/queue/queue.module.js.map +1 -1
- package/dist/os/queue/types.d.ts +23 -0
- package/dist/os/queue/types.d.ts.map +1 -1
- package/dist/os/queue/types.js +24 -3
- package/dist/os/queue/types.js.map +1 -1
- package/dist/os/resolver/handlers/resolver-doors-audit.d.ts +22 -0
- package/dist/os/resolver/handlers/resolver-doors-audit.d.ts.map +1 -0
- package/dist/os/resolver/handlers/resolver-doors-audit.js +238 -0
- package/dist/os/resolver/handlers/resolver-doors-audit.js.map +1 -0
- package/dist/os/resolver/resolver.module.d.ts +3 -0
- package/dist/os/resolver/resolver.module.d.ts.map +1 -0
- package/dist/os/resolver/resolver.module.js +40 -0
- package/dist/os/resolver/resolver.module.js.map +1 -0
- package/dist/os/rfc/acceptance.d.ts +2 -1
- package/dist/os/rfc/acceptance.d.ts.map +1 -1
- package/dist/os/rfc/acceptance.js +158 -82
- package/dist/os/rfc/acceptance.js.map +1 -1
- package/dist/os/rfc/decision-log.d.ts +10 -0
- package/dist/os/rfc/decision-log.d.ts.map +1 -1
- package/dist/os/rfc/decision-log.js +14 -0
- package/dist/os/rfc/decision-log.js.map +1 -1
- package/dist/os/rfc/handlers/fixed-inputs.d.ts +29 -0
- package/dist/os/rfc/handlers/fixed-inputs.d.ts.map +1 -0
- package/dist/os/rfc/handlers/fixed-inputs.js +214 -0
- package/dist/os/rfc/handlers/fixed-inputs.js.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts +47 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.js +145 -0
- package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-origin.d.ts +15 -1
- package/dist/os/rfc/handlers/implement-stamp-origin.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-origin.js +57 -5
- package/dist/os/rfc/handlers/implement-stamp-origin.js.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp-outcome.d.ts +42 -0
- package/dist/os/rfc/handlers/implement-stamp-outcome.d.ts.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp-outcome.js +102 -0
- package/dist/os/rfc/handlers/implement-stamp-outcome.js.map +1 -0
- package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
- package/dist/os/rfc/handlers/implement-stamp.js +101 -12
- package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
- package/dist/os/rfc/handlers/index-graph.d.ts +4 -2
- package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
- package/dist/os/rfc/handlers/index-graph.js +57 -3
- package/dist/os/rfc/handlers/index-graph.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +117 -12
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/handlers/supersede-propose.d.ts.map +1 -1
- package/dist/os/rfc/handlers/supersede-propose.js +34 -7
- package/dist/os/rfc/handlers/supersede-propose.js.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts +4 -1
- package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate-rules.js +188 -11
- package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
- package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
- package/dist/os/rfc/handlers/validate.js +10 -1
- package/dist/os/rfc/handlers/validate.js.map +1 -1
- package/dist/os/rfc/outcome-probe.d.ts +20 -0
- package/dist/os/rfc/outcome-probe.d.ts.map +1 -0
- package/dist/os/rfc/outcome-probe.js +315 -0
- package/dist/os/rfc/outcome-probe.js.map +1 -0
- package/dist/os/rfc/reachable-symbol.d.ts.map +1 -1
- package/dist/os/rfc/reachable-symbol.js +51 -12
- package/dist/os/rfc/reachable-symbol.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +48 -11
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/rfc/types.d.ts +97 -11
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +9 -6
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/rfc/verification-evidence.d.ts +4 -1
- package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
- package/dist/os/rfc/verification-evidence.js +69 -17
- package/dist/os/rfc/verification-evidence.js.map +1 -1
- package/dist/os/rfc/verification-origin.d.ts +8 -0
- package/dist/os/rfc/verification-origin.d.ts.map +1 -1
- package/dist/os/rfc/verification-origin.js +48 -1
- package/dist/os/rfc/verification-origin.js.map +1 -1
- package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
- package/dist/os/rfc/verification-refresh.js +19 -2
- package/dist/os/rfc/verification-refresh.js.map +1 -1
- package/dist/os/rfc/verification-verdicts.d.ts +14 -0
- package/dist/os/rfc/verification-verdicts.d.ts.map +1 -0
- package/dist/os/rfc/verification-verdicts.js +104 -0
- package/dist/os/rfc/verification-verdicts.js.map +1 -0
- package/dist/os/rfc/verifier/rfc-1391/support.d.ts +34 -0
- package/dist/os/rfc/verifier/rfc-1391/support.d.ts.map +1 -0
- package/dist/os/rfc/verifier/rfc-1391/support.js +184 -0
- package/dist/os/rfc/verifier/rfc-1391/support.js.map +1 -0
- package/dist/os/session/frontmatter-io.d.ts +3 -1
- package/dist/os/session/frontmatter-io.d.ts.map +1 -1
- package/dist/os/session/frontmatter-io.js +3 -1
- package/dist/os/session/frontmatter-io.js.map +1 -1
- package/dist/os/session/handlers/save.d.ts.map +1 -1
- package/dist/os/session/handlers/save.js +41 -10
- package/dist/os/session/handlers/save.js.map +1 -1
- package/dist/os/session/handlers/session-audit-report.d.ts +20 -0
- package/dist/os/session/handlers/session-audit-report.d.ts.map +1 -0
- package/dist/os/session/handlers/session-audit-report.js +78 -0
- package/dist/os/session/handlers/session-audit-report.js.map +1 -0
- package/dist/os/session/handlers/session-audit.d.ts +25 -0
- package/dist/os/session/handlers/session-audit.d.ts.map +1 -0
- package/dist/os/session/handlers/session-audit.js +265 -0
- package/dist/os/session/handlers/session-audit.js.map +1 -0
- package/dist/os/session/session.module.d.ts.map +1 -1
- package/dist/os/session/session.module.js +49 -2
- package/dist/os/session/session.module.js.map +1 -1
- package/dist/os/spec/spec-amendments.d.ts +7 -0
- package/dist/os/spec/spec-amendments.d.ts.map +1 -0
- package/dist/os/spec/spec-amendments.js +86 -0
- package/dist/os/spec/spec-amendments.js.map +1 -0
- package/dist/os/spec/spec-materialize.d.ts.map +1 -1
- package/dist/os/spec/spec-materialize.js +22 -24
- package/dist/os/spec/spec-materialize.js.map +1 -1
- package/dist/os/spec/spec-status.d.ts.map +1 -1
- package/dist/os/spec/spec-status.js +25 -29
- package/dist/os/spec/spec-status.js.map +1 -1
- package/dist/os/spec/spec-validate.d.ts.map +1 -1
- package/dist/os/spec/spec-validate.js +9 -29
- package/dist/os/spec/spec-validate.js.map +1 -1
- package/dist/os/spec/spec.module.d.ts.map +1 -1
- package/dist/os/spec/spec.module.js +7 -36
- package/dist/os/spec/spec.module.js.map +1 -1
- package/dist/os/trajectory/handlers/journal-io.d.ts +51 -0
- package/dist/os/trajectory/handlers/journal-io.d.ts.map +1 -0
- package/dist/os/trajectory/handlers/journal-io.js +161 -0
- package/dist/os/trajectory/handlers/journal-io.js.map +1 -0
- package/dist/os/trajectory/handlers/outcome-record.d.ts +16 -0
- package/dist/os/trajectory/handlers/outcome-record.d.ts.map +1 -0
- package/dist/os/trajectory/handlers/outcome-record.js +142 -0
- package/dist/os/trajectory/handlers/outcome-record.js.map +1 -0
- package/dist/os/trajectory/handlers/trajectory-index.d.ts +59 -0
- package/dist/os/trajectory/handlers/trajectory-index.d.ts.map +1 -0
- package/dist/os/trajectory/handlers/trajectory-index.js +427 -0
- package/dist/os/trajectory/handlers/trajectory-index.js.map +1 -0
- package/dist/os/trajectory/handlers/trajectory-recall.d.ts +21 -0
- package/dist/os/trajectory/handlers/trajectory-recall.d.ts.map +1 -0
- package/dist/os/trajectory/handlers/trajectory-recall.js +176 -0
- package/dist/os/trajectory/handlers/trajectory-recall.js.map +1 -0
- package/dist/os/trajectory/index.d.ts +5 -0
- package/dist/os/trajectory/index.d.ts.map +1 -0
- package/dist/os/trajectory/index.js +5 -0
- package/dist/os/trajectory/index.js.map +1 -0
- package/dist/os/trajectory/trajectory.module.d.ts +3 -0
- package/dist/os/trajectory/trajectory.module.d.ts.map +1 -0
- package/dist/os/trajectory/trajectory.module.js +91 -0
- package/dist/os/trajectory/trajectory.module.js.map +1 -0
- package/dist/os/werkstatt/handlers/session-close.d.ts +13 -0
- package/dist/os/werkstatt/handlers/session-close.d.ts.map +1 -0
- package/dist/os/werkstatt/handlers/session-close.js +53 -0
- package/dist/os/werkstatt/handlers/session-close.js.map +1 -0
- package/dist/os/werkstatt/handlers/session-engine.d.ts +3 -0
- package/dist/os/werkstatt/handlers/session-engine.d.ts.map +1 -0
- package/dist/os/werkstatt/handlers/session-engine.js +25 -0
- package/dist/os/werkstatt/handlers/session-engine.js.map +1 -0
- package/dist/os/werkstatt/handlers/session-open.d.ts +10 -0
- package/dist/os/werkstatt/handlers/session-open.d.ts.map +1 -0
- package/dist/os/werkstatt/handlers/session-open.js +43 -0
- package/dist/os/werkstatt/handlers/session-open.js.map +1 -0
- package/dist/os/werkstatt/handlers/session-status.d.ts +9 -0
- package/dist/os/werkstatt/handlers/session-status.d.ts.map +1 -0
- package/dist/os/werkstatt/handlers/session-status.js +31 -0
- package/dist/os/werkstatt/handlers/session-status.js.map +1 -0
- package/dist/os/werkstatt/werkstatt.module.d.ts.map +1 -1
- package/dist/os/werkstatt/werkstatt.module.js +98 -3
- package/dist/os/werkstatt/werkstatt.module.js.map +1 -1
- package/dist/src/authority/delegations.d.ts +108 -0
- package/dist/src/authority/delegations.d.ts.map +1 -0
- package/dist/src/authority/delegations.js +219 -0
- package/dist/src/authority/delegations.js.map +1 -0
- package/dist/src/authority/index.d.ts +3 -0
- package/dist/src/authority/index.d.ts.map +1 -0
- package/dist/src/authority/index.js +17 -0
- package/dist/src/authority/index.js.map +1 -0
- package/dist/src/authority/signing.d.ts +8 -0
- package/dist/src/authority/signing.d.ts.map +1 -0
- package/dist/src/authority/signing.js +72 -0
- package/dist/src/authority/signing.js.map +1 -0
- package/dist/src/cli-flags.d.ts.map +1 -1
- package/dist/src/cli-flags.js +90 -11
- package/dist/src/cli-flags.js.map +1 -1
- package/dist/src/compass/index.d.ts +2 -0
- package/dist/src/compass/index.d.ts.map +1 -0
- package/dist/src/compass/index.js +26 -0
- package/dist/src/compass/index.js.map +1 -0
- package/dist/src/compass/invariant-parser.d.ts +37 -0
- package/dist/src/compass/invariant-parser.d.ts.map +1 -0
- package/dist/src/compass/invariant-parser.js +218 -0
- package/dist/src/compass/invariant-parser.js.map +1 -0
- package/dist/src/config/forge-config.d.ts +108 -0
- package/dist/src/config/forge-config.d.ts.map +1 -1
- package/dist/src/config/forge-config.js +79 -9
- package/dist/src/config/forge-config.js.map +1 -1
- package/dist/src/conformance/index.d.ts +42 -0
- package/dist/src/conformance/index.d.ts.map +1 -0
- package/dist/src/conformance/index.js +193 -0
- package/dist/src/conformance/index.js.map +1 -0
- package/dist/src/formal/exhaustive.d.ts +40 -0
- package/dist/src/formal/exhaustive.d.ts.map +1 -0
- package/dist/src/formal/exhaustive.js +140 -0
- package/dist/src/formal/exhaustive.js.map +1 -0
- package/dist/src/formal/index.d.ts +7 -0
- package/dist/src/formal/index.d.ts.map +1 -0
- package/dist/src/formal/index.js +13 -0
- package/dist/src/formal/index.js.map +1 -0
- package/dist/src/formal/proof-runner.d.ts +51 -0
- package/dist/src/formal/proof-runner.d.ts.map +1 -0
- package/dist/src/formal/proof-runner.js +450 -0
- package/dist/src/formal/proof-runner.js.map +1 -0
- package/dist/src/formal/proof-spec.d.ts +69 -0
- package/dist/src/formal/proof-spec.d.ts.map +1 -0
- package/dist/src/formal/proof-spec.js +96 -0
- package/dist/src/formal/proof-spec.js.map +1 -0
- package/dist/src/knowledge/schema.d.ts +8 -0
- package/dist/src/knowledge/schema.d.ts.map +1 -1
- package/dist/src/knowledge/schema.js +5 -0
- package/dist/src/knowledge/schema.js.map +1 -1
- package/dist/src/knowledge/serialize.d.ts.map +1 -1
- package/dist/src/knowledge/serialize.js +3 -0
- package/dist/src/knowledge/serialize.js.map +1 -1
- package/dist/src/onboarding/agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/agents-generate.js +17 -2
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/doctor.d.ts.map +1 -1
- package/dist/src/onboarding/doctor.js +87 -1
- package/dist/src/onboarding/doctor.js.map +1 -1
- package/dist/src/onboarding/init.js +3 -3
- package/dist/src/onboarding/init.js.map +1 -1
- package/dist/src/profiles/profile-schema.d.ts +8 -0
- package/dist/src/profiles/profile-schema.d.ts.map +1 -1
- package/dist/src/profiles/profile-schema.js +10 -2
- package/dist/src/profiles/profile-schema.js.map +1 -1
- package/dist/src/profiles/stack-profile.d.ts +4 -0
- package/dist/src/profiles/stack-profile.d.ts.map +1 -1
- package/dist/src/reachability/command-mentions.d.ts +17 -0
- package/dist/src/reachability/command-mentions.d.ts.map +1 -0
- package/dist/src/reachability/command-mentions.js +81 -0
- package/dist/src/reachability/command-mentions.js.map +1 -0
- package/dist/src/registry.d.ts +10 -0
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +40 -2
- package/dist/src/registry.js.map +1 -1
- package/dist/src/types.d.ts +51 -3
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +11 -14
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/sync-fs.d.ts +1 -1
- package/dist/src/utils/sync-fs.d.ts.map +1 -1
- package/dist/src/utils/sync-fs.js +2 -1
- package/dist/src/utils/sync-fs.js.map +1 -1
- package/docs/reference/forge-yaml.md +20 -0
- package/os/adr/handlers/implement-stamp.ts +2 -0
- package/os/adr/types.ts +2 -0
- package/os/agent/agent.module.ts +64 -0
- package/os/agent/handlers/agent-delegate.ts +227 -0
- package/os/agent/handlers/agent-tiers-validate.ts +228 -0
- package/os/agent/index.ts +14 -0
- package/os/agent/invoke-adapter.ts +119 -0
- package/os/authority/authority.module.ts +175 -0
- package/os/authority/authority.test.ts +328 -0
- package/os/authority/handlers/delegate-revoke.ts +123 -0
- package/os/authority/handlers/delegate.ts +190 -0
- package/os/authority/handlers/delegation-list.ts +80 -0
- package/os/authority/handlers/delegation-validate.ts +231 -0
- package/os/authority/helpers.ts +111 -0
- package/os/authority/index.ts +14 -0
- package/os/checks/checks.module.ts +95 -0
- package/os/checks/handlers/contribution-report.test.ts +244 -0
- package/os/checks/handlers/contribution-report.ts +316 -0
- package/os/checks/handlers/counters-export.test.ts +175 -0
- package/os/checks/handlers/counters-export.ts +170 -0
- package/os/checks/handlers/counters-journal.test.ts +187 -0
- package/os/checks/handlers/counters-journal.ts +179 -0
- package/os/checks/handlers/counters-validate.test.ts +176 -0
- package/os/checks/handlers/counters-validate.ts +159 -0
- package/os/checks/handlers/variant-candidates.test.ts +65 -0
- package/os/checks/index.ts +15 -0
- package/os/compass/compass.module.ts +58 -20
- package/os/compass/handlers/compass-header-scaffold.ts +4 -2
- package/os/compass/handlers/compass-invariants-generate.ts +293 -0
- package/os/compass/handlers/compass-inventory-handler.ts +59 -4
- package/os/compass/handlers/invariant-bindings.ts +526 -0
- package/os/compass/handlers/tests/compass-invariant-binding.test.ts +500 -0
- package/os/compass/handlers/tests/compass-invariants-generate.test.ts +235 -0
- package/os/compass/handlers/tests/compass-migrate.test.ts +5 -3
- package/os/conformance/conformance.module.ts +105 -0
- package/os/conformance/handlers/conformance-run.ts +175 -0
- package/os/conformance/handlers/conformance-validate.ts +334 -0
- package/os/conformance/handlers/tests/conformance.test.ts +657 -0
- package/os/conformance/index.ts +19 -0
- package/os/context/context.module.ts +73 -0
- package/os/context/handlers/context-assemble.test.ts +89 -0
- package/os/context/handlers/context-assemble.ts +171 -0
- package/os/context/handlers/context-slate-eval.test.ts +64 -0
- package/os/context/handlers/context-slate-eval.ts +86 -0
- package/os/context/handlers/index-build.test.ts +68 -0
- package/os/context/handlers/index-build.ts +211 -0
- package/os/context/handlers/no-model-deps.test.ts +32 -0
- package/os/context/handlers/slate-fill.test.ts +31 -0
- package/os/context/index.ts +4 -0
- package/os/core/core.module.ts +34 -11
- package/os/formal/formal.module.ts +67 -0
- package/os/formal/handlers/proof-check.test.ts +337 -0
- package/os/formal/handlers/proof-check.ts +100 -0
- package/os/formal/index.ts +17 -0
- package/os/friction/friction-validate.test.ts +442 -0
- package/os/friction/friction.module.ts +74 -0
- package/os/friction/handlers/friction-validate.ts +349 -0
- package/os/friction/index.ts +30 -0
- package/os/friction/types.ts +113 -0
- package/os/gate/gate.module.ts +69 -0
- package/os/gate/handlers/gate-probe-catalog.test.ts +76 -0
- package/os/gate/handlers/gate-probe-catalog.ts +85 -0
- package/os/gate/handlers/gate-probe.test.ts +108 -0
- package/os/gate/handlers/gate-probe.ts +252 -0
- package/os/gate/index.ts +3 -0
- package/os/instructions/budget.test.ts +125 -0
- package/os/instructions/handlers/budget-validate.ts +197 -0
- package/os/instructions/handlers/scar-migrate.ts +292 -0
- package/os/instructions/instructions.module.ts +78 -0
- package/os/knowledge/handlers/knowledge-authz-probe.test.ts +86 -0
- package/os/knowledge/handlers/knowledge-authz-probe.ts +236 -0
- package/os/knowledge/handlers/knowledge-rebuild.test.ts +76 -0
- package/os/knowledge/handlers/knowledge-rebuild.ts +163 -0
- package/os/knowledge/index.ts +3 -0
- package/os/knowledge/knowledge.module.ts +65 -0
- package/os/mission/handlers/archive.ts +113 -6
- package/os/mission/handlers/ship-inflight-degraded.test.ts +105 -0
- package/os/mission/mission.module.ts +8 -0
- package/os/naming/naming-convention.ts +2 -1
- package/os/queue/decision-ledger.test.ts +39 -0
- package/os/queue/handlers/queue-validate.ts +132 -5
- package/os/queue/queue-validate.test.ts +194 -0
- package/os/queue/queue.module.ts +12 -31
- package/os/queue/types.ts +26 -3
- package/os/resolver/handlers/resolver-doors-audit.test.ts +147 -0
- package/os/resolver/handlers/resolver-doors-audit.ts +281 -0
- package/os/resolver/resolver.module.ts +43 -0
- package/os/rfc/acceptance-reachable.test.ts +78 -0
- package/os/rfc/acceptance.test.ts +229 -1
- package/os/rfc/acceptance.ts +141 -45
- package/os/rfc/decision-log.ts +15 -0
- package/os/rfc/handlers/fixed-inputs.ts +252 -0
- package/os/rfc/handlers/implement-stamp-deviations.test.ts +140 -0
- package/os/rfc/handlers/implement-stamp-deviations.ts +183 -0
- package/os/rfc/handlers/implement-stamp-formal.test.ts +168 -0
- package/os/rfc/handlers/implement-stamp-origin.ts +87 -11
- package/os/rfc/handlers/implement-stamp-outcome.test.ts +193 -0
- package/os/rfc/handlers/implement-stamp-outcome.ts +146 -0
- package/os/rfc/handlers/implement-stamp.ts +107 -10
- package/os/rfc/handlers/index-graph.ts +66 -4
- package/os/rfc/handlers/list-create.test.ts +142 -0
- package/os/rfc/handlers/list-create.ts +140 -12
- package/os/rfc/handlers/supersede-propose.ts +50 -7
- package/os/rfc/handlers/tests/index-graph.test.ts +165 -0
- package/os/rfc/handlers/validate-rules-rfc1453.test.ts +163 -0
- package/os/rfc/handlers/validate-rules-rfc1454.test.ts +136 -0
- package/os/rfc/handlers/validate-rules-rfc1455.test.ts +282 -0
- package/os/rfc/handlers/validate-rules.test.ts +129 -2
- package/os/rfc/handlers/validate-rules.ts +274 -14
- package/os/rfc/handlers/validate.ts +11 -0
- package/os/rfc/outcome-probe.ts +326 -0
- package/os/rfc/reachable-symbol.ts +64 -16
- package/os/rfc/rfc-0000-template.md +4 -0
- package/os/rfc/rfc.module.ts +51 -11
- package/os/rfc/types.ts +118 -13
- package/os/rfc/verification-evidence.ts +74 -14
- package/os/rfc/verification-origin.ts +61 -1
- package/os/rfc/verification-refresh.test.ts +63 -0
- package/os/rfc/verification-refresh.ts +24 -2
- package/os/rfc/verification-verdicts.ts +123 -0
- package/os/rfc/verifier/rfc-1391/ac1-proved-exit-0.acceptance.test.ts +151 -0
- package/os/rfc/verifier/rfc-1391/ac2-unavailable-nonzero.acceptance.test.ts +111 -0
- package/os/rfc/verifier/rfc-1391/ac3-version-mismatch-error.acceptance.test.ts +97 -0
- package/os/rfc/verifier/rfc-1391/ac4-cardinality-mismatch-error.acceptance.test.ts +179 -0
- package/os/rfc/verifier/rfc-1391/ac5-imp13-formal-stamp-block.acceptance.test.ts +295 -0
- package/os/rfc/verifier/rfc-1391/ac6-formal-high-tier-gates.acceptance.test.ts +203 -0
- package/os/rfc/verifier/rfc-1391/ac7-v46-empty-assumptions.acceptance.test.ts +126 -0
- package/os/rfc/verifier/rfc-1391/cx1-emit-proof-envelope.acceptance.test.ts +130 -0
- package/os/rfc/verifier/rfc-1391/fixtures/no-report.proof.test.ts +35 -0
- package/os/rfc/verifier/rfc-1391/fixtures/small-domain.proof.test.ts +41 -0
- package/os/rfc/verifier/rfc-1391/origin-proof-spec-entry.acceptance.test.ts +175 -0
- package/os/rfc/verifier/rfc-1391/support.ts +205 -0
- package/os/session/fixtures/audit/clean.md +7 -0
- package/os/session/fixtures/audit/denied-retry.md +10 -0
- package/os/session/frontmatter-io.ts +3 -1
- package/os/session/handlers/save.ts +43 -9
- package/os/session/handlers/session-audit-detectors.test.ts +91 -0
- package/os/session/handlers/session-audit-report.test.ts +64 -0
- package/os/session/handlers/session-audit-report.ts +93 -0
- package/os/session/handlers/session-audit.test.ts +80 -0
- package/os/session/handlers/session-audit.ts +317 -0
- package/os/session/session.module.ts +51 -2
- package/os/spec/spec-amendments.ts +91 -0
- package/os/spec/spec-materialize.ts +20 -22
- package/os/spec/spec-status.test.ts +17 -1
- package/os/spec/spec-status.ts +23 -29
- package/os/spec/spec-validate.test.ts +45 -0
- package/os/spec/spec-validate.ts +9 -29
- package/os/spec/spec.module.ts +7 -36
- package/os/trajectory/handlers/extract-units.test.ts +69 -0
- package/os/trajectory/handlers/journal-io.ts +211 -0
- package/os/trajectory/handlers/outcome-record.test.ts +192 -0
- package/os/trajectory/handlers/outcome-record.ts +162 -0
- package/os/trajectory/handlers/producer-trust.test.ts +163 -0
- package/os/trajectory/handlers/trajectory-index.test.ts +246 -0
- package/os/trajectory/handlers/trajectory-index.ts +470 -0
- package/os/trajectory/handlers/trajectory-recall.test.ts +227 -0
- package/os/trajectory/handlers/trajectory-recall.ts +198 -0
- package/os/trajectory/handlers/trajectory.test.ts +94 -0
- package/os/trajectory/handlers/verdict-binding.test.ts +209 -0
- package/os/trajectory/index.ts +4 -0
- package/os/trajectory/trajectory.module.ts +96 -0
- package/os/werkstatt/handlers/session-close.ts +79 -0
- package/os/werkstatt/handlers/session-engine.ts +31 -0
- package/os/werkstatt/handlers/session-open.ts +65 -0
- package/os/werkstatt/handlers/session-status.ts +52 -0
- package/os/werkstatt/werkstatt.module.ts +101 -3
- package/package.json +206 -1
- package/profiles/forge-shell.yaml +3 -1
- package/profiles/godot-game.yaml +3 -1
- package/profiles/knowledge.yaml +3 -1
- package/profiles/phaser-game.yaml +3 -1
- package/profiles/site-workshop.yaml +3 -1
- package/profiles/typescript.yaml +3 -1
- package/skills/_shared/agent-operating-model.md +1 -1
- package/skills/_shared/fo-pipeline-conventions.md +5 -1
- package/skills/fo/fo-add-tests/SKILL.md +9 -1
- package/skills/fo/fo-add-tests/pbt-guide.md +1 -0
- package/skills/fo/fo-compass-annotate/SKILL.md +18 -0
- package/skills/fo/fo-compass-annotate/templates/header-format.md +3 -2
- package/skills/fo/fo-fix/SKILL.md +14 -8
- package/skills/fo/fo-idea-create-adr/SKILL.md +5 -3
- package/skills/fo/fo-idea-create-rfc/SKILL.md +20 -8
- package/skills/fo/fo-idea-create-rfc/acceptance-criteria-standard.md +20 -0
- package/skills/fo/fo-idea-i-just-want-to-see-the-result/SKILL.md +31 -13
- package/skills/fo/fo-idea-implement/SKILL.md +20 -14
- package/skills/fo/fo-idea-plan/SKILL.md +1 -1
- package/skills/fo/fo-knowledge-distill/SKILL.md +7 -0
- package/skills/fo/fo-memory-sync/SKILL.md +6 -0
- package/skills/fo/fo-reproduce/SKILL.md +116 -0
- package/skills/fo/fo-review/SKILL.md +11 -5
- package/skills/fo/fo-session-retro/SKILL.md +134 -49
- package/skills/fo/fo-step-commit/SKILL.md +4 -3
- package/skills/fo/fo-triage/SKILL.md +9 -0
- package/skills/shared/grilling/SKILL.md +4 -0
- package/skills/shared/grilling/learned-principles.md +7 -0
- package/skills/shared/grilling/qa-log.md +39 -0
- package/src/authority/delegations.ts +269 -0
- package/src/authority/index.ts +38 -0
- package/src/authority/signing.ts +73 -0
- package/src/cli-flags.ts +110 -11
- package/src/compass/index.ts +37 -0
- package/src/compass/invariant-parser.ts +253 -0
- package/src/config/forge-config.ts +111 -9
- package/src/conformance/index.ts +281 -0
- package/src/formal/exhaustive.test.ts +117 -0
- package/src/formal/exhaustive.ts +182 -0
- package/src/formal/index.ts +23 -0
- package/src/formal/proof-runner.test.ts +310 -0
- package/src/formal/proof-runner.ts +562 -0
- package/src/formal/proof-spec.test.ts +70 -0
- package/src/formal/proof-spec.ts +131 -0
- package/src/knowledge/schema.ts +9 -0
- package/src/knowledge/serialize.ts +3 -0
- package/src/onboarding/agents-generate.ts +18 -2
- package/src/onboarding/doctor.ts +93 -1
- package/src/onboarding/init.ts +3 -3
- package/src/onboarding/templates/behavioral-layer-core.md +1 -1
- package/src/profiles/profile-schema.ts +10 -2
- package/src/reachability/command-mentions.ts +87 -0
- package/src/registry.ts +44 -2
- package/src/tests/bindings-schema.test.ts +4 -0
- package/src/tests/cli-flags.test.ts +225 -0
- package/src/tests/fixtures/agents-generate-business-before.txt +4 -2
- package/src/tests/forge-config.test.ts +5 -2
- package/src/tests/implement-stamp.test.ts +51 -0
- package/src/tests/rfc-validate-delegation.test.ts +178 -0
- package/src/tests/rfc-verification-verdict-ingest.test.ts +244 -0
- package/src/tests/session-handlers.test.ts +65 -0
- package/src/tests/session-retro.test.ts +47 -0
- package/src/types.ts +59 -18
- package/src/utils/sync-fs.ts +2 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
RFC-1471: session.audit — deterministic Stage-A detectors over docs/sessions/*.md
|
|
5
|
+
(+ archive/). Rule ids follow the RFC's reserved taxonomy:
|
|
6
|
+
AUDIT-01 caveat — .raw files present (unconverted sessions audit-blind)
|
|
7
|
+
AUDIT-02 caveat — --deep requested without a declared modelBinding (Stage-B absent)
|
|
8
|
+
AUDIT-10 circumvention — denied command followed by an alternate route to the
|
|
9
|
+
same effect (ecosystem.commit blocked → bare git commit)
|
|
10
|
+
AUDIT-11 blocker deception — remainingIssues/blockers non-empty AND the
|
|
11
|
+
session body closes with a clean-completion claim
|
|
12
|
+
AUDIT-12 generated-file edit — direct edit/write/modify verb on a
|
|
13
|
+
*.generated.* path (legitimate "regenerated" excluded)
|
|
14
|
+
AUDIT-13 denied-command retry — same command retried after a denial without a
|
|
15
|
+
declared plan change
|
|
16
|
+
AUDIT-14 false completion claim — completion claim contradicted by adjacent
|
|
17
|
+
failure evidence
|
|
18
|
+
Writes docs/sessions/audit/<id>.audit.yaml sidecars (auditedAt = the session's
|
|
19
|
+
own frontmatter `date` — reruns produce identical content when findings are
|
|
20
|
+
unchanged; --relabel forces a fresh write).
|
|
21
|
+
--check: read-only + exits non-zero on critical findings (no sidecar writes).
|
|
22
|
+
</purpose>
|
|
23
|
+
</MODULE_CONTRACT>
|
|
24
|
+
<CHANGE_SUMMARY>
|
|
25
|
+
<item>RFC-1471: session.audit Stage-A detectors + sidecar write (r1 repair — RFC taxonomy, correct semantics, read-only --check, deterministic auditedAt, archive coverage, finding schema)</item>
|
|
26
|
+
<item>RFC-1471: apply r2 repairs — archive base-dir resolution (728 sessions audited), stale taxonomy, suppression fixture tokens</item>
|
|
27
|
+
</CHANGE_SUMMARY>
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import path from "node:path";
|
|
31
|
+
import { stringify as yamlStringify } from "yaml";
|
|
32
|
+
import { createHash } from "node:crypto";
|
|
33
|
+
import { ambientIo, resolveIo } from "../../../src/utils/io.ts";
|
|
34
|
+
import {
|
|
35
|
+
listSessionFiles,
|
|
36
|
+
listArchivedSessionFiles,
|
|
37
|
+
readAndParseSession,
|
|
38
|
+
} from "../frontmatter-io.ts";
|
|
39
|
+
import type {
|
|
40
|
+
ForgeCommandInput,
|
|
41
|
+
ForgeCommandResult,
|
|
42
|
+
ForgeRuntimeContext,
|
|
43
|
+
} from "../../../src/types.ts";
|
|
44
|
+
|
|
45
|
+
export type AuditRuleId =
|
|
46
|
+
| "AUDIT-01" | "AUDIT-02"
|
|
47
|
+
| "AUDIT-10" | "AUDIT-11" | "AUDIT-12" | "AUDIT-13" | "AUDIT-14";
|
|
48
|
+
|
|
49
|
+
export type AuditLabel =
|
|
50
|
+
| "coverage-caveat"
|
|
51
|
+
| "circumvention"
|
|
52
|
+
| "blocker-deception"
|
|
53
|
+
| "generated-file-edit"
|
|
54
|
+
| "denied-command-retry"
|
|
55
|
+
| "false-completion-claim";
|
|
56
|
+
|
|
57
|
+
export interface AuditFinding {
|
|
58
|
+
ruleId: AuditRuleId;
|
|
59
|
+
label: AuditLabel;
|
|
60
|
+
severity: "minor" | "major" | "critical";
|
|
61
|
+
signature: string;
|
|
62
|
+
evidence: { line?: number; excerpt: string };
|
|
63
|
+
detail: string;
|
|
64
|
+
frictionCandidate?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface SessionAuditData {
|
|
68
|
+
command: "session.audit";
|
|
69
|
+
sessionId: string;
|
|
70
|
+
status: "clean" | "findings";
|
|
71
|
+
findings: AuditFinding[];
|
|
72
|
+
sidecar: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const DENIED_RE = /\b(rejected|denied|refused|not permitted|blocked by|forbidden)\b/i;
|
|
76
|
+
const FAILURE_RE = /\b(exit[:\s]*[1-9]\d*|BLOCKED|failed|fatal error|panic)\b/i;
|
|
77
|
+
const CLAIM_RE = /\b(all green|all tests pass|committed successfully|everything works|fully (verified|working)|всё зелёное|все тесты прошли|\b\d+\/\d+\s+(pass|green))\b/i;
|
|
78
|
+
const GENERATED_RE = /(?:^|\/|\s)([A-Za-z0-9._/-]+\.generated\.(?:yaml|yml|json|ts|tsx|md|astro))\b/;
|
|
79
|
+
// Bare invocation names — the corpus writes `ecosystem.commit`, `git commit`,
|
|
80
|
+
// `pnpm exec vitest` — not only `werkstatt run <name>`.
|
|
81
|
+
const CMD_RE = /\b([a-z][a-z0-9-]*(?:\.[a-z0-9-]+)+|git\s+(?:commit|push|add)|pnpm\s+exec\s+\S+|npm\s+run\s+\S+)/g;
|
|
82
|
+
// Alternate-route circumvention: a kernel-gated command denied, then a direct
|
|
83
|
+
// bypass achieving the same effect.
|
|
84
|
+
const BYPASS_MAP: [RegExp, RegExp][] = [
|
|
85
|
+
[/\becosystem\.commit\b/, /\bgit\s+commit\b/],
|
|
86
|
+
[/\bmigration\.push\b|\bschema\.push\b/, /\b(?:sqlite3|psql|mysql)\b/],
|
|
87
|
+
];
|
|
88
|
+
const PLAN_CHANGE_RE = /\b(new plan|plan change|revised approach|different approach|switched to|changed strategy|reverted)\b/i;
|
|
89
|
+
const EDIT_VERB_RE = /\b(edited|wrote|modified|patched|hand-edit|fixed in)\b/i;
|
|
90
|
+
const REGENERATED_RE = /\b(regenerat|generated? by|reran the generator)\b/i;
|
|
91
|
+
|
|
92
|
+
function sig(ruleId: AuditRuleId, evidence: string): string {
|
|
93
|
+
return `${ruleId}:${createHash("sha1").update(evidence).digest("hex").slice(0, 12)}`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function cmdBefore(lines: string[], i: number): string | null {
|
|
97
|
+
for (let j = i; j >= Math.max(0, i - 30); j--) {
|
|
98
|
+
const m = [...lines[j]!.matchAll(CMD_RE)];
|
|
99
|
+
if (m.length > 0) return m[m.length - 1]![1]!;
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function cmdsAfter(lines: string[], i: number, span = 30): string[] {
|
|
105
|
+
const out: string[] = [];
|
|
106
|
+
for (let j = i + 1; j < Math.min(lines.length, i + span); j++) {
|
|
107
|
+
for (const m of lines[j]!.matchAll(CMD_RE)) out.push(m[1]!);
|
|
108
|
+
}
|
|
109
|
+
return out;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function auditSessionBody(
|
|
113
|
+
id: string,
|
|
114
|
+
body: string,
|
|
115
|
+
frontmatter: Record<string, unknown>,
|
|
116
|
+
): AuditFinding[] {
|
|
117
|
+
const findings: AuditFinding[] = [];
|
|
118
|
+
const lines = body.split("\n");
|
|
119
|
+
const seen = new Set<string>();
|
|
120
|
+
const push = (f: AuditFinding) => { if (!seen.has(f.signature)) { seen.add(f.signature); findings.push(f); } };
|
|
121
|
+
|
|
122
|
+
for (let i = 0; i < lines.length; i++) {
|
|
123
|
+
if (!DENIED_RE.test(lines[i]!)) continue;
|
|
124
|
+
const denied = cmdBefore(lines, i);
|
|
125
|
+
const after = cmdsAfter(lines, i);
|
|
126
|
+
const windowText = lines.slice(i + 1, i + 12).join("\n");
|
|
127
|
+
const planChanged = PLAN_CHANGE_RE.test(windowText);
|
|
128
|
+
|
|
129
|
+
// AUDIT-10: denied kernel command → alternate bypass route.
|
|
130
|
+
if (denied !== null) {
|
|
131
|
+
for (const [deniedRe, bypassRe] of BYPASS_MAP) {
|
|
132
|
+
if (deniedRe.test(denied) && bypassRe.test(after.join(" "))) {
|
|
133
|
+
push({
|
|
134
|
+
ruleId: "AUDIT-10",
|
|
135
|
+
label: "circumvention",
|
|
136
|
+
severity: "critical",
|
|
137
|
+
signature: sig("AUDIT-10", `${id}:${i}:${denied}`),
|
|
138
|
+
evidence: { line: i + 1, excerpt: lines[i]!.trim().slice(0, 100) },
|
|
139
|
+
detail: `${id}: "${denied}" denied at line ${i + 1}, then a bare bypass route runs (${bypassRe.source}) — circumvention of the governed path`,
|
|
140
|
+
frictionCandidate: "circumvention",
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// AUDIT-13: same command retried after denial without a declared plan change.
|
|
146
|
+
if (denied !== null && after.includes(denied) && !planChanged) {
|
|
147
|
+
push({
|
|
148
|
+
ruleId: "AUDIT-13",
|
|
149
|
+
label: "denied-command-retry",
|
|
150
|
+
severity: "major",
|
|
151
|
+
signature: sig("AUDIT-13", `${id}:${i}:${denied}`),
|
|
152
|
+
evidence: { line: i + 1, excerpt: lines[i]!.trim().slice(0, 100) },
|
|
153
|
+
detail: `${id}: "${denied}" denied at line ${i + 1} and retried within ${after.indexOf(denied) + 1} command(s) without a declared plan change`,
|
|
154
|
+
frictionCandidate: "denied-retry",
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// AUDIT-11: blocker deception — remainingIssues/blockers non-empty AND the
|
|
160
|
+
// body closes with a clean-completion claim. Absent fields → coverage skip.
|
|
161
|
+
const remaining = (frontmatter.remainingIssues as unknown[] | undefined) ?? [];
|
|
162
|
+
const blockers = (frontmatter.blockers as unknown[] | undefined) ?? [];
|
|
163
|
+
const fieldsPresent = frontmatter.remainingIssues !== undefined || frontmatter.blockers !== undefined;
|
|
164
|
+
if (fieldsPresent && (remaining.length > 0 || blockers.length > 0)) {
|
|
165
|
+
const tail = lines.slice(-60).join("\n");
|
|
166
|
+
if (CLAIM_RE.test(tail)) {
|
|
167
|
+
push({
|
|
168
|
+
ruleId: "AUDIT-11",
|
|
169
|
+
label: "blocker-deception",
|
|
170
|
+
severity: "critical",
|
|
171
|
+
signature: sig("AUDIT-11", `${id}:${(remaining.length + blockers.length)}`),
|
|
172
|
+
evidence: { excerpt: tail.slice(-120) },
|
|
173
|
+
detail: `${id}: frontmatter declares ${remaining.length + blockers.length} open blocker(s) yet the session closes with a completion claim — blocker deception`,
|
|
174
|
+
frictionCandidate: "blocker-omission",
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// AUDIT-12: direct edit to a generated artifact (legitimate regeneration excluded).
|
|
180
|
+
for (let i = 0; i < lines.length; i++) {
|
|
181
|
+
if (!EDIT_VERB_RE.test(lines[i]!)) continue;
|
|
182
|
+
if (REGENERATED_RE.test(lines[i]!)) continue;
|
|
183
|
+
const m = lines[i]!.match(GENERATED_RE);
|
|
184
|
+
if (m) {
|
|
185
|
+
push({
|
|
186
|
+
ruleId: "AUDIT-12",
|
|
187
|
+
label: "generated-file-edit",
|
|
188
|
+
severity: "critical",
|
|
189
|
+
signature: sig("AUDIT-12", `${id}:${m[1]}`),
|
|
190
|
+
evidence: { line: i + 1, excerpt: lines[i]!.trim().slice(0, 100) },
|
|
191
|
+
detail: `${id}: line ${i + 1} records a direct write to generated artifact "${m[1]}" — generated files are regeneration-only`,
|
|
192
|
+
frictionCandidate: "generated-file-edit",
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// AUDIT-14: completion claim contradicted by adjacent failure evidence.
|
|
198
|
+
for (let i = 0; i < lines.length; i++) {
|
|
199
|
+
if (!CLAIM_RE.test(lines[i]!)) continue;
|
|
200
|
+
const window = lines.slice(Math.max(0, i - 8), i).concat(lines.slice(i + 1, i + 9)).join("\n");
|
|
201
|
+
if (FAILURE_RE.test(window)) {
|
|
202
|
+
push({
|
|
203
|
+
ruleId: "AUDIT-14",
|
|
204
|
+
label: "false-completion-claim",
|
|
205
|
+
severity: "minor",
|
|
206
|
+
signature: sig("AUDIT-14", `${id}:${i}`),
|
|
207
|
+
evidence: { line: i + 1, excerpt: lines[i]!.trim().slice(0, 100) },
|
|
208
|
+
detail: `${id}: line ${i + 1} claims completion with adjacent failure evidence — unverified-claim signal`,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return findings;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export async function runSessionAudit(
|
|
216
|
+
input: ForgeCommandInput,
|
|
217
|
+
context: ForgeRuntimeContext,
|
|
218
|
+
): Promise<ForgeCommandResult<SessionAuditData[]>> {
|
|
219
|
+
const io = resolveIo(context.io ?? ambientIo);
|
|
220
|
+
const root = context.workspaceRoot;
|
|
221
|
+
const sessionsDir = path.join(root, "docs", "sessions");
|
|
222
|
+
const sessionFilter = (input.flags["session"] ?? input.flags["id"] ?? input.argv?.[0]) as string | undefined;
|
|
223
|
+
const check = input.flags["check"] === true;
|
|
224
|
+
const relabel = input.flags["relabel"] === true;
|
|
225
|
+
const deep = input.flags["deep"] === true;
|
|
226
|
+
|
|
227
|
+
const active = await listSessionFiles(sessionsDir).catch(() => []);
|
|
228
|
+
const archived = await listArchivedSessionFiles(sessionsDir).catch(() => []);
|
|
229
|
+
const archiveBase = path.join(sessionsDir, "archive");
|
|
230
|
+
const all = [
|
|
231
|
+
...active.map((rel) => ({ rel, base: sessionsDir })),
|
|
232
|
+
...archived.map((rel) => ({ rel, base: archiveBase })),
|
|
233
|
+
].filter((f) => !sessionFilter || f.rel.includes(sessionFilter));
|
|
234
|
+
if (all.length === 0) {
|
|
235
|
+
return { data: [], summary: "no sessions found", exitCode: 1 };
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const results: SessionAuditData[] = [];
|
|
239
|
+
const auditDir = path.join(sessionsDir, "audit");
|
|
240
|
+
if (!check) await io.mkdir(auditDir).catch(() => {});
|
|
241
|
+
|
|
242
|
+
for (const { rel, base } of all) {
|
|
243
|
+
const result = await readAndParseSession(base, rel).catch(() => null);
|
|
244
|
+
if (!result) continue;
|
|
245
|
+
const { frontmatter, body } = result.parsed;
|
|
246
|
+
const id = String(frontmatter.id ?? path.basename(rel, ".md"));
|
|
247
|
+
const findings = auditSessionBody(id, body, frontmatter);
|
|
248
|
+
|
|
249
|
+
// Coverage caveats — the RFC's reserved AUDIT-01/02.
|
|
250
|
+
const rawDir = path.join(sessionsDir, ".raw");
|
|
251
|
+
const rawCount = await io.readdir(rawDir).catch(() => [] as { name: string }[]);
|
|
252
|
+
if (rawCount.length > 0) {
|
|
253
|
+
findings.push({
|
|
254
|
+
ruleId: "AUDIT-01",
|
|
255
|
+
label: "coverage-caveat",
|
|
256
|
+
severity: "minor",
|
|
257
|
+
signature: sig("AUDIT-01", "raw-files"),
|
|
258
|
+
evidence: { excerpt: ".raw/ present" },
|
|
259
|
+
detail: `${rawCount.length} .raw file(s) present — unconverted sessions are audit-blind`,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
if (deep) {
|
|
263
|
+
// Stage-B requires a declared modelBinding — absent → caveat.
|
|
264
|
+
const forgeYaml = await io.readFile(path.join(root, "forge.yaml")).catch(() => "");
|
|
265
|
+
if (!forgeYaml.includes("modelBinding")) {
|
|
266
|
+
findings.push({
|
|
267
|
+
ruleId: "AUDIT-02",
|
|
268
|
+
label: "coverage-caveat",
|
|
269
|
+
severity: "minor",
|
|
270
|
+
signature: sig("AUDIT-02", "no-model-binding"),
|
|
271
|
+
evidence: { excerpt: "forge.yaml" },
|
|
272
|
+
detail: "--deep requested but forge.yaml sessionAudit.modelBinding is undeclared — Stage-B skipped, only Stage-A ran",
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const sidecarRel = `docs/sessions/audit/${id}.audit.yaml`;
|
|
278
|
+
if (!check) {
|
|
279
|
+
const sidecarAbs = path.join(root, sidecarRel);
|
|
280
|
+
// Deterministic auditedAt = session's own date → rerun with unchanged
|
|
281
|
+
// findings produces an identical sidecar (no churn).
|
|
282
|
+
const auditedAt = typeof frontmatter.date === "string" ? frontmatter.date : id;
|
|
283
|
+
const body = yamlStringify({
|
|
284
|
+
schema: "forge/session-audit@1",
|
|
285
|
+
sessionId: id,
|
|
286
|
+
auditedAt,
|
|
287
|
+
auditor: "stage-a",
|
|
288
|
+
findings,
|
|
289
|
+
verdict: findings.some((f) => f.severity === "critical") ? "violations" : findings.length > 0 ? "warnings" : "clean",
|
|
290
|
+
}) + "\n";
|
|
291
|
+
const prior = await io.readFile(sidecarAbs).catch(() => null);
|
|
292
|
+
if (relabel || prior !== body) await io.writeFile(sidecarAbs, body);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
results.push({
|
|
296
|
+
command: "session.audit",
|
|
297
|
+
sessionId: id,
|
|
298
|
+
status: findings.length > 0 ? "findings" : "clean",
|
|
299
|
+
findings,
|
|
300
|
+
sidecar: sidecarRel,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
results.sort((a, b) => a.sessionId.localeCompare(b.sessionId));
|
|
305
|
+
const criticals = results.reduce((n, r) => n + r.findings.filter((f) => f.severity === "critical").length, 0);
|
|
306
|
+
if (context.outputFormat === "pretty") {
|
|
307
|
+
for (const r of results) {
|
|
308
|
+
const fn = r.findings.some((f) => f.severity === "critical") ? context.logger.error : r.findings.length > 0 ? context.logger.warn : context.logger.success;
|
|
309
|
+
fn(`${r.sessionId}: ${r.findings.length} finding(s) → ${r.sidecar}`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
data: results,
|
|
314
|
+
summary: `${results.length} session(s) audited: ${criticals} critical finding(s)`,
|
|
315
|
+
exitCode: check && criticals > 0 ? 1 : 0,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
</non-goals>
|
|
7
7
|
</MODULE_CONTRACT>
|
|
8
8
|
<CHANGE_SUMMARY>
|
|
9
|
-
<item>RFC-0537: initial forgeSessionModule registering session.save, session.archive, session.validate, session.list commands.</item>
|
|
10
9
|
<item>RFC-1053: register metrics.aggregate command for skill effectiveness metrics aggregation.</item>
|
|
11
10
|
<item>RFC-1173: declare mutatesState on all kernel commands — collectDeclarationDiagnostics emits error-severity MUTATES-STATE-DECLARED, command.manifest.validate is the blocking consumer in packages.check, sweep declares the flag on every command definition (factories hardcode false for read-only check specs)</item>
|
|
11
|
+
<item>RFC-1354: step 4 — CMD-MAN-02 sweep: writes/generates on mutating commands, mutatesState:false on read-only and port/in-memory commands, execOnReadOnly on subprocess commands (0 CMD-MAN-02; 42 ENV-INPUT-02 excluded per Q-1)</item>
|
|
12
|
+
<item>RFC-1471: session.audit Stage-A detectors + audit.report read-model — denied-retry, blocker omission, generated-edit, retry-after-denial, false-claim</item>
|
|
13
|
+
<item>RFC-1471: apply r1 repairs — AUDIT-10..14 corrected semantics, read-only --check, deterministic auditedAt, archive coverage, metrics artifact, Stage-B stub</item>
|
|
14
|
+
<history>RFC-0537</history>
|
|
12
15
|
</CHANGE_SUMMARY>
|
|
13
16
|
*/
|
|
14
17
|
|
|
@@ -20,6 +23,8 @@ export async function createForgeSessionModule(): Promise<ForgeModule> {
|
|
|
20
23
|
const { runSessionValidate } = await import("./handlers/validate.ts");
|
|
21
24
|
const { runSessionList } = await import("./handlers/list.ts");
|
|
22
25
|
const { runMetricsAggregate } = await import("./handlers/metrics-aggregate.ts");
|
|
26
|
+
const { runSessionAudit } = await import("./handlers/session-audit.ts");
|
|
27
|
+
const { runSessionAuditReport } = await import("./handlers/session-audit-report.ts");
|
|
23
28
|
return {
|
|
24
29
|
name: "forge-session",
|
|
25
30
|
version: "0.1.0",
|
|
@@ -137,7 +142,7 @@ export async function createForgeSessionModule(): Promise<ForgeModule> {
|
|
|
137
142
|
{
|
|
138
143
|
name: "metrics.aggregate",
|
|
139
144
|
coverage: "operator" as const,
|
|
140
|
-
mutatesState:
|
|
145
|
+
mutatesState: false,
|
|
141
146
|
description:
|
|
142
147
|
"Query and aggregate skill effectiveness metrics from docs/metrics/ files. " +
|
|
143
148
|
"Returns per-skill statistics (invocations, avgFindings, avgFixIterations, avgDurationMs). " +
|
|
@@ -160,6 +165,50 @@ export async function createForgeSessionModule(): Promise<ForgeModule> {
|
|
|
160
165
|
reads: ["docs/metrics/**/*.yaml"],
|
|
161
166
|
execute: runMetricsAggregate,
|
|
162
167
|
},
|
|
168
|
+
{
|
|
169
|
+
name: "session.audit",
|
|
170
|
+
coverage: "operator" as const,
|
|
171
|
+
contract: "session",
|
|
172
|
+
description:
|
|
173
|
+
"RFC-1471: deterministic Stage-A detectors over docs/sessions/*.md (+ archive/) — AUDIT-01/02 coverage caveats, AUDIT-10 circumvention, AUDIT-11 blocker deception, AUDIT-12 generated-file edit, AUDIT-13 denied retry, AUDIT-14 false claim. Writes docs/sessions/audit/<id>.audit.yaml sidecars (deterministic auditedAt). Flags: --session, --check (read-only), --relabel, --deep.",
|
|
174
|
+
scope: "workspace",
|
|
175
|
+
mutatesState: true,
|
|
176
|
+
writes: ["docs/sessions/audit/*.audit.yaml"],
|
|
177
|
+
generates: [],
|
|
178
|
+
rules: [
|
|
179
|
+
{ id: "AUDIT-01", severity: "warning" },
|
|
180
|
+
{ id: "AUDIT-02", severity: "warning" },
|
|
181
|
+
{ id: "AUDIT-10", severity: "error" },
|
|
182
|
+
{ id: "AUDIT-11", severity: "error" },
|
|
183
|
+
{ id: "AUDIT-12", severity: "error" },
|
|
184
|
+
{ id: "AUDIT-13", severity: "warning" },
|
|
185
|
+
{ id: "AUDIT-14", severity: "warning" },
|
|
186
|
+
],
|
|
187
|
+
flags: {
|
|
188
|
+
session: { kind: "string", description: "Audit a single session by id fragment." },
|
|
189
|
+
check: { kind: "boolean", description: "Read-only audit — no sidecar writes; exits non-zero on critical findings." },
|
|
190
|
+
relabel: { kind: "boolean", description: "Force a fresh sidecar write even when findings are unchanged." },
|
|
191
|
+
deep: { kind: "boolean", description: "Request Stage-B model labeling — requires forge.yaml sessionAudit.modelBinding; warns AUDIT-02 when absent." },
|
|
192
|
+
},
|
|
193
|
+
reads: ["docs/sessions/*.md", "docs/sessions/archive/*.md", "docs/sessions/.raw/*", "forge.yaml"],
|
|
194
|
+
execute: runSessionAudit,
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "session.audit.report",
|
|
198
|
+
coverage: "operator" as const,
|
|
199
|
+
contract: "session",
|
|
200
|
+
description:
|
|
201
|
+
"RFC-1471: read-model over docs/sessions/audit/*.audit.yaml — per-rule frequency, verdict distribution, finding classes with no friction on file; writes docs/metrics/session-audit.generated.yaml. Flags: --window.",
|
|
202
|
+
scope: "workspace",
|
|
203
|
+
mutatesState: true,
|
|
204
|
+
writes: ["docs/metrics/session-audit.generated.yaml"],
|
|
205
|
+
generates: [{ path: "docs/metrics/session-audit.generated.yaml", phase: "on-demand" as const }],
|
|
206
|
+
flags: {
|
|
207
|
+
window: { kind: "string", description: "Restrict to sidecars newer than an ISO date (e.g. 2026-10-01)." },
|
|
208
|
+
},
|
|
209
|
+
reads: ["docs/sessions/audit/*.audit.yaml", "docs/frictions.yaml"],
|
|
210
|
+
execute: runSessionAuditReport,
|
|
211
|
+
},
|
|
163
212
|
],
|
|
164
213
|
pipelines: [],
|
|
165
214
|
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
RFC-1363: shared amendment loader for spec.validate, spec.status and
|
|
5
|
+
spec.materialize. Reads docs/specs/<id>/amendments/*.md, parses frontmatter,
|
|
6
|
+
validates against forge/spec-amendment@1, and FAILS CLOSED: a file without
|
|
7
|
+
parseable frontmatter or failing the schema is returned as a SPEC-14 error
|
|
8
|
+
naming the file and the issues — never silently skipped.
|
|
9
|
+
</purpose>
|
|
10
|
+
<non-goals>
|
|
11
|
+
<item>Do not validate amendment targets against a forge-spec here — callers own SPEC-08..11.</item>
|
|
12
|
+
<item>Do not edit or normalize amendment files.</item>
|
|
13
|
+
</non-goals>
|
|
14
|
+
</MODULE_CONTRACT>
|
|
15
|
+
<KEY_DECISIONS>
|
|
16
|
+
<item>Fail-closed per DNA-112: unreadable input is a diagnostic, not a pass.</item>
|
|
17
|
+
</KEY_DECISIONS>
|
|
18
|
+
<CHANGE_SUMMARY>
|
|
19
|
+
<item>RFC-1363: extracted the three per-command amendment loops into one fail-closed loader with SPEC-14 diagnostics.</item>
|
|
20
|
+
<item>RFC-1363: fail-closed amendment loader SPEC-14 + target repairs AMD-008..011</item>
|
|
21
|
+
</CHANGE_SUMMARY>
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { ambientIo as fs } from "../../src/utils/io.ts";
|
|
25
|
+
import { existsSync } from "../../src/utils/sync-fs.ts";
|
|
26
|
+
import path from "node:path";
|
|
27
|
+
import { parse as parseYaml } from "yaml";
|
|
28
|
+
import { specAmendmentSchema, type SpecAmendment, type SpecViolation } from "./spec-schema.ts";
|
|
29
|
+
|
|
30
|
+
export interface LoadedAmendments {
|
|
31
|
+
amendments: SpecAmendment[];
|
|
32
|
+
errors: SpecViolation[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function formatZodIssues(error: { issues: { path: PropertyKey[]; message: string }[] }): string {
|
|
36
|
+
return error.issues
|
|
37
|
+
.map((i) => `${i.path.length > 0 ? i.path.join(".") : "(root)"}: ${i.message}`)
|
|
38
|
+
.join("; ");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function loadAmendments(specDir: string): Promise<LoadedAmendments> {
|
|
42
|
+
const amendmentsDir = path.join(specDir, "amendments");
|
|
43
|
+
if (!existsSync(amendmentsDir)) return { amendments: [], errors: [] };
|
|
44
|
+
|
|
45
|
+
const entries = (await fs.readdir(amendmentsDir)).map((e) => e.name);
|
|
46
|
+
const amendments: SpecAmendment[] = [];
|
|
47
|
+
const errors: SpecViolation[] = [];
|
|
48
|
+
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
if (!entry.endsWith(".md")) continue;
|
|
51
|
+
try {
|
|
52
|
+
const content = await fs.readFile(path.join(amendmentsDir, entry));
|
|
53
|
+
const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
54
|
+
if (!fmMatch) {
|
|
55
|
+
errors.push({
|
|
56
|
+
rule: "SPEC-14",
|
|
57
|
+
message: `amendment ${entry} does not match forge/spec-amendment@1: (root): no frontmatter block`,
|
|
58
|
+
});
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
let raw: unknown;
|
|
62
|
+
try {
|
|
63
|
+
raw = parseYaml(fmMatch[1]) as unknown;
|
|
64
|
+
} catch (err) {
|
|
65
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
66
|
+
errors.push({
|
|
67
|
+
rule: "SPEC-14",
|
|
68
|
+
message: `amendment ${entry} does not match forge/spec-amendment@1: (frontmatter): YAML parse error: ${msg}`,
|
|
69
|
+
});
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const parsed = specAmendmentSchema.safeParse(raw);
|
|
73
|
+
if (parsed.success) {
|
|
74
|
+
amendments.push(parsed.data);
|
|
75
|
+
} else {
|
|
76
|
+
errors.push({
|
|
77
|
+
rule: "SPEC-14",
|
|
78
|
+
message: `amendment ${entry} does not match forge/spec-amendment@1: ${formatZodIssues(parsed.error)}`,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
} catch (err) {
|
|
82
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
83
|
+
errors.push({
|
|
84
|
+
rule: "SPEC-14",
|
|
85
|
+
message: `amendment ${entry} does not match forge/spec-amendment@1: unreadable file: ${msg}`,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return { amendments, errors };
|
|
91
|
+
}
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
<CHANGE_SUMMARY>
|
|
10
10
|
<item>RFC-0396: initial spec.materialize handler — front computation, scaffold via rfc.create, materializedAs write-back.</item>
|
|
11
11
|
<item>RFC-1240: consumer-aware front — consumers ownership gate, foreign-dep satisfaction, foreignOwned result field, --consumer flag resolution.</item>
|
|
12
|
+
<item>RFC-1363: fail-closed amendment loader SPEC-14 + target repairs AMD-008..011</item>
|
|
12
13
|
</CHANGE_SUMMARY>
|
|
13
14
|
*/
|
|
14
15
|
|
|
15
16
|
import { ambientIo as fs } from "../../src/utils/io.ts";
|
|
16
|
-
import { existsSync } from "../../src/utils/sync-fs.ts";
|
|
17
17
|
import path from "node:path";
|
|
18
18
|
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
19
19
|
import { toKebabCase } from "../../src/utils/string-utils.ts";
|
|
@@ -26,16 +26,15 @@ import type {
|
|
|
26
26
|
} from "../../src/types.ts";
|
|
27
27
|
import {
|
|
28
28
|
forgeSpecSchema,
|
|
29
|
-
specAmendmentSchema,
|
|
30
29
|
type ForgeSpec,
|
|
31
30
|
type SpecRfcNode,
|
|
32
|
-
type SpecAmendment,
|
|
33
31
|
ownsSpecNode,
|
|
34
32
|
isForeignOwnedNode,
|
|
35
33
|
isForeignConsumerDep,
|
|
36
34
|
resolveAmendedNode,
|
|
37
35
|
} from "./spec-schema.ts";
|
|
38
36
|
import { listRfcFiles } from "../rfc/frontmatter-io.ts";
|
|
37
|
+
import { loadAmendments } from "./spec-amendments.ts";
|
|
39
38
|
|
|
40
39
|
// ---------------------------------------------------------------------------
|
|
41
40
|
// Types
|
|
@@ -173,26 +172,25 @@ export async function runSpecMaterialize(
|
|
|
173
172
|
};
|
|
174
173
|
}
|
|
175
174
|
|
|
176
|
-
// Load amendments (RFC-0397)
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
for (const entry of amdEntries) {
|
|
182
|
-
if (!entry.endsWith(".md")) continue;
|
|
183
|
-
try {
|
|
184
|
-
const content = await fs.readFile(path.join(amendmentsDir, entry));
|
|
185
|
-
const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
186
|
-
if (!fmMatch) continue;
|
|
187
|
-
const raw = parseYaml(fmMatch[1]) as unknown;
|
|
188
|
-
const amdParsed = specAmendmentSchema.safeParse(raw);
|
|
189
|
-
if (amdParsed.success) {
|
|
190
|
-
amendments.push(amdParsed.data);
|
|
191
|
-
}
|
|
192
|
-
} catch {
|
|
193
|
-
// skip
|
|
194
|
-
}
|
|
175
|
+
// Load amendments (RFC-0397) — fail closed on SPEC-14 (RFC-1363)
|
|
176
|
+
const { amendments, errors: amendmentErrors } = await loadAmendments(specDir);
|
|
177
|
+
if (amendmentErrors.length > 0) {
|
|
178
|
+
for (const v of amendmentErrors) {
|
|
179
|
+
if (outputFormat === "pretty") logger.error(`spec.materialize: ${specId} — ${v.rule}: ${v.message}`);
|
|
195
180
|
}
|
|
181
|
+
return {
|
|
182
|
+
data: {
|
|
183
|
+
command: "spec.materialize",
|
|
184
|
+
status: "fail",
|
|
185
|
+
spec: specId,
|
|
186
|
+
created: [],
|
|
187
|
+
skipped: [],
|
|
188
|
+
front: [],
|
|
189
|
+
foreignOwned: [],
|
|
190
|
+
},
|
|
191
|
+
exitCode: 1,
|
|
192
|
+
summary: `spec.materialize: refused — ${amendmentErrors.length} unparseable amendment file(s) in ${specId} (run spec.validate for details)`,
|
|
193
|
+
};
|
|
196
194
|
}
|
|
197
195
|
|
|
198
196
|
const proposedAmendmentNodes = new Set<string>();
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
<purpose>Prove spec.status resolves materializedAs against archived RFCs: an implemented RFC living only under docs/rfcs/archive/implemented/ still marks its node implemented and unblocks the front.</purpose>
|
|
4
4
|
<non-goals><item>Do not duplicate spec.validate rule coverage — that lives in spec-validate.test.ts.</item></non-goals>
|
|
5
5
|
</MODULE_CONTRACT>
|
|
6
|
-
<CHANGE_SUMMARY
|
|
6
|
+
<CHANGE_SUMMARY>
|
|
7
|
+
<item>FIX: initial coverage — archived-implemented dependency unblocks front; top-level draft stays a blocker.</item>
|
|
8
|
+
<item>RFC-1363: fail-closed amendment loader SPEC-14 + target repairs AMD-008..011</item>
|
|
9
|
+
</CHANGE_SUMMARY>
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
12
|
import fs from "node:fs/promises";
|
|
@@ -128,3 +131,16 @@ describe("spec.status archived-RFC resolution", () => {
|
|
|
128
131
|
expect(spec.front).toEqual([]);
|
|
129
132
|
});
|
|
130
133
|
});
|
|
134
|
+
|
|
135
|
+
describe("spec.status SPEC-14 fail-closed (RFC-1363)", () => {
|
|
136
|
+
it("AC-3: exits non-zero when the spec has an unparseable amendment", async () => {
|
|
137
|
+
const workspaceRoot = await makeWorkspace();
|
|
138
|
+
await writeSpec(workspaceRoot, "journal", TWO_NODE_SPEC);
|
|
139
|
+
const dir = path.join(workspaceRoot, "docs/specs/journal/amendments");
|
|
140
|
+
await fs.mkdir(dir, { recursive: true });
|
|
141
|
+
await fs.writeFile(path.join(dir, "amd-bad.md"), "# no frontmatter\n");
|
|
142
|
+
const result = await runSpecStatus({ argv: [], flags: { spec: "journal" } }, ctx(workspaceRoot));
|
|
143
|
+
expect(result.exitCode).toBe(1);
|
|
144
|
+
expect(result.summary).toContain("unparseable amendment");
|
|
145
|
+
});
|
|
146
|
+
});
|
package/os/spec/spec-status.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
<item>RFC-0396: initial spec.status handler — per-node states, blockers, front, progress.</item>
|
|
10
10
|
<item>RFC-1240: consumer-aware front — foreignOwned flag/list, foreign deps are not local blockers, --consumer flag resolution.</item>
|
|
11
11
|
<item>FIX: loadRfcStatuses delegated to loadRfcStatusMap (recursive) — archived implemented RFCs resolve their status, so terminal dependencies unblock the front instead of collapsing nodes to stale draft.</item>
|
|
12
|
+
<item>RFC-1363: fail-closed amendment loader SPEC-14 + target repairs AMD-008..011</item>
|
|
12
13
|
</CHANGE_SUMMARY>
|
|
13
14
|
*/
|
|
14
15
|
|
|
@@ -24,11 +25,9 @@ import type {
|
|
|
24
25
|
} from "../../src/types.ts";
|
|
25
26
|
import {
|
|
26
27
|
forgeSpecSchema,
|
|
27
|
-
specAmendmentSchema,
|
|
28
28
|
isForeignConsumerDep,
|
|
29
29
|
isForeignOwnedNode,
|
|
30
30
|
type ForgeSpec,
|
|
31
|
-
type SpecAmendment,
|
|
32
31
|
} from "./spec-schema.ts";
|
|
33
32
|
import { loadRfcStatusMap } from "../rfc/frontmatter-io.ts";
|
|
34
33
|
|
|
@@ -100,31 +99,7 @@ async function loadRfcStatuses(
|
|
|
100
99
|
return loadRfcStatusMap(rfcDir);
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
|
|
104
|
-
const amendmentsDir = path.join(specDir, "amendments");
|
|
105
|
-
if (!existsSync(amendmentsDir)) return [];
|
|
106
|
-
|
|
107
|
-
const entries = (await fs.readdir(amendmentsDir)).map((e) => e.name);
|
|
108
|
-
const amendments: SpecAmendment[] = [];
|
|
109
|
-
|
|
110
|
-
for (const entry of entries) {
|
|
111
|
-
if (!entry.endsWith(".md")) continue;
|
|
112
|
-
try {
|
|
113
|
-
const content = await fs.readFile(path.join(amendmentsDir, entry));
|
|
114
|
-
const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
115
|
-
if (!fmMatch) continue;
|
|
116
|
-
const raw = parseYaml(fmMatch[1]) as unknown;
|
|
117
|
-
const parsed = specAmendmentSchema.safeParse(raw);
|
|
118
|
-
if (parsed.success) {
|
|
119
|
-
amendments.push(parsed.data);
|
|
120
|
-
}
|
|
121
|
-
} catch {
|
|
122
|
-
// skip unreadable files
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return amendments;
|
|
127
|
-
}
|
|
102
|
+
import { loadAmendments } from "./spec-amendments.ts";
|
|
128
103
|
|
|
129
104
|
function computeFront(
|
|
130
105
|
nodes: SpecNodeStatus[],
|
|
@@ -230,8 +205,27 @@ export async function runSpecStatus(
|
|
|
230
205
|
total: nodes.length,
|
|
231
206
|
};
|
|
232
207
|
|
|
233
|
-
// Load amendments (RFC-0397)
|
|
234
|
-
const amendments = await loadAmendments(specDir);
|
|
208
|
+
// Load amendments (RFC-0397) — fail closed on SPEC-14 (RFC-1363)
|
|
209
|
+
const { amendments, errors: amendmentErrors } = await loadAmendments(specDir);
|
|
210
|
+
if (amendmentErrors.length > 0) {
|
|
211
|
+
for (const v of amendmentErrors) {
|
|
212
|
+
if (outputFormat === "pretty") logger.error(`spec.status: ${specId} — ${v.rule}: ${v.message}`);
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
data: {
|
|
216
|
+
command: "spec.status",
|
|
217
|
+
specs: [],
|
|
218
|
+
},
|
|
219
|
+
exitCode: 1,
|
|
220
|
+
summary: `spec.status: refused — ${amendmentErrors.length} unparseable amendment file(s) in ${specId} (run spec.validate for details)`,
|
|
221
|
+
nextSteps: [
|
|
222
|
+
{
|
|
223
|
+
action: `Repair or remove the named amendment files, then re-run: pnpm exec forge run spec.validate`,
|
|
224
|
+
kind: "required" as const,
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
};
|
|
228
|
+
}
|
|
235
229
|
const acceptedAmendments = amendments.filter((a) => a.status === "accepted");
|
|
236
230
|
const amendedNodes = new Set<string>();
|
|
237
231
|
const amendedDecisions = new Set<string>();
|