@vedprakash-m/tenet 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/README.md +104 -2
- package/dist/cli.d.ts +53 -0
- package/dist/cli.js +389 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/bless.d.ts +2 -0
- package/dist/commands/bless.js +27 -0
- package/dist/commands/bless.js.map +1 -0
- package/dist/commands/board.d.ts +32 -0
- package/dist/commands/board.js +31 -0
- package/dist/commands/board.js.map +1 -0
- package/dist/commands/check.d.ts +2 -0
- package/dist/commands/check.js +35 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/context.d.ts +45 -0
- package/dist/commands/context.js +49 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/doctor.d.ts +8 -0
- package/dist/commands/doctor.js +47 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/fix.d.ts +2 -0
- package/dist/commands/fix.js +25 -0
- package/dist/commands/fix.js.map +1 -0
- package/dist/commands/index.d.ts +12 -0
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.js +215 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/onboard.d.ts +45 -0
- package/dist/commands/onboard.js +66 -0
- package/dist/commands/onboard.js.map +1 -0
- package/dist/commands/remove.d.ts +8 -0
- package/dist/commands/remove.js +56 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/split.d.ts +2 -0
- package/dist/commands/split.js +20 -0
- package/dist/commands/split.js.map +1 -0
- package/dist/commands/upgrade.d.ts +8 -0
- package/dist/commands/upgrade.js +69 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/verify.d.ts +33 -0
- package/dist/commands/verify.js +147 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/context/index.d.ts +61 -0
- package/dist/context/index.js +401 -0
- package/dist/context/index.js.map +1 -0
- package/dist/core/clock.d.ts +3 -0
- package/dist/core/clock.js +16 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/commands.d.ts +38 -0
- package/dist/core/commands.js +2 -0
- package/dist/core/commands.js.map +1 -0
- package/dist/core/fs.d.ts +7 -0
- package/dist/core/fs.js +97 -0
- package/dist/core/fs.js.map +1 -0
- package/dist/core/git.d.ts +11 -0
- package/dist/core/git.js +223 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/hash.d.ts +6 -0
- package/dist/core/hash.js +123 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/messages.d.ts +276 -0
- package/dist/core/messages.js +289 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/output.d.ts +22 -0
- package/dist/core/output.js +78 -0
- package/dist/core/output.js.map +1 -0
- package/dist/core/schema.d.ts +14 -0
- package/dist/core/schema.js +138 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/yaml.d.ts +1 -0
- package/dist/core/yaml.js +16 -0
- package/dist/core/yaml.js.map +1 -0
- package/dist/install/doctor.d.ts +3 -0
- package/dist/install/doctor.js +365 -0
- package/dist/install/doctor.js.map +1 -0
- package/dist/install/environment.d.ts +4 -0
- package/dist/install/environment.js +47 -0
- package/dist/install/environment.js.map +1 -0
- package/dist/install/hosts.d.ts +5 -0
- package/dist/install/hosts.js +105 -0
- package/dist/install/hosts.js.map +1 -0
- package/dist/install/init.d.ts +2 -0
- package/dist/install/init.js +80 -0
- package/dist/install/init.js.map +1 -0
- package/dist/install/integrity.d.ts +24 -0
- package/dist/install/integrity.js +200 -0
- package/dist/install/integrity.js.map +1 -0
- package/dist/install/manifest.d.ts +27 -0
- package/dist/install/manifest.js +276 -0
- package/dist/install/manifest.js.map +1 -0
- package/dist/install/preflight.d.ts +3 -0
- package/dist/install/preflight.js +558 -0
- package/dist/install/preflight.js.map +1 -0
- package/dist/install/remove.d.ts +2 -0
- package/dist/install/remove.js +668 -0
- package/dist/install/remove.js.map +1 -0
- package/dist/install/types.d.ts +303 -0
- package/dist/install/types.js +2 -0
- package/dist/install/types.js.map +1 -0
- package/dist/install/upgrade.d.ts +2 -0
- package/dist/install/upgrade.js +307 -0
- package/dist/install/upgrade.js.map +1 -0
- package/dist/install/writes.d.ts +15 -0
- package/dist/install/writes.js +1200 -0
- package/dist/install/writes.js.map +1 -0
- package/dist/mcp/index.d.ts +13 -0
- package/dist/mcp/index.js +437 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/onboard/assignment.d.ts +22 -0
- package/dist/onboard/assignment.js +102 -0
- package/dist/onboard/assignment.js.map +1 -0
- package/dist/onboard/bless.d.ts +104 -0
- package/dist/onboard/bless.js +729 -0
- package/dist/onboard/bless.js.map +1 -0
- package/dist/onboard/card.d.ts +31 -0
- package/dist/onboard/card.js +175 -0
- package/dist/onboard/card.js.map +1 -0
- package/dist/onboard/findings.d.ts +3 -0
- package/dist/onboard/findings.js +185 -0
- package/dist/onboard/findings.js.map +1 -0
- package/dist/onboard/inventory.d.ts +21 -0
- package/dist/onboard/inventory.js +302 -0
- package/dist/onboard/inventory.js.map +1 -0
- package/dist/onboard/preflight.d.ts +32 -0
- package/dist/onboard/preflight.js +156 -0
- package/dist/onboard/preflight.js.map +1 -0
- package/dist/onboard/refresh.d.ts +28 -0
- package/dist/onboard/refresh.js +65 -0
- package/dist/onboard/refresh.js.map +1 -0
- package/dist/policy/errors.d.ts +12 -0
- package/dist/policy/errors.js +25 -0
- package/dist/policy/errors.js.map +1 -0
- package/dist/policy/index.d.ts +4 -0
- package/dist/policy/index.js +4 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/kit.d.ts +12 -0
- package/dist/policy/kit.js +162 -0
- package/dist/policy/kit.js.map +1 -0
- package/dist/policy/load.d.ts +15 -0
- package/dist/policy/load.js +415 -0
- package/dist/policy/load.js.map +1 -0
- package/dist/policy/selectors.d.ts +2 -0
- package/dist/policy/selectors.js +43 -0
- package/dist/policy/selectors.js.map +1 -0
- package/dist/policy/types.d.ts +40 -0
- package/dist/policy/types.js +2 -0
- package/dist/policy/types.js.map +1 -0
- package/dist/reports/acceptance.d.ts +2 -0
- package/dist/reports/acceptance.js +79 -0
- package/dist/reports/acceptance.js.map +1 -0
- package/dist/reports/declared.d.ts +6 -0
- package/dist/reports/declared.js +114 -0
- package/dist/reports/declared.js.map +1 -0
- package/dist/reports/errors.d.ts +8 -0
- package/dist/reports/errors.js +12 -0
- package/dist/reports/errors.js.map +1 -0
- package/dist/reports/index.d.ts +8 -0
- package/dist/reports/index.js +8 -0
- package/dist/reports/index.js.map +1 -0
- package/dist/reports/items.d.ts +6 -0
- package/dist/reports/items.js +85 -0
- package/dist/reports/items.js.map +1 -0
- package/dist/reports/read-types.d.ts +7 -0
- package/dist/reports/read-types.js +2 -0
- package/dist/reports/read-types.js.map +1 -0
- package/dist/reports/read.d.ts +3 -0
- package/dist/reports/read.js +96 -0
- package/dist/reports/read.js.map +1 -0
- package/dist/reports/registry.d.ts +32 -0
- package/dist/reports/registry.js +372 -0
- package/dist/reports/registry.js.map +1 -0
- package/dist/reports/scan.d.ts +23 -0
- package/dist/reports/scan.js +406 -0
- package/dist/reports/scan.js.map +1 -0
- package/dist/reports/tags.d.ts +4 -0
- package/dist/reports/tags.js +53 -0
- package/dist/reports/tags.js.map +1 -0
- package/dist/reports/types.d.ts +90 -0
- package/dist/reports/types.js +2 -0
- package/dist/reports/types.js.map +1 -0
- package/dist/reports/weakening.d.ts +5 -0
- package/dist/reports/weakening.js +260 -0
- package/dist/reports/weakening.js.map +1 -0
- package/dist/sdk.d.ts +8 -0
- package/dist/sdk.js +8 -0
- package/dist/sdk.js.map +1 -0
- package/dist/specs/anchors.d.ts +44 -0
- package/dist/specs/anchors.js +171 -0
- package/dist/specs/anchors.js.map +1 -0
- package/dist/specs/check.d.ts +19 -0
- package/dist/specs/check.js +656 -0
- package/dist/specs/check.js.map +1 -0
- package/dist/specs/citations.d.ts +5 -0
- package/dist/specs/citations.js +65 -0
- package/dist/specs/citations.js.map +1 -0
- package/dist/specs/deltas.d.ts +10 -0
- package/dist/specs/deltas.js +110 -0
- package/dist/specs/deltas.js.map +1 -0
- package/dist/specs/fix.d.ts +11 -0
- package/dist/specs/fix.js +583 -0
- package/dist/specs/fix.js.map +1 -0
- package/dist/specs/flags.d.ts +25 -0
- package/dist/specs/flags.js +100 -0
- package/dist/specs/flags.js.map +1 -0
- package/dist/specs/ladder.d.ts +13 -0
- package/dist/specs/ladder.js +105 -0
- package/dist/specs/ladder.js.map +1 -0
- package/dist/specs/parse.d.ts +58 -0
- package/dist/specs/parse.js +565 -0
- package/dist/specs/parse.js.map +1 -0
- package/dist/specs/sections.d.ts +2 -0
- package/dist/specs/sections.js +36 -0
- package/dist/specs/sections.js.map +1 -0
- package/dist/specs/split.d.ts +8 -0
- package/dist/specs/split.js +264 -0
- package/dist/specs/split.js.map +1 -0
- package/dist/specs/touched.d.ts +11 -0
- package/dist/specs/touched.js +376 -0
- package/dist/specs/touched.js.map +1 -0
- package/dist/types/generated.d.ts +547 -0
- package/dist/types/generated.js +4 -0
- package/dist/types/generated.js.map +1 -0
- package/dist/verify/bundle.d.ts +104 -0
- package/dist/verify/bundle.js +212 -0
- package/dist/verify/bundle.js.map +1 -0
- package/dist/verify/card.d.ts +7 -0
- package/dist/verify/card.js +105 -0
- package/dist/verify/card.js.map +1 -0
- package/dist/verify/forge.d.ts +56 -0
- package/dist/verify/forge.js +173 -0
- package/dist/verify/forge.js.map +1 -0
- package/dist/verify/record.d.ts +63 -0
- package/dist/verify/record.js +539 -0
- package/dist/verify/record.js.map +1 -0
- package/dist/verify/records.d.ts +33 -0
- package/dist/verify/records.js +107 -0
- package/dist/verify/records.js.map +1 -0
- package/dist/verify/run-checks.d.ts +22 -0
- package/dist/verify/run-checks.js +149 -0
- package/dist/verify/run-checks.js.map +1 -0
- package/dist/views/specs-board.d.ts +43 -0
- package/dist/views/specs-board.js +427 -0
- package/dist/views/specs-board.js.map +1 -0
- package/kit/CHANGELOG.md +42 -0
- package/kit/README.md +18 -0
- package/kit/TENET.md +83 -0
- package/kit/agents/drafter.md +78 -0
- package/kit/agents/spec-reviewer.md +75 -0
- package/kit/defaults/tenet.yaml +25 -0
- package/kit/hooks/pre-commit +7 -0
- package/kit/packs/minimal/pack.yaml +54 -0
- package/kit/practices/default.md +6 -0
- package/kit/schemas/agent-card.json +280 -0
- package/kit/schemas/assignment.json +128 -0
- package/kit/schemas/board.json +563 -0
- package/kit/schemas/bundle.json +148 -0
- package/kit/schemas/finding.json +59 -0
- package/kit/schemas/interview.json +48 -0
- package/kit/schemas/inventory.json +409 -0
- package/kit/schemas/lock.json +37 -0
- package/kit/schemas/manifest-local.json +31 -0
- package/kit/schemas/manifest.json +109 -0
- package/kit/schemas/pack.json +190 -0
- package/kit/schemas/packet.json +94 -0
- package/kit/schemas/proof-card.json +526 -0
- package/kit/schemas/results/bless.json +14 -0
- package/kit/schemas/results/board.json +169 -0
- package/kit/schemas/results/check.json +42 -0
- package/kit/schemas/results/context.json +169 -0
- package/kit/schemas/results/doctor.json +22 -0
- package/kit/schemas/results/fix.json +33 -0
- package/kit/schemas/results/init.json +102 -0
- package/kit/schemas/results/mcp.json +173 -0
- package/kit/schemas/results/onboard.json +72 -0
- package/kit/schemas/results/remove.json +34 -0
- package/kit/schemas/results/split.json +21 -0
- package/kit/schemas/results/upgrade.json +23 -0
- package/kit/schemas/results/verify.json +34 -0
- package/kit/schemas/spec-front-matter.json +218 -0
- package/kit/schemas/tenet-yaml.json +356 -0
- package/kit/schemas/test-report.json +77 -0
- package/kit/skills/draft-specs/SKILL.md +38 -0
- package/kit/skills/review-with-findings/SKILL.md +21 -0
- package/kit/skills/work-a-change/SKILL.md +30 -0
- package/kit/templates/agents-block.md +47 -0
- package/kit/templates/design.md +43 -0
- package/kit/templates/escalation.md +34 -0
- package/kit/templates/experience.md +33 -0
- package/kit/templates/intent.md +56 -0
- package/kit/templates/plan.md +35 -0
- package/kit/templates/pull-request.md +25 -0
- package/kit/templates/requirements.md +43 -0
- package/kit/templates/vision.md +69 -0
- package/kit/workflows/existing-ci-step.yml +83 -0
- package/kit/workflows/tenet-tests.yml +88 -0
- package/kit/workflows/tenet.yml +87 -0
- package/package.json +67 -4
- package/pkg/conformance/alg-02/README.md +18 -0
- package/pkg/conformance/alg-02/n01-duplicate-slug/expected.json +5 -0
- package/pkg/conformance/alg-02/n01-duplicate-slug/input.json +5 -0
- package/pkg/conformance/alg-02/n02-ambiguous-rename/expected.json +12 -0
- package/pkg/conformance/alg-02/n02-ambiguous-rename/input.json +20 -0
- package/pkg/conformance/alg-02/n03-missing-front/expected.json +12 -0
- package/pkg/conformance/alg-02/n03-missing-front/input.json +5 -0
- package/pkg/conformance/alg-02/n04-invalid-origin/expected.json +4 -0
- package/pkg/conformance/alg-02/n04-invalid-origin/input.json +9 -0
- package/pkg/conformance/alg-02/p01-leading-preamble/expected.json +15 -0
- package/pkg/conformance/alg-02/p01-leading-preamble/input.json +5 -0
- package/pkg/conformance/alg-02/p02-four-backtick-fence/expected.json +11 -0
- package/pkg/conformance/alg-02/p02-four-backtick-fence/input.json +5 -0
- package/pkg/conformance/alg-02/p03-unicode-and-empty-slug/expected.json +14 -0
- package/pkg/conformance/alg-02/p03-unicode-and-empty-slug/input.json +5 -0
- package/pkg/conformance/alg-02/p04-normalized-bodies/expected.json +6 -0
- package/pkg/conformance/alg-02/p04-normalized-bodies/input.json +7 -0
- package/pkg/conformance/alg-02/p05-rename-digest/expected.json +10 -0
- package/pkg/conformance/alg-02/p05-rename-digest/input.json +16 -0
- package/pkg/conformance/alg-02/p06-requirement-prefix/expected.json +14 -0
- package/pkg/conformance/alg-02/p06-requirement-prefix/input.json +7 -0
- package/pkg/conformance/alg-03/README.md +20 -0
- package/pkg/conformance/alg-03/n01-ambiguous-relocation/expected.json +3 -0
- package/pkg/conformance/alg-03/n01-ambiguous-relocation/input.json +8 -0
- package/pkg/conformance/alg-03/n02-missing-source/expected.json +5 -0
- package/pkg/conformance/alg-03/n02-missing-source/input.json +12 -0
- package/pkg/conformance/alg-03/n03-edited-intent/expected.json +5 -0
- package/pkg/conformance/alg-03/n03-edited-intent/input.json +14 -0
- package/pkg/conformance/alg-03/n04-unblessed-stale-metadata/expected.json +3 -0
- package/pkg/conformance/alg-03/n04-unblessed-stale-metadata/input.json +12 -0
- package/pkg/conformance/alg-03/n05-ambiguous-moved-anchor/expected.json +5 -0
- package/pkg/conformance/alg-03/n05-ambiguous-moved-anchor/input.json +14 -0
- package/pkg/conformance/alg-03/p01-path-anchor/expected.json +8 -0
- package/pkg/conformance/alg-03/p01-path-anchor/input.json +15 -0
- package/pkg/conformance/alg-03/p02-peer-test-anchor/expected.json +8 -0
- package/pkg/conformance/alg-03/p02-peer-test-anchor/input.json +15 -0
- package/pkg/conformance/alg-03/p03-doc-anchor/expected.json +8 -0
- package/pkg/conformance/alg-03/p03-doc-anchor/input.json +15 -0
- package/pkg/conformance/alg-03/p04-unique-relocation/expected.json +4 -0
- package/pkg/conformance/alg-03/p04-unique-relocation/input.json +8 -0
- package/pkg/conformance/alg-03/p05-clean-moved-anchor/expected.json +3 -0
- package/pkg/conformance/alg-03/p05-clean-moved-anchor/input.json +14 -0
- package/pkg/conformance/alg-03/p06-owner-precedence/expected.json +5 -0
- package/pkg/conformance/alg-03/p06-owner-precedence/input.json +7 -0
- package/pkg/conformance/alg-03/p07-owner-last-match/expected.json +6 -0
- package/pkg/conformance/alg-03/p07-owner-last-match/input.json +6 -0
- package/pkg/conformance/alg-04/README.md +19 -0
- package/pkg/conformance/alg-04/n01-missing-file/expected.json +10 -0
- package/pkg/conformance/alg-04/n01-missing-file/input.json +6 -0
- package/pkg/conformance/alg-04/n02-backward-range/expected.json +10 -0
- package/pkg/conformance/alg-04/n02-backward-range/input.json +8 -0
- package/pkg/conformance/alg-04/n03-missing-heading/expected.json +10 -0
- package/pkg/conformance/alg-04/n03-missing-heading/input.json +8 -0
- package/pkg/conformance/alg-04/n04-reversed-test-segments/expected.json +10 -0
- package/pkg/conformance/alg-04/n04-reversed-test-segments/input.json +8 -0
- package/pkg/conformance/alg-04/n05-out-of-range/expected.json +10 -0
- package/pkg/conformance/alg-04/n05-out-of-range/input.json +8 -0
- package/pkg/conformance/alg-04/p01-single-line/expected.json +3 -0
- package/pkg/conformance/alg-04/p01-single-line/input.json +8 -0
- package/pkg/conformance/alg-04/p02-full-range/expected.json +3 -0
- package/pkg/conformance/alg-04/p02-full-range/input.json +8 -0
- package/pkg/conformance/alg-04/p03-doc-heading/expected.json +3 -0
- package/pkg/conformance/alg-04/p03-doc-heading/input.json +8 -0
- package/pkg/conformance/alg-04/p04-nested-test/expected.json +3 -0
- package/pkg/conformance/alg-04/p04-nested-test/input.json +8 -0
- package/pkg/conformance/alg-04/p05-python-test/expected.json +3 -0
- package/pkg/conformance/alg-04/p05-python-test/input.json +8 -0
- package/pkg/conformance/alg-04/p06-go-test/expected.json +3 -0
- package/pkg/conformance/alg-04/p06-go-test/input.json +8 -0
- package/pkg/conformance/alg-08/cases.json +263 -0
- package/pkg/conformance/alg-09/cases.json +95 -0
- package/pkg/conformance/alg-10/README.md +24 -0
- package/pkg/conformance/alg-10/n01-no-blessed-material/expected.json +7 -0
- package/pkg/conformance/alg-10/n01-no-blessed-material/input.json +23 -0
- package/pkg/conformance/alg-10/n02-rejected-section/expected.json +7 -0
- package/pkg/conformance/alg-10/n02-rejected-section/input.json +24 -0
- package/pkg/conformance/alg-10/n03-broken-blessed-copy/expected.json +7 -0
- package/pkg/conformance/alg-10/n03-broken-blessed-copy/input.json +27 -0
- package/pkg/conformance/alg-10/n04-local-omitted/expected.json +12 -0
- package/pkg/conformance/alg-10/n04-local-omitted/input.json +27 -0
- package/pkg/conformance/alg-10/n05-over-budget-explicit-id/expected.json +10 -0
- package/pkg/conformance/alg-10/n05-over-budget-explicit-id/input.json +26 -0
- package/pkg/conformance/alg-10/n06-unknown-method/expected.json +11 -0
- package/pkg/conformance/alg-10/n06-unknown-method/input.json +32 -0
- package/pkg/conformance/alg-10/p01-path-admitted/expected.json +14 -0
- package/pkg/conformance/alg-10/p01-path-admitted/input.json +26 -0
- package/pkg/conformance/alg-10/p02-retry-once-source-changed/expected.json +15 -0
- package/pkg/conformance/alg-10/p02-retry-once-source-changed/input.json +26 -0
- package/pkg/conformance/alg-10/p03-id-and-path-deduplicate/expected.json +13 -0
- package/pkg/conformance/alg-10/p03-id-and-path-deduplicate/input.json +30 -0
- package/pkg/conformance/alg-10/p04-include-draft-with-blessing/expected.json +17 -0
- package/pkg/conformance/alg-10/p04-include-draft-with-blessing/input.json +27 -0
- package/pkg/conformance/alg-10/p05-no-inputs-global-and-index/expected.json +16 -0
- package/pkg/conformance/alg-10/p05-no-inputs-global-and-index/input.json +21 -0
- package/pkg/conformance/alg-10/p06-checked-policy-rule/expected.json +20 -0
- package/pkg/conformance/alg-10/p06-checked-policy-rule/input.json +26 -0
- package/pkg/conformance/alg-10/p07-mcp-session/expected.json +60 -0
- package/pkg/conformance/alg-10/p07-mcp-session/input.json +65 -0
- package/pkg/conformance/alg-10/p08-applies-to-prose/expected.json +12 -0
- package/pkg/conformance/alg-10/p08-applies-to-prose/input.json +25 -0
- package/pkg/conformance/alg-10/p09-global-beyond-reserve/expected.json +14 -0
- package/pkg/conformance/alg-10/p09-global-beyond-reserve/input.json +27 -0
- package/pkg/conformance/alg-10/p10-query-case-insensitive/expected.json +11 -0
- package/pkg/conformance/alg-10/p10-query-case-insensitive/input.json +23 -0
- package/pkg/conformance/alg-11/README.md +29 -0
- package/pkg/conformance/alg-11/n01-no-commits-refused/expected.json +11 -0
- package/pkg/conformance/alg-11/n01-no-commits-refused/input.json +13 -0
- package/pkg/conformance/alg-11/n02-secrets-and-env-skipped/expected.json +153 -0
- package/pkg/conformance/alg-11/n02-secrets-and-env-skipped/input.json +20 -0
- package/pkg/conformance/alg-11/n03-generated-vendored-and-tests-excluded-from-size/expected.json +171 -0
- package/pkg/conformance/alg-11/n03-generated-vendored-and-tests-excluded-from-size/input.json +22 -0
- package/pkg/conformance/alg-11/n04-binary-oversize-and-onboard-exclude-skipped/expected.json +137 -0
- package/pkg/conformance/alg-11/n04-binary-oversize-and-onboard-exclude-skipped/input.json +20 -0
- package/pkg/conformance/alg-11/n05-uncommitted-worktree-source-ignored/expected.json +124 -0
- package/pkg/conformance/alg-11/n05-uncommitted-worktree-source-ignored/input.json +17 -0
- package/pkg/conformance/alg-11/p01-small-one-file-service/expected.json +145 -0
- package/pkg/conformance/alg-11/p01-small-one-file-service/input.json +18 -0
- package/pkg/conformance/alg-11/p02-four-codeowners-areas-separate/expected.json +255 -0
- package/pkg/conformance/alg-11/p02-four-codeowners-areas-separate/input.json +17 -0
- package/pkg/conformance/alg-11/p03-twenty-thousand-lines-separate/expected.json +169 -0
- package/pkg/conformance/alg-11/p03-twenty-thousand-lines-separate/input.json +14 -0
- package/pkg/conformance/alg-11/p04-merge-small-unit-into-neighbor/expected.json +186 -0
- package/pkg/conformance/alg-11/p04-merge-small-unit-into-neighbor/input.json +15 -0
- package/pkg/conformance/alg-11/p05-layout-override/expected.json +128 -0
- package/pkg/conformance/alg-11/p05-layout-override/input.json +14 -0
- package/pkg/conformance/alg-11/p06-cli-kind-and-instruction-files/expected.json +154 -0
- package/pkg/conformance/alg-11/p06-cli-kind-and-instruction-files/input.json +18 -0
- package/pkg/conformance/alg-11/p07-local-test-report-in-observations/expected.json +131 -0
- package/pkg/conformance/alg-11/p07-local-test-report-in-observations/input.json +17 -0
- package/pkg/conformance/alg-11/p08-first-findings-all-four-kinds/expected.json +207 -0
- package/pkg/conformance/alg-11/p08-first-findings-all-four-kinds/input.json +20 -0
- package/pkg/conformance/alg-14/README.md +21 -0
- package/pkg/conformance/alg-14/n01-draft-implements/expected.json +3 -0
- package/pkg/conformance/alg-14/n01-draft-implements/input.json +12 -0
- package/pkg/conformance/alg-14/n02-outside-replacement/expected.json +8 -0
- package/pkg/conformance/alg-14/n02-outside-replacement/input.json +12 -0
- package/pkg/conformance/alg-14/n03-insertion-at-end/expected.json +8 -0
- package/pkg/conformance/alg-14/n03-insertion-at-end/input.json +12 -0
- package/pkg/conformance/alg-14/n04-same-owner-different-rule/expected.json +3 -0
- package/pkg/conformance/alg-14/n04-same-owner-different-rule/input.json +16 -0
- package/pkg/conformance/alg-14/n05-missing-implements/expected.json +3 -0
- package/pkg/conformance/alg-14/n05-missing-implements/input.json +12 -0
- package/pkg/conformance/alg-14/p01-implements-first/expected.json +8 -0
- package/pkg/conformance/alg-14/p01-implements-first/input.json +14 -0
- package/pkg/conformance/alg-14/p02-overlapping-replacement/expected.json +8 -0
- package/pkg/conformance/alg-14/p02-overlapping-replacement/input.json +12 -0
- package/pkg/conformance/alg-14/p03-interior-insertion/expected.json +8 -0
- package/pkg/conformance/alg-14/p03-interior-insertion/input.json +12 -0
- package/pkg/conformance/alg-14/p04-text-changed/expected.json +8 -0
- package/pkg/conformance/alg-14/p04-text-changed/input.json +10 -0
- package/pkg/conformance/alg-14/p05-same-folder/expected.json +8 -0
- package/pkg/conformance/alg-14/p05-same-folder/input.json +14 -0
- package/pkg/conformance/alg-14/p06-codeowners-priority/expected.json +8 -0
- package/pkg/conformance/alg-14/p06-codeowners-priority/input.json +18 -0
- package/pkg/conformance/alg-14/p07-same-area-cap/expected.json +44 -0
- package/pkg/conformance/alg-14/p07-same-area-cap/input.json +14 -0
- package/pkg/conformance/alg-14/p08-deleted-document/expected.json +8 -0
- package/pkg/conformance/alg-14/p08-deleted-document/input.json +13 -0
- package/pkg/conformance/board/README.md +19 -0
- package/pkg/conformance/board/n01-no-specifications/expected.json +8 -0
- package/pkg/conformance/board/n01-no-specifications/expected.md +1 -0
- package/pkg/conformance/board/n01-no-specifications/input.json +19 -0
- package/pkg/conformance/board/n02-broken-citation/expected.json +14 -0
- package/pkg/conformance/board/n02-broken-citation/expected.md +1 -0
- package/pkg/conformance/board/n02-broken-citation/input.json +24 -0
- package/pkg/conformance/board/n03-untested-requirement/expected.json +12 -0
- package/pkg/conformance/board/n03-untested-requirement/expected.md +1 -0
- package/pkg/conformance/board/n03-untested-requirement/input.json +23 -0
- package/pkg/conformance/board/n04-over-budget/expected.json +14 -0
- package/pkg/conformance/board/n04-over-budget/expected.md +1 -0
- package/pkg/conformance/board/n04-over-budget/input.json +20 -0
- package/pkg/conformance/board/p01-fresh-draft/expected.json +22 -0
- package/pkg/conformance/board/p01-fresh-draft/expected.md +2 -0
- package/pkg/conformance/board/p01-fresh-draft/input.json +20 -0
- package/pkg/conformance/board/p02-half-blessed/expected.json +34 -0
- package/pkg/conformance/board/p02-half-blessed/expected.md +3 -0
- package/pkg/conformance/board/p02-half-blessed/input.json +25 -0
- package/pkg/conformance/board/p03-sources-changed/expected.json +18 -0
- package/pkg/conformance/board/p03-sources-changed/expected.md +2 -0
- package/pkg/conformance/board/p03-sources-changed/input.json +24 -0
- package/pkg/conformance/board/p04-clean-all/expected.json +17 -0
- package/pkg/conformance/board/p04-clean-all/expected.md +1 -0
- package/pkg/conformance/board/p04-clean-all/input.json +25 -0
- package/pkg/conformance/board/p05-clean-default/expected.json +7 -0
- package/pkg/conformance/board/p05-clean-default/expected.md +1 -0
- package/pkg/conformance/board/p05-clean-default/input.json +25 -0
- package/pkg/conformance/board/p06-edited-only/expected.json +18 -0
- package/pkg/conformance/board/p06-edited-only/expected.md +2 -0
- package/pkg/conformance/board/p06-edited-only/input.json +23 -0
- package/pkg/conformance/board/p07-ux-part-2/expected.json +47 -0
- package/pkg/conformance/board/p07-ux-part-2/expected.md +7 -0
- package/pkg/conformance/board/p07-ux-part-2/input.json +26 -0
- package/pkg/conformance/card/README.md +34 -0
- package/pkg/conformance/card/n01-no-acceptance-block/expected.json +62 -0
- package/pkg/conformance/card/n01-no-acceptance-block/expected.md +7 -0
- package/pkg/conformance/card/n01-no-acceptance-block/input.json +94 -0
- package/pkg/conformance/card/n02-malformed-acceptance-block/expected.json +64 -0
- package/pkg/conformance/card/n02-malformed-acceptance-block/expected.md +8 -0
- package/pkg/conformance/card/n02-malformed-acceptance-block/input.json +99 -0
- package/pkg/conformance/card/n03-report-missing-not-checked/expected.json +85 -0
- package/pkg/conformance/card/n03-report-missing-not-checked/expected.md +9 -0
- package/pkg/conformance/card/n03-report-missing-not-checked/input.json +97 -0
- package/pkg/conformance/card/n04-nonzero-exit-after-passing-report/expected.json +84 -0
- package/pkg/conformance/card/n04-nonzero-exit-after-passing-report/expected.md +8 -0
- package/pkg/conformance/card/n04-nonzero-exit-after-passing-report/input.json +99 -0
- package/pkg/conformance/card/n05-bundle-refused-and-records-not-kept/expected.json +83 -0
- package/pkg/conformance/card/n05-bundle-refused-and-records-not-kept/expected.md +8 -0
- package/pkg/conformance/card/n05-bundle-refused-and-records-not-kept/input.json +98 -0
- package/pkg/conformance/card/n06-policy-load-failure-fallback/expected.json +93 -0
- package/pkg/conformance/card/n06-policy-load-failure-fallback/expected.md +9 -0
- package/pkg/conformance/card/n06-policy-load-failure-fallback/input.json +105 -0
- package/pkg/conformance/card/p01-clean-pass-success/expected.json +93 -0
- package/pkg/conformance/card/p01-clean-pass-success/expected.md +8 -0
- package/pkg/conformance/card/p01-clean-pass-success/input.json +101 -0
- package/pkg/conformance/card/p02-no-blessed-intent-badge/expected.json +62 -0
- package/pkg/conformance/card/p02-no-blessed-intent-badge/expected.md +5 -0
- package/pkg/conformance/card/p02-no-blessed-intent-badge/input.json +92 -0
- package/pkg/conformance/card/p03-matrix-shards-and-retry-merge/expected.json +93 -0
- package/pkg/conformance/card/p03-matrix-shards-and-retry-merge/expected.md +8 -0
- package/pkg/conformance/card/p03-matrix-shards-and-retry-merge/input.json +137 -0
- package/pkg/conformance/card/p04-blessings-changed-and-requirement-deltas/expected.json +122 -0
- package/pkg/conformance/card/p04-blessings-changed-and-requirement-deltas/expected.md +11 -0
- package/pkg/conformance/card/p04-blessings-changed-and-requirement-deltas/input.json +102 -0
- package/pkg/conformance/card/p05-workflow-and-protected-surfaces-would-block/expected.json +88 -0
- package/pkg/conformance/card/p05-workflow-and-protected-surfaces-would-block/expected.md +8 -0
- package/pkg/conformance/card/p05-workflow-and-protected-surfaces-would-block/input.json +101 -0
- package/pkg/conformance/card/p06-test-weakening-would-block/expected.json +99 -0
- package/pkg/conformance/card/p06-test-weakening-would-block/expected.md +8 -0
- package/pkg/conformance/card/p06-test-weakening-would-block/input.json +101 -0
- package/pkg/conformance/card/p07-only-skipped-cases/expected.json +80 -0
- package/pkg/conformance/card/p07-only-skipped-cases/expected.md +7 -0
- package/pkg/conformance/card/p07-only-skipped-cases/input.json +99 -0
- package/pkg/conformance/card/p08-coverage-not-confirmed/expected.json +80 -0
- package/pkg/conformance/card/p08-coverage-not-confirmed/expected.md +7 -0
- package/pkg/conformance/card/p08-coverage-not-confirmed/input.json +99 -0
- package/pkg/conformance/check/README.md +26 -0
- package/pkg/conformance/check/n01-missing-citation-file/expected.json +15 -0
- package/pkg/conformance/check/n01-missing-citation-file/input.json +25 -0
- package/pkg/conformance/check/n02-citation-out-of-range/expected.json +15 -0
- package/pkg/conformance/check/n02-citation-out-of-range/input.json +26 -0
- package/pkg/conformance/check/n03-missing-citation-heading/expected.json +15 -0
- package/pkg/conformance/check/n03-missing-citation-heading/input.json +26 -0
- package/pkg/conformance/check/n04-missing-citation-test/expected.json +15 -0
- package/pkg/conformance/check/n04-missing-citation-test/input.json +26 -0
- package/pkg/conformance/check/n05-changed-blessed-copy/expected.json +12 -0
- package/pkg/conformance/check/n05-changed-blessed-copy/input.json +29 -0
- package/pkg/conformance/check/n06-missing-blessed-copy/expected.json +12 -0
- package/pkg/conformance/check/n06-missing-blessed-copy/input.json +27 -0
- package/pkg/conformance/check/n07-two-blessed-ids/expected.json +12 -0
- package/pkg/conformance/check/n07-two-blessed-ids/input.json +32 -0
- package/pkg/conformance/check/n08-uncovered-vision/expected.json +8 -0
- package/pkg/conformance/check/n08-uncovered-vision/input.json +27 -0
- package/pkg/conformance/check/n09-ci-budget-crossing/expected.json +13 -0
- package/pkg/conformance/check/n09-ci-budget-crossing/input.json +47 -0
- package/pkg/conformance/check/n10-kit-edited/expected.json +12 -0
- package/pkg/conformance/check/n10-kit-edited/input.json +31 -0
- package/pkg/conformance/check/n11-lock-version-mismatch/expected.json +13 -0
- package/pkg/conformance/check/n11-lock-version-mismatch/input.json +31 -0
- package/pkg/conformance/check/n12-local-budget-warning/expected.json +10 -0
- package/pkg/conformance/check/n12-local-budget-warning/input.json +29 -0
- package/pkg/conformance/check/p01-covered-vision/expected.json +6 -0
- package/pkg/conformance/check/p01-covered-vision/input.json +29 -0
- package/pkg/conformance/check/p02-path-citation/expected.json +6 -0
- package/pkg/conformance/check/p02-path-citation/input.json +26 -0
- package/pkg/conformance/check/p03-doc-and-test-citations/expected.json +6 -0
- package/pkg/conformance/check/p03-doc-and-test-citations/input.json +27 -0
- package/pkg/conformance/check/p04-valid-blessed-copy/expected.json +6 -0
- package/pkg/conformance/check/p04-valid-blessed-copy/input.json +30 -0
- package/pkg/conformance/check/p05-unique-across-documents/expected.json +6 -0
- package/pkg/conformance/check/p05-unique-across-documents/input.json +32 -0
- package/pkg/conformance/check/p06-matching-lock-and-kit/expected.json +6 -0
- package/pkg/conformance/check/p06-matching-lock-and-kit/input.json +31 -0
- package/pkg/conformance/install/.gitattributes +1 -0
- package/pkg/conformance/install/README.md +40 -0
- package/pkg/conformance/install/environment.json +29 -0
- package/pkg/conformance/install/n01-git-executable-missing/args.json +17 -0
- package/pkg/conformance/install/n01-git-executable-missing/before/README.md +1 -0
- package/pkg/conformance/install/n02-not-a-git-repository/args.json +15 -0
- package/pkg/conformance/install/n02-not-a-git-repository/before/README.md +1 -0
- package/pkg/conformance/install/n02-not-a-git-repository/expected/01-init/result.json +4 -0
- package/pkg/conformance/install/n03-remove-recorded-parent-path/args.json +14 -0
- package/pkg/conformance/install/n03-remove-recorded-parent-path/before/.tenet/manifest.json +12 -0
- package/pkg/conformance/install/n03-remove-recorded-parent-path/before/README.md +1 -0
- package/pkg/conformance/install/n03-remove-recorded-parent-path/before/tenet.yaml +1 -0
- package/pkg/conformance/install/n03-remove-recorded-parent-path/expected/01-remove/result.json +4 -0
- package/pkg/conformance/install/n04-init-symlink-outside/args.json +22 -0
- package/pkg/conformance/install/n04-init-symlink-outside/before/package-lock.json +15 -0
- package/pkg/conformance/install/n04-init-symlink-outside/before/package.json +11 -0
- package/pkg/conformance/install/n04-init-symlink-outside/before/src/retry.ts +1 -0
- package/pkg/conformance/install/n04-init-symlink-outside/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/n04-init-symlink-outside/expected/01-init/result.json +4 -0
- package/pkg/conformance/install/n05-conflicting-created-workflow/args.json +12 -0
- package/pkg/conformance/install/n05-conflicting-created-workflow/before/.github/workflows/tenet.yml +3 -0
- package/pkg/conformance/install/n05-conflicting-created-workflow/before/package-lock.json +15 -0
- package/pkg/conformance/install/n05-conflicting-created-workflow/before/package.json +11 -0
- package/pkg/conformance/install/n05-conflicting-created-workflow/before/src/retry.ts +1 -0
- package/pkg/conformance/install/n05-conflicting-created-workflow/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/n05-conflicting-created-workflow/expected/01-init/result.json +4 -0
- package/pkg/conformance/install/n06-interrupted-plan-drift/args.json +27 -0
- package/pkg/conformance/install/n06-interrupted-plan-drift/before/AGENTS.md +1 -0
- package/pkg/conformance/install/n06-interrupted-plan-drift/before/package-lock.json +15 -0
- package/pkg/conformance/install/n06-interrupted-plan-drift/before/package.json +11 -0
- package/pkg/conformance/install/n06-interrupted-plan-drift/before/src/retry.ts +1 -0
- package/pkg/conformance/install/n06-interrupted-plan-drift/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/n07-doctor-missing-lock/args.json +11 -0
- package/pkg/conformance/install/n07-doctor-missing-lock/before/README.md +1 -0
- package/pkg/conformance/install/n07-doctor-missing-lock/before/tenet.yaml +2 -0
- package/pkg/conformance/install/n07-doctor-missing-lock/expected/01-doctor/tree/README.md +1 -0
- package/pkg/conformance/install/n07-doctor-missing-lock/expected/01-doctor/tree/tenet.yaml +2 -0
- package/pkg/conformance/install/n08-preflight-declined/args.json +14 -0
- package/pkg/conformance/install/n08-preflight-declined/before/AGENTS.md +1 -0
- package/pkg/conformance/install/n08-preflight-declined/before/package-lock.json +15 -0
- package/pkg/conformance/install/n08-preflight-declined/before/package.json +11 -0
- package/pkg/conformance/install/n08-preflight-declined/before/src/retry.ts +1 -0
- package/pkg/conformance/install/n08-preflight-declined/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/AGENTS.md +1 -0
- package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/package-lock.json +15 -0
- package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/package.json +11 -0
- package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/src/retry.ts +1 -0
- package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p01-empty/args.json +15 -0
- package/pkg/conformance/install/p01-empty/before/.gitkeep +0 -0
- package/pkg/conformance/install/p02-node-vitest/args.json +12 -0
- package/pkg/conformance/install/p02-node-vitest/before/.nvmrc +1 -0
- package/pkg/conformance/install/p02-node-vitest/before/package-lock.json +15 -0
- package/pkg/conformance/install/p02-node-vitest/before/package.json +11 -0
- package/pkg/conformance/install/p02-node-vitest/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p02-node-vitest/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p03-node-existing-ci/args.json +12 -0
- package/pkg/conformance/install/p03-node-existing-ci/before/.github/workflows/ci.yml +10 -0
- package/pkg/conformance/install/p03-node-existing-ci/before/package-lock.json +15 -0
- package/pkg/conformance/install/p03-node-existing-ci/before/package.json +11 -0
- package/pkg/conformance/install/p03-node-existing-ci/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p03-node-existing-ci/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p04-node-matrix/args.json +12 -0
- package/pkg/conformance/install/p04-node-matrix/before/.github/workflows/ci.yml +13 -0
- package/pkg/conformance/install/p04-node-matrix/before/package-lock.json +15 -0
- package/pkg/conformance/install/p04-node-matrix/before/package.json +11 -0
- package/pkg/conformance/install/p04-node-matrix/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p04-node-matrix/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p05-python-pytest/args.json +12 -0
- package/pkg/conformance/install/p05-python-pytest/before/.python-version +1 -0
- package/pkg/conformance/install/p05-python-pytest/before/requirements.txt +1 -0
- package/pkg/conformance/install/p05-python-pytest/before/tests/test_retry.py +2 -0
- package/pkg/conformance/install/p06-go/args.json +12 -0
- package/pkg/conformance/install/p06-go/before/go.mod +3 -0
- package/pkg/conformance/install/p06-go/before/retry_test.go +5 -0
- package/pkg/conformance/install/p07-existing-agents-md/args.json +12 -0
- package/pkg/conformance/install/p07-existing-agents-md/before/AGENTS.md +7 -0
- package/pkg/conformance/install/p07-existing-agents-md/before/package-lock.json +15 -0
- package/pkg/conformance/install/p07-existing-agents-md/before/package.json +11 -0
- package/pkg/conformance/install/p07-existing-agents-md/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p07-existing-agents-md/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p08-existing-mcp/args.json +12 -0
- package/pkg/conformance/install/p08-existing-mcp/before/.mcp.json +18 -0
- package/pkg/conformance/install/p08-existing-mcp/before/CLAUDE.md +1 -0
- package/pkg/conformance/install/p08-existing-mcp/before/package-lock.json +15 -0
- package/pkg/conformance/install/p08-existing-mcp/before/package.json +11 -0
- package/pkg/conformance/install/p08-existing-mcp/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p08-existing-mcp/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/args.json +33 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/.gitattributes +1 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/.github/pull_request_template.md +1 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/.mcp.json +18 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/AGENTS.md +3 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/CLAUDE.md +3 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/package-lock.json +15 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/package.json +11 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/tenet/intent.md +3 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/.gitattributes +1 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/.github/pull_request_template.md +1 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/.mcp.json +18 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/AGENTS.md +3 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/CLAUDE.md +3 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/package-lock.json +15 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/package.json +11 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/src/retry.ts +1 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/tenet/intent.md +3 -0
- package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/args.json +24 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/before/.mcp.json +18 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/before/CLAUDE.md +1 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/before/package-lock.json +15 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/before/package.json +11 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/before/tenet/intent.md +1 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/.mcp.json +16 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/CLAUDE.md +1 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/package-lock.json +15 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/package.json +11 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/src/retry.ts +1 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/tenet/intent.md +1 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/tenet.yaml +2 -0
- package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p11-interrupted-install-resumes/args.json +24 -0
- package/pkg/conformance/install/p11-interrupted-install-resumes/before/.mcp.json +18 -0
- package/pkg/conformance/install/p11-interrupted-install-resumes/before/CLAUDE.md +1 -0
- package/pkg/conformance/install/p11-interrupted-install-resumes/before/package-lock.json +15 -0
- package/pkg/conformance/install/p11-interrupted-install-resumes/before/package.json +11 -0
- package/pkg/conformance/install/p11-interrupted-install-resumes/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p11-interrupted-install-resumes/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p12-windows-local-host/args.json +26 -0
- package/pkg/conformance/install/p12-windows-local-host/before/.vscode/mcp.json +10 -0
- package/pkg/conformance/install/p12-windows-local-host/before/CLAUDE.md +1 -0
- package/pkg/conformance/install/p12-windows-local-host/before/package-lock.json +15 -0
- package/pkg/conformance/install/p12-windows-local-host/before/package.json +11 -0
- package/pkg/conformance/install/p12-windows-local-host/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p12-windows-local-host/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p13-existing-ci-with-services/args.json +12 -0
- package/pkg/conformance/install/p13-existing-ci-with-services/before/.github/workflows/ci.yml +16 -0
- package/pkg/conformance/install/p13-existing-ci-with-services/before/package-lock.json +15 -0
- package/pkg/conformance/install/p13-existing-ci-with-services/before/package.json +11 -0
- package/pkg/conformance/install/p13-existing-ci-with-services/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p13-existing-ci-with-services/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p14-reusable-workflow/args.json +12 -0
- package/pkg/conformance/install/p14-reusable-workflow/before/.github/workflows/ci.yml +5 -0
- package/pkg/conformance/install/p14-reusable-workflow/before/.github/workflows/reusable.yml +10 -0
- package/pkg/conformance/install/p14-reusable-workflow/before/package-lock.json +15 -0
- package/pkg/conformance/install/p14-reusable-workflow/before/package.json +11 -0
- package/pkg/conformance/install/p14-reusable-workflow/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p14-reusable-workflow/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p15-non-github-forge/args.json +15 -0
- package/pkg/conformance/install/p15-non-github-forge/before/package-lock.json +15 -0
- package/pkg/conformance/install/p15-non-github-forge/before/package.json +11 -0
- package/pkg/conformance/install/p15-non-github-forge/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p15-non-github-forge/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p16-vendor-fresh-clone/args.json +20 -0
- package/pkg/conformance/install/p16-vendor-fresh-clone/before/package-lock.json +15 -0
- package/pkg/conformance/install/p16-vendor-fresh-clone/before/package.json +11 -0
- package/pkg/conformance/install/p16-vendor-fresh-clone/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p16-vendor-fresh-clone/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p17-upgrade-pins-and-policy/args.json +24 -0
- package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/.cursor/mcp.json +10 -0
- package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/.mcp.json +18 -0
- package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/CLAUDE.md +1 -0
- package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/package-lock.json +15 -0
- package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/package.json +11 -0
- package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/test/retry.test.ts +3 -0
- package/pkg/conformance/install/p18-accepted-reporter-edit/args.json +15 -0
- package/pkg/conformance/install/p18-accepted-reporter-edit/before/.github/workflows/ci.yml +9 -0
- package/pkg/conformance/install/p18-accepted-reporter-edit/before/package-lock.json +15 -0
- package/pkg/conformance/install/p18-accepted-reporter-edit/before/package.json +11 -0
- package/pkg/conformance/install/p18-accepted-reporter-edit/before/src/retry.ts +1 -0
- package/pkg/conformance/install/p18-accepted-reporter-edit/before/test/retry.test.ts +3 -0
- package/pkg/conformance/scenarios/README.md +34 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/kit/TENET.md +3 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/src/retry.ts +3 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet/blessed/tenet__intent.md/requirements.md +1 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet/blessed/tenet__intent.md/requirements.md.anchors.json +10 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet/intent.md +7 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet.lock +7 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet.yaml +20 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/test/retry.test.ts +2 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/expected/04-card.md +9 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/expected/04-verify.json +92 -0
- package/pkg/conformance/scenarios/s01-tagged-test-never-ran/steps.json +88 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/kit/TENET.md +3 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/src/retry.ts +6 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet/blessed/tenet__intent.md/requirements.md +2 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet/blessed/tenet__intent.md/requirements.md.anchors.json +15 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet/intent.md +8 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet.lock +7 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet.yaml +20 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/test/retry.test.ts +2 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/expected/04-card.md +9 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/expected/04-verify.json +92 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/expected/05-card.md +10 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/expected/05-verify.json +107 -0
- package/pkg/conformance/scenarios/s02-implements-changed-same-commit/steps.json +101 -0
- package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/before/kit/TENET.md +3 -0
- package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/before/tenet/intent.md +7 -0
- package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/before/tenet.lock +7 -0
- package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/before/tenet.yaml +24 -0
- package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/expected/01-gate-fixture.json +48 -0
- package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/expected/02-check.json +106 -0
- package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/steps.json +79 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/kit/TENET.md +3 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/src/retry.ts +3 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/blessed/tenet__specs__prd.md/requirements.md +1 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/blessed/tenet__specs__prd.md/requirements.md.anchors.json +7 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/blessed/tenet__vision.md/vision.md +1 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/blessed/tenet__vision.md/vision.md.anchors.json +1 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/specs/plan.md +7 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/specs/prd.md +7 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/specs/tech-spec.md +7 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/specs/ux-spec.md +7 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/vision.md +7 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet.lock +7 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet.yaml +20 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/02-board.json +72 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/03-context.json +46 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/04-mcp.json +71 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/05-bless.json +13 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/06-context-sdk.json +38 -0
- package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/steps.json +98 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/kit/TENET.md +3 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/src/checkout/pay.ts +1 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/blessed/tenet__specs__prd.md/requirements.md +3 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/blessed/tenet__specs__prd.md/requirements.md.anchors.json +5 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/blessed/tenet__vision.md/vision.md +1 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/blessed/tenet__vision.md/vision.md.anchors.json +1 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/specs/plan.md +7 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/specs/prd.md +9 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/specs/tech-spec.md +7 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/specs/ux-spec.md +7 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/vision.md +7 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet.lock +7 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet.yaml +20 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/expected/01-context-tight.json +54 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/expected/02-mcp.json +79 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/expected/03-context-explicit.json +52 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/expected/04-context-zero.json +17 -0
- package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/steps.json +79 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/CODEOWNERS +2 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/kit/TENET.md +3 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/src/api/handler.ts +2007 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/src/billing/charge.ts +2007 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/src/shared/http.ts +3 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet/blessed/tenet__intent.md/requirements.md +2 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet/blessed/tenet__intent.md/requirements.md.anchors.json +11 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet/intent.md +8 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet.lock +7 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet.yaml +20 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/expected/01-onboard-initial.json +240 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/expected/05-onboard-refresh.json +252 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/expected/06-card.md +8 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/expected/06-verify.json +77 -0
- package/pkg/conformance/scenarios/s06-change-to-shared-helper/steps.json +122 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/.mcp.json +10 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/AGENTS.md +3 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/package.json +11 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/src/index.ts +1 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/test/index.test.ts +2 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/expected/01-interrupted-init.json +4 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/expected/02-init-resume.json +75 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/expected/03-doctor.json +40 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/expected/04-remove.json +44 -0
- package/pkg/conformance/scenarios/s07-install-interrupted-part-way/steps.json +56 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/kit/TENET.md +3 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/src/retry.ts +3 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/blessed/tenet__specs__prd.md/requirements.md +1 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/blessed/tenet__specs__prd.md/requirements.md.anchors.json +7 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/blessed/tenet__vision.md/vision.md +1 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/blessed/tenet__vision.md/vision.md.anchors.json +1 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/specs/plan.md +7 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/specs/prd.md +7 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/specs/tech-spec.md +7 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/specs/ux-spec.md +7 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/vision.md +7 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet.lock +7 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet.yaml +20 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/expected/02-context-clean.json +38 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/expected/04-context-drift.json +40 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/expected/05-bless.json +13 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/expected/05-log-entry.json +15 -0
- package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/steps.json +80 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/kit/TENET.md +3 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/src/retry.ts +3 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/blessed/tenet__specs__prd.md/checkout-retries.md +1 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/blessed/tenet__specs__prd.md/checkout-retries.md.anchors.json +5 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/blessed/tenet__vision.md/vision.md +1 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/blessed/tenet__vision.md/vision.md.anchors.json +1 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/specs/plan.md +7 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/specs/prd.md +7 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/specs/tech-spec.md +7 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/specs/ux-spec.md +7 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/vision.md +7 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet.lock +7 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet.yaml +20 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/before/test/retry.test.ts +2 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/expected/02-fix.json +34 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/expected/03-check.json +14 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/expected/04-board.json +56 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/expected/05-context.json +38 -0
- package/pkg/conformance/scenarios/s09-renamed-heading/steps.json +58 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/kit/TENET.md +3 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/src/retry.ts +3 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet/blessed/tenet__intent.md/requirements.md +1 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet/blessed/tenet__intent.md/requirements.md.anchors.json +7 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet/intent.md +7 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet.lock +7 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet.yaml +20 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/expected/04-card.md +8 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/expected/04-verify.json +77 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/expected/05-verify-closed.json +6 -0
- package/pkg/conformance/scenarios/s10-pr-closed-without-merging/steps.json +108 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/before/README.md +3 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/before/package.json +8 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/before/src/retry.ts +3 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/before/test/retry.test.ts +2 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/01-init.json +75 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/02-onboard-inventory.json +141 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/06-card.md +7 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/06-onboard-card.json +10 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/07-bless.json +13 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/08-remove.json +57 -0
- package/pkg/conformance/scenarios/s11-readme-walkthrough/steps.json +93 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/.claude/settings.json +1 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/.github/workflows/ci.yml +8 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/CODEOWNERS +1 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/README.md +3 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/docs/adr/0001-retries.md +1 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/docs/adr/0002-timeouts.md +1 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/docs/architecture.md +3 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/package.json +11 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/src/retry.ts +6 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/test/checkout.retry.test.ts +4 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/01-init.json +103 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/02-onboard-inventory.json +233 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/06-card.md +9 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/06-onboard-card.json +10 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/07-bless.json +13 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/08-board.json +34 -0
- package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/steps.json +98 -0
- package/pkg/conformance/scenarios/s13-ux-walkthrough-new/before/.gitkeep +0 -0
- package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/01-init.json +82 -0
- package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/04-onboard-inventory.json +188 -0
- package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/05-card.md +12 -0
- package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/05-onboard-card.json +10 -0
- package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/06-bless.json +13 -0
- package/pkg/conformance/scenarios/s13-ux-walkthrough-new/steps.json +76 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { message } from "../core/messages.js";
|
|
5
|
+
import { fail } from "../core/output.js";
|
|
6
|
+
import { loadPolicy, ownersFor, ruleMode } from "../policy/index.js";
|
|
7
|
+
import { match } from "../policy/selectors.js";
|
|
8
|
+
import { citationParts } from "../specs/anchors.js";
|
|
9
|
+
import { flags } from "../specs/flags.js";
|
|
10
|
+
import { parseDoc } from "../specs/parse.js";
|
|
11
|
+
import { sectionDigest } from "../specs/sections.js";
|
|
12
|
+
const alphaRules = [
|
|
13
|
+
"tests-not-weakened",
|
|
14
|
+
"protected-surfaces",
|
|
15
|
+
"acceptance-passed",
|
|
16
|
+
"citations-valid",
|
|
17
|
+
"budget",
|
|
18
|
+
];
|
|
19
|
+
const levelOrder = { L0: 0, L1: 1, L2: 2 };
|
|
20
|
+
function portable(value) {
|
|
21
|
+
return value.replaceAll("\\", "/").replace(/^\.\/+/, "").replace(/\/+/g, "/");
|
|
22
|
+
}
|
|
23
|
+
function localFile(cwd, value) {
|
|
24
|
+
const normalized = portable(value);
|
|
25
|
+
if (normalized.length === 0 ||
|
|
26
|
+
normalized.startsWith("/") ||
|
|
27
|
+
path.win32.isAbsolute(value) ||
|
|
28
|
+
normalized.split("/").includes("..")) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const root = path.resolve(cwd);
|
|
32
|
+
const target = path.resolve(root, ...normalized.split("/"));
|
|
33
|
+
const relative = path.relative(root, target);
|
|
34
|
+
if (relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative))
|
|
35
|
+
return null;
|
|
36
|
+
return target;
|
|
37
|
+
}
|
|
38
|
+
function reader(cwd, filename) {
|
|
39
|
+
const target = localFile(cwd, filename);
|
|
40
|
+
if (!target)
|
|
41
|
+
return null;
|
|
42
|
+
try {
|
|
43
|
+
return readFileSync(target, "utf8");
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error.code === "ENOENT")
|
|
47
|
+
return null;
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function asyncReader(cwd, filename) {
|
|
52
|
+
const target = localFile(cwd, filename);
|
|
53
|
+
if (!target)
|
|
54
|
+
return null;
|
|
55
|
+
try {
|
|
56
|
+
return await readFile(target, "utf8");
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (error.code === "ENOENT")
|
|
60
|
+
return null;
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function integrityFinding(filename, slug) {
|
|
65
|
+
return {
|
|
66
|
+
code: "TN-SPEC-BLESSED-COPY",
|
|
67
|
+
severity: "warning",
|
|
68
|
+
rule: null,
|
|
69
|
+
file: filename,
|
|
70
|
+
line: null,
|
|
71
|
+
message: `Blessed copy for section ${slug} is missing or changed on disk.`,
|
|
72
|
+
fix: `Run \`tenet bless\` to restore or re-bless section ${slug}.`,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function sectionFlags(section, cwd) {
|
|
76
|
+
return flags(section, (filename) => reader(cwd, filename));
|
|
77
|
+
}
|
|
78
|
+
function itemNumber(id) {
|
|
79
|
+
const match = /(\d+)$/.exec(id);
|
|
80
|
+
if (!match?.[1])
|
|
81
|
+
return Number.POSITIVE_INFINITY;
|
|
82
|
+
return Number.parseInt(match[1], 10);
|
|
83
|
+
}
|
|
84
|
+
function compareCandidates(left, right) {
|
|
85
|
+
const level = (levelOrder[left.level ?? ""] ?? 3) - (levelOrder[right.level ?? ""] ?? 3);
|
|
86
|
+
if (level !== 0)
|
|
87
|
+
return level;
|
|
88
|
+
const numbers = itemNumber(left.id) - itemNumber(right.id);
|
|
89
|
+
if (numbers !== 0 && Number.isFinite(numbers))
|
|
90
|
+
return numbers;
|
|
91
|
+
return left.id < right.id ? -1 : left.id > right.id ? 1 : 0;
|
|
92
|
+
}
|
|
93
|
+
function pathRelation(left, right) {
|
|
94
|
+
const first = portable(left).replace(/\/$/, "");
|
|
95
|
+
const second = portable(right).replace(/\/$/, "");
|
|
96
|
+
return first === second || first.startsWith(`${second}/`) || second.startsWith(`${first}/`);
|
|
97
|
+
}
|
|
98
|
+
function citedPath(cite) {
|
|
99
|
+
const parsed = citationParts(cite);
|
|
100
|
+
return parsed?.kind === "path" ? parsed.path : null;
|
|
101
|
+
}
|
|
102
|
+
function tokenCount(text) {
|
|
103
|
+
return Math.ceil(text.replaceAll("\r\n", "\n").replaceAll("\r", "\n").length / 4);
|
|
104
|
+
}
|
|
105
|
+
function requirementCandidates(copy, current, level, owner, computedFlags) {
|
|
106
|
+
const items = copy.sections.flatMap((section) => [
|
|
107
|
+
...section.requirements,
|
|
108
|
+
...section.vision_items,
|
|
109
|
+
]);
|
|
110
|
+
return items.map((item) => ({
|
|
111
|
+
id: item.id,
|
|
112
|
+
section: current.slug,
|
|
113
|
+
heading: current.heading,
|
|
114
|
+
level,
|
|
115
|
+
text: item.text,
|
|
116
|
+
flags: computedFlags,
|
|
117
|
+
owner,
|
|
118
|
+
cites: item.cites,
|
|
119
|
+
scope: item.scope,
|
|
120
|
+
appliesTo: [],
|
|
121
|
+
prose: false,
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
function hasProse(copy, idPrefix) {
|
|
125
|
+
const lines = copy.replace(/\n$/, "").split("\n");
|
|
126
|
+
const statement = new RegExp(`^\\s*[-*+]\\s+(?:${idPrefix}|V)-\\d+\\b`);
|
|
127
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
128
|
+
const line = lines[index] ?? "";
|
|
129
|
+
const next = lines[index + 1] ?? "";
|
|
130
|
+
if (line.includes("|") &&
|
|
131
|
+
line.split("|").some((cell) => cell.trim().toLowerCase().replace(/\s+/g, "") === "id") &&
|
|
132
|
+
/^\s*\|?(?:\s*:?-+:?\s*\|)+\s*$/.test(next)) {
|
|
133
|
+
index += 2;
|
|
134
|
+
while (index < lines.length && (lines[index] ?? "").includes("|"))
|
|
135
|
+
index += 1;
|
|
136
|
+
index -= 1;
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (line.trim() && !statement.test(line))
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
function sourceDocId(front, sourcePath) {
|
|
145
|
+
const tenet = front?.tenet;
|
|
146
|
+
if (tenet && typeof tenet === "object" && !Array.isArray(tenet)) {
|
|
147
|
+
const doc = tenet.doc;
|
|
148
|
+
if (typeof doc === "string" && doc.length > 0)
|
|
149
|
+
return doc;
|
|
150
|
+
}
|
|
151
|
+
return sourcePath;
|
|
152
|
+
}
|
|
153
|
+
function optionalDraft(section, sourcePath, integrityFailed = false) {
|
|
154
|
+
const ids = [
|
|
155
|
+
...section.requirements.map((item) => item.id),
|
|
156
|
+
...section.vision_items.map((item) => item.id),
|
|
157
|
+
];
|
|
158
|
+
const id = ids.length === 1 ? ids[0] : undefined;
|
|
159
|
+
return {
|
|
160
|
+
...(id ? { id } : {}),
|
|
161
|
+
section: section.slug,
|
|
162
|
+
path: sourcePath,
|
|
163
|
+
state: integrityFailed
|
|
164
|
+
? "draft"
|
|
165
|
+
: section.state === "deferred"
|
|
166
|
+
? "deferred"
|
|
167
|
+
: "draft",
|
|
168
|
+
text: section.text.replace(/\n$/, ""),
|
|
169
|
+
...(integrityFailed ? { integrity_failed: true } : {}),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
async function collect(input) {
|
|
173
|
+
const cwd = path.resolve(input.cwd ?? process.cwd());
|
|
174
|
+
const budget = input.budget_tokens ?? 4_000;
|
|
175
|
+
if (!Number.isFinite(budget) || budget <= 0) {
|
|
176
|
+
const words = message("TN-USAGE-BUDGET", { budget: String(input.budget_tokens) });
|
|
177
|
+
throw fail("TN-USAGE-BUDGET", words.message, words.fix);
|
|
178
|
+
}
|
|
179
|
+
if (input.paths !== undefined && (!Array.isArray(input.paths) || input.paths.some((value) => typeof value !== "string"))) {
|
|
180
|
+
const words = message("TN-USAGE-CONTEXT", {
|
|
181
|
+
command: "context",
|
|
182
|
+
detail: "paths must be strings",
|
|
183
|
+
});
|
|
184
|
+
throw fail("TN-USAGE-CONTEXT", words.message, words.fix);
|
|
185
|
+
}
|
|
186
|
+
if (input.ids !== undefined && (!Array.isArray(input.ids) || input.ids.some((value) => typeof value !== "string"))) {
|
|
187
|
+
const words = message("TN-USAGE-CONTEXT", {
|
|
188
|
+
command: "context",
|
|
189
|
+
detail: "IDs must be strings",
|
|
190
|
+
});
|
|
191
|
+
throw fail("TN-USAGE-CONTEXT", words.message, words.fix);
|
|
192
|
+
}
|
|
193
|
+
const policy = await loadPolicy({ cwd });
|
|
194
|
+
const candidates = [];
|
|
195
|
+
const allDrafts = [];
|
|
196
|
+
const findings = [];
|
|
197
|
+
let validBlessedSections = 0;
|
|
198
|
+
for (const document of policy.specs.documents) {
|
|
199
|
+
const sourcePath = `${policy.paths.records}/${portable(document.path)}`;
|
|
200
|
+
const text = await asyncReader(cwd, sourcePath);
|
|
201
|
+
if (text === null)
|
|
202
|
+
continue;
|
|
203
|
+
const parsed = parseDoc(sourcePath, text, { prefix: policy.specs.id_prefix });
|
|
204
|
+
const docId = sourceDocId(parsed.front, sourcePath);
|
|
205
|
+
for (const section of parsed.sections) {
|
|
206
|
+
const sectionLevel = section.level;
|
|
207
|
+
if (section.state !== "blessed") {
|
|
208
|
+
if (input.include_drafts && (section.state === "draft" || section.state === "deferred")) {
|
|
209
|
+
allDrafts.push(optionalDraft(section, sourcePath));
|
|
210
|
+
}
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const copyPath = section.blessed_copy ? portable(section.blessed_copy) : "";
|
|
214
|
+
const copy = copyPath ? await asyncReader(cwd, copyPath) : null;
|
|
215
|
+
const intact = copy !== null &&
|
|
216
|
+
section.blessed_digest !== null &&
|
|
217
|
+
sectionDigest(copy) === section.blessed_digest;
|
|
218
|
+
if (!intact || copy === null) {
|
|
219
|
+
findings.push(integrityFinding(sourcePath, section.slug));
|
|
220
|
+
allDrafts.push(optionalDraft(section, sourcePath, true));
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
validBlessedSections += 1;
|
|
224
|
+
const computedFlags = sectionFlags(section, cwd);
|
|
225
|
+
const owner = section.owner ?? ownersFor(sourcePath).join(", ");
|
|
226
|
+
const blessedDoc = parseDoc(copyPath, copy, { prefix: policy.specs.id_prefix });
|
|
227
|
+
const requirements = requirementCandidates(blessedDoc, section, sectionLevel, owner, computedFlags);
|
|
228
|
+
candidates.push(...requirements);
|
|
229
|
+
if (hasProse(copy, policy.specs.id_prefix)) {
|
|
230
|
+
candidates.push({
|
|
231
|
+
id: `${docId}#${section.slug}`,
|
|
232
|
+
section: section.slug,
|
|
233
|
+
heading: section.heading,
|
|
234
|
+
level: sectionLevel,
|
|
235
|
+
text: copy.replace(/\n$/, ""),
|
|
236
|
+
flags: computedFlags,
|
|
237
|
+
owner,
|
|
238
|
+
cites: [],
|
|
239
|
+
scope: null,
|
|
240
|
+
appliesTo: [...section.applies_to],
|
|
241
|
+
prose: true,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
const paths = [...new Set((input.paths ?? []).map(portable))];
|
|
247
|
+
const ids = new Set(input.ids ?? []);
|
|
248
|
+
const query = input.query?.toLowerCase();
|
|
249
|
+
const groups = [
|
|
250
|
+
{ reason: "global", candidates: candidates.filter((item) => !item.prose && item.scope === "global") },
|
|
251
|
+
{ reason: "id", candidates: candidates.filter((item) => !item.prose && ids.has(item.id)) },
|
|
252
|
+
{
|
|
253
|
+
reason: "path",
|
|
254
|
+
candidates: candidates.filter((item) => !item.prose &&
|
|
255
|
+
item.cites.some((cite) => {
|
|
256
|
+
const cited = citedPath(cite);
|
|
257
|
+
return cited !== null && paths.some((selected) => pathRelation(cited, selected));
|
|
258
|
+
})),
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
reason: "applies_to",
|
|
262
|
+
candidates: candidates.filter((item) => item.prose && paths.some((selected) => match(item.appliesTo, selected))),
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
reason: "query",
|
|
266
|
+
candidates: query === undefined
|
|
267
|
+
? []
|
|
268
|
+
: candidates.filter((item) => (!item.prose && item.text.toLowerCase().includes(query)) ||
|
|
269
|
+
item.heading.toLowerCase().includes(query)),
|
|
270
|
+
},
|
|
271
|
+
];
|
|
272
|
+
const admitted = new Set();
|
|
273
|
+
const omitted = [];
|
|
274
|
+
const blessed = [];
|
|
275
|
+
let used = 0;
|
|
276
|
+
for (const group of groups) {
|
|
277
|
+
for (const candidate of [...group.candidates].sort(compareCandidates)) {
|
|
278
|
+
if (admitted.has(candidate.id) || omitted.includes(candidate.id))
|
|
279
|
+
continue;
|
|
280
|
+
const tokens = tokenCount(candidate.text);
|
|
281
|
+
const explicit = ids.has(candidate.id);
|
|
282
|
+
if (explicit) {
|
|
283
|
+
blessed.push({
|
|
284
|
+
id: candidate.id,
|
|
285
|
+
section: candidate.section,
|
|
286
|
+
text: candidate.text,
|
|
287
|
+
flags: candidate.flags,
|
|
288
|
+
owner: candidate.owner,
|
|
289
|
+
reason: group.reason,
|
|
290
|
+
...(tokens > budget ? { over_budget: true } : {}),
|
|
291
|
+
});
|
|
292
|
+
admitted.add(candidate.id);
|
|
293
|
+
used = Math.min(budget, used + tokens);
|
|
294
|
+
}
|
|
295
|
+
else if (used + tokens <= budget) {
|
|
296
|
+
blessed.push({
|
|
297
|
+
id: candidate.id,
|
|
298
|
+
section: candidate.section,
|
|
299
|
+
text: candidate.text,
|
|
300
|
+
flags: candidate.flags,
|
|
301
|
+
owner: candidate.owner,
|
|
302
|
+
reason: group.reason,
|
|
303
|
+
});
|
|
304
|
+
admitted.add(candidate.id);
|
|
305
|
+
used += tokens;
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
omitted.push(candidate.id);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
const indexBudget = Math.floor(budget * 0.2);
|
|
313
|
+
const index = [];
|
|
314
|
+
const indexed = new Set();
|
|
315
|
+
let indexUsed = 0;
|
|
316
|
+
const remaining = candidates
|
|
317
|
+
.filter((item) => !item.prose && !admitted.has(item.id) && !omitted.includes(item.id))
|
|
318
|
+
.sort(compareCandidates);
|
|
319
|
+
for (const candidate of remaining) {
|
|
320
|
+
if (indexed.has(candidate.id))
|
|
321
|
+
continue;
|
|
322
|
+
const title = candidate.text.slice(0, 80);
|
|
323
|
+
const tokens = tokenCount(`${candidate.id} ${title}`);
|
|
324
|
+
if (indexUsed + tokens <= indexBudget) {
|
|
325
|
+
index.push({ id: candidate.id, title });
|
|
326
|
+
indexed.add(candidate.id);
|
|
327
|
+
indexUsed += tokens;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
const drafts = [];
|
|
331
|
+
const draftKeys = new Set();
|
|
332
|
+
for (const draft of allDrafts) {
|
|
333
|
+
const key = `${draft.path}\0${draft.section}\0${draft.integrity_failed === true ? "integrity" : "working"}`;
|
|
334
|
+
if (!draftKeys.has(key)) {
|
|
335
|
+
draftKeys.add(key);
|
|
336
|
+
drafts.push(draft);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
const result = {
|
|
340
|
+
blessed,
|
|
341
|
+
drafts,
|
|
342
|
+
index,
|
|
343
|
+
omitted,
|
|
344
|
+
truncated: omitted.length > 0,
|
|
345
|
+
rules: alphaRules.map((rule) => ({ rule, mode: ruleMode(policy, rule) })),
|
|
346
|
+
};
|
|
347
|
+
return { result, findings, validBlessedSections };
|
|
348
|
+
}
|
|
349
|
+
export async function context(input = {}) {
|
|
350
|
+
return (await collect(input)).result;
|
|
351
|
+
}
|
|
352
|
+
export async function contextWithFindings(input = {}) {
|
|
353
|
+
return collect(input);
|
|
354
|
+
}
|
|
355
|
+
export function contextSummary(result, findings = [], validBlessedSections = result.blessed.length + result.index.length) {
|
|
356
|
+
const lines = ["# Agent context", ""];
|
|
357
|
+
if (validBlessedSections === 0) {
|
|
358
|
+
lines.push("nothing blessed yet; run tenet bless", "");
|
|
359
|
+
}
|
|
360
|
+
lines.push(`## Blessed (${result.blessed.length})`);
|
|
361
|
+
for (const item of result.blessed) {
|
|
362
|
+
const notes = [
|
|
363
|
+
item.reason,
|
|
364
|
+
...(item.flags.length > 0 ? item.flags : []),
|
|
365
|
+
`owner: ${item.owner}`,
|
|
366
|
+
...(item.over_budget ? ["over_budget"] : []),
|
|
367
|
+
];
|
|
368
|
+
lines.push(`- ${item.id} — ${item.text} (${notes.join("; ")})`);
|
|
369
|
+
}
|
|
370
|
+
lines.push("", `## Drafts (${result.drafts.length})`);
|
|
371
|
+
for (const item of result.drafts) {
|
|
372
|
+
lines.push(`- ${item.id ?? item.section} — ${item.state}${item.integrity_failed ? "; integrity failed" : ""}`);
|
|
373
|
+
}
|
|
374
|
+
lines.push("", `## Index (${result.index.length})`, ...result.index.map((item) => `- ${item.id} — ${item.title}`), "", `## Omitted: ${result.omitted.length === 0 ? "none" : result.omitted.join(", ")}`, `## Rules: ${result.rules.map((item) => `${item.rule} (${item.mode})`).join(", ")}`);
|
|
375
|
+
if (findings.length > 0) {
|
|
376
|
+
lines.push("", ...findings.map((finding) => `> ${finding.code}: ${finding.message}`));
|
|
377
|
+
}
|
|
378
|
+
return `${lines.join("\n")}\n`;
|
|
379
|
+
}
|
|
380
|
+
export async function specificationStates(cwd = process.cwd()) {
|
|
381
|
+
const policy = await loadPolicy({ cwd: path.resolve(cwd) });
|
|
382
|
+
const specs = [];
|
|
383
|
+
for (const document of policy.specs.documents) {
|
|
384
|
+
const filename = `${policy.paths.records}/${portable(document.path)}`;
|
|
385
|
+
const text = await asyncReader(path.resolve(cwd), filename);
|
|
386
|
+
if (text === null)
|
|
387
|
+
continue;
|
|
388
|
+
const parsed = parseDoc(filename, text, { prefix: policy.specs.id_prefix });
|
|
389
|
+
for (const section of parsed.sections) {
|
|
390
|
+
specs.push({
|
|
391
|
+
path: filename,
|
|
392
|
+
section: section.slug,
|
|
393
|
+
level: section.level,
|
|
394
|
+
state: section.state,
|
|
395
|
+
flags: section.state === "blessed" ? sectionFlags(section, path.resolve(cwd)) : [],
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return { policy, specs };
|
|
400
|
+
}
|
|
401
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAgB,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAsD,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAmErD,MAAM,UAAU,GAAG;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,mBAAmB;IACnB,iBAAiB;IACjB,QAAQ;CACA,CAAC;AAEX,MAAM,UAAU,GAA2B,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AAEnE,SAAS,QAAQ,CAAC,KAAa;IAC7B,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAA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C5D,IAAI,IAAI,KAAK,IAAI;YAAE,SAAS;QAC5B,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;QAC5E,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC;gBACT,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,KAAK,EAAE,OAAO,CAAC,KAAoC;gBACnD,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,KAAK,EAAE,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;aACnF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function clockNow(clock) {
|
|
2
|
+
if (typeof clock === "function")
|
|
3
|
+
return clock();
|
|
4
|
+
if (clock instanceof Date)
|
|
5
|
+
return new Date(clock);
|
|
6
|
+
if (clock !== undefined)
|
|
7
|
+
return new Date(clock);
|
|
8
|
+
return new Date();
|
|
9
|
+
}
|
|
10
|
+
export function utcSeconds(clock) {
|
|
11
|
+
const value = clockNow(clock);
|
|
12
|
+
if (Number.isNaN(value.valueOf()))
|
|
13
|
+
throw new TypeError("clock returned an invalid time");
|
|
14
|
+
return value.toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=clock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/core/clock.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,QAAQ,CAAC,KAAiD;IACxE,IAAI,OAAO,KAAK,KAAK,UAAU;QAAE,OAAO,KAAK,EAAE,CAAC;IAChD,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAsC;IAC/D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;IACzF,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Finding } from "../types/generated.js";
|
|
2
|
+
export type Writable = {
|
|
3
|
+
write(value: string | Uint8Array): unknown;
|
|
4
|
+
};
|
|
5
|
+
export type CommandOption = {
|
|
6
|
+
flags: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
};
|
|
9
|
+
export type CommandContext = {
|
|
10
|
+
args: string[];
|
|
11
|
+
options: Record<string, string | boolean | string[]>;
|
|
12
|
+
cwd: string;
|
|
13
|
+
stdin: NodeJS.ReadableStream;
|
|
14
|
+
stdout: Writable;
|
|
15
|
+
stderr: Writable;
|
|
16
|
+
now: () => Date;
|
|
17
|
+
json: boolean;
|
|
18
|
+
quiet: boolean;
|
|
19
|
+
verbose: boolean;
|
|
20
|
+
offline: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type CommandOutcome<T = unknown> = {
|
|
23
|
+
value?: T;
|
|
24
|
+
result?: T;
|
|
25
|
+
findings?: Finding[];
|
|
26
|
+
exitCode?: number;
|
|
27
|
+
};
|
|
28
|
+
export type CommandSpec = {
|
|
29
|
+
name: string;
|
|
30
|
+
aliases?: string[];
|
|
31
|
+
description?: string;
|
|
32
|
+
usage?: string;
|
|
33
|
+
options?: CommandOption[] | string[];
|
|
34
|
+
network?: boolean;
|
|
35
|
+
checkEnvironment?: boolean;
|
|
36
|
+
run?: (context: CommandContext) => unknown | Promise<unknown>;
|
|
37
|
+
handler?: (context: CommandContext) => unknown | Promise<unknown>;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/core/commands.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { rename } from "node:fs/promises";
|
|
2
|
+
export declare function confine(value: string, root?: string): Promise<string>;
|
|
3
|
+
export declare function writeAtomic(filename: string, value: string | NodeJS.ArrayBufferView, options?: {
|
|
4
|
+
mode?: number;
|
|
5
|
+
renameFile?: typeof rename;
|
|
6
|
+
retryDelay?: (milliseconds: number) => Promise<void>;
|
|
7
|
+
}): Promise<void>;
|
package/dist/core/fs.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { lstat, mkdir, open, realpath, rename, rm } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
const retryableRenameCodes = new Set(["EPERM", "EBUSY", "EACCES"]);
|
|
5
|
+
function isWithin(root, target) {
|
|
6
|
+
const relative = path.relative(root, target);
|
|
7
|
+
return relative === "" || (!relative.startsWith(`..${path.sep}`) && relative !== ".." && !path.isAbsolute(relative));
|
|
8
|
+
}
|
|
9
|
+
async function nearestExisting(target) {
|
|
10
|
+
let current = target;
|
|
11
|
+
for (;;) {
|
|
12
|
+
try {
|
|
13
|
+
await lstat(current);
|
|
14
|
+
return current;
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
if (error.code !== "ENOENT")
|
|
18
|
+
throw error;
|
|
19
|
+
const parent = path.dirname(current);
|
|
20
|
+
if (parent === current)
|
|
21
|
+
throw error;
|
|
22
|
+
current = parent;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function pathEscape(value) {
|
|
27
|
+
const error = new Error(`TN-PATH-ESCAPE: path is outside the repository: ${value}`);
|
|
28
|
+
error.code = "TN-PATH-ESCAPE";
|
|
29
|
+
return error;
|
|
30
|
+
}
|
|
31
|
+
export async function confine(value, root = process.cwd()) {
|
|
32
|
+
if (typeof value !== "string" || value.length === 0 || value.includes("\0"))
|
|
33
|
+
throw pathEscape(value);
|
|
34
|
+
const portable = value.replaceAll("\\", "/");
|
|
35
|
+
if (path.posix.isAbsolute(portable) || path.win32.isAbsolute(value) || portable.startsWith("//")) {
|
|
36
|
+
throw pathEscape(value);
|
|
37
|
+
}
|
|
38
|
+
const parts = portable.split("/");
|
|
39
|
+
if (parts.includes(".."))
|
|
40
|
+
throw pathEscape(value);
|
|
41
|
+
const lexicalRoot = path.resolve(root);
|
|
42
|
+
const target = path.resolve(lexicalRoot, ...parts.filter((part) => part !== "" && part !== "."));
|
|
43
|
+
if (!isWithin(lexicalRoot, target))
|
|
44
|
+
throw pathEscape(value);
|
|
45
|
+
let rootReal;
|
|
46
|
+
try {
|
|
47
|
+
rootReal = await realpath(lexicalRoot);
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
throw pathEscape(value);
|
|
51
|
+
}
|
|
52
|
+
const existing = await nearestExisting(target);
|
|
53
|
+
const existingReal = await realpath(existing);
|
|
54
|
+
if (!isWithin(rootReal, existingReal))
|
|
55
|
+
throw pathEscape(value);
|
|
56
|
+
if (existing !== target) {
|
|
57
|
+
const suffix = path.relative(existing, target);
|
|
58
|
+
const resolved = path.resolve(existingReal, suffix);
|
|
59
|
+
if (!isWithin(rootReal, resolved))
|
|
60
|
+
throw pathEscape(value);
|
|
61
|
+
}
|
|
62
|
+
return target.replaceAll(path.sep, "/");
|
|
63
|
+
}
|
|
64
|
+
export async function writeAtomic(filename, value, options = {}) {
|
|
65
|
+
const parent = path.dirname(filename);
|
|
66
|
+
await mkdir(parent, { recursive: true });
|
|
67
|
+
const temporary = path.join(parent, `.${path.basename(filename)}.${process.pid}.${randomBytes(8).toString("hex")}.tmp`);
|
|
68
|
+
let handle;
|
|
69
|
+
try {
|
|
70
|
+
handle = await open(temporary, "wx", options.mode);
|
|
71
|
+
await handle.writeFile(value);
|
|
72
|
+
await handle.sync();
|
|
73
|
+
await handle.close();
|
|
74
|
+
handle = undefined;
|
|
75
|
+
const renameFile = options.renameFile ?? rename;
|
|
76
|
+
const retryDelay = options.retryDelay ?? ((milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)));
|
|
77
|
+
for (let attempt = 0; attempt < 6; attempt += 1) {
|
|
78
|
+
try {
|
|
79
|
+
await renameFile(temporary, filename);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
const code = error.code;
|
|
84
|
+
if (!retryableRenameCodes.has(code ?? "") || attempt >= 5)
|
|
85
|
+
throw error;
|
|
86
|
+
await retryDelay(10 * (attempt + 1));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
if (handle)
|
|
92
|
+
await handle.close().catch(() => undefined);
|
|
93
|
+
await rm(temporary, { force: true });
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/core/fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,IAAI,MAAM,WAAW,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AS,CAAC;QAEnB,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,MAAM,CAAC;QAChD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QACzH,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;YAChD,IAAI,CAAC;gBACH,MAAM,UAAU,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;gBACtC,OAAO;YACT,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,GAAI,KAA+B,CAAC,IAAI,CAAC;gBACnD,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,IAAI,OAAO,IAAI,CAAC;oBAAE,MAAM,KAAK,CAAC;gBACvE,MAAM,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,MAAM;YAAE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACxD,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrC,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type GitOptions = {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
env?: NodeJS.ProcessEnv;
|
|
4
|
+
input?: string | Uint8Array;
|
|
5
|
+
};
|
|
6
|
+
export declare function git(args: string[], options?: GitOptions): Promise<string>;
|
|
7
|
+
export declare function catFileBatch(ref: string, paths: string[], options?: Omit<GitOptions, "input">): Promise<Map<string, Buffer>>;
|
|
8
|
+
export declare function lastChangedMap(paths: string[], options?: Omit<GitOptions, "input">): Promise<Map<string, string>>;
|
|
9
|
+
export declare function writeRefFiles(ref: string, files: Record<string, string | Uint8Array>, message: string, options?: Omit<GitOptions, "input" | "env"> & {
|
|
10
|
+
now?: Date;
|
|
11
|
+
}): Promise<string>;
|