@deftai/directive-runtime 0.129.4 → 0.129.6
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/Taskfile.yml +235 -0
- package/UPGRADING.md +1 -0
- package/contracts/design-critique.md +1 -1
- package/contracts/path-write-fence.md +6 -0
- package/dist/applying-host-release.d.ts +16 -0
- package/dist/applying-host-release.js +98 -0
- package/dist/authz.d.ts +1 -1
- package/dist/authz.js +1 -1
- package/dist/check.d.ts +1 -0
- package/dist/check.js +27 -4
- package/dist/design-critique-ensure-arc-dest.d.ts +16 -0
- package/dist/design-critique-ensure-arc-dest.js +168 -0
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +8 -0
- package/dist/hook-dispatch.js +11 -5
- package/dist/human-presence-mint.d.ts +6 -1
- package/dist/human-presence-mint.js +20 -6
- package/dist/pre-pr-run.d.ts +7 -1
- package/dist/pre-pr-run.js +25 -1
- package/dist/session-start.js +40 -6
- package/dist/setup-wiring.d.ts +36 -0
- package/dist/setup-wiring.js +169 -14
- package/dist/verify-ac.d.ts +7 -2
- package/dist/verify-ac.js +13 -5
- package/dist/verify-source-cli/verify-deposit-closure.js +5 -5
- package/dist/windows-bin-ps1.d.ts +2 -2
- package/dist/windows-bin-ps1.js +5 -11
- package/docs/deft-directive-disable.md +3 -3
- package/docs/scope-provenance.md +4 -0
- package/package.json +2 -3
- package/packs/lessons/lessons-pack-0.1.json +15 -0
- package/packs/skills/skills-pack-0.1.json +2 -2
- package/skills/deft-directive-design-critique/SKILL.md +1 -1
- package/skills/deft-directive-release/SKILL.md +54 -1
- package/tasks/materialize.cjs +106 -5
- package/tasks/materialize.test.cjs +108 -0
- package/tasks/materialize.yml +14 -2
- package/vendor/directive-content/Taskfile.yml +235 -0
- package/vendor/directive-content/UPGRADING.md +1 -0
- package/vendor/directive-content/contracts/design-critique.md +1 -1
- package/vendor/directive-content/contracts/path-write-fence.md +6 -0
- package/vendor/directive-content/docs/deft-directive-disable.md +3 -3
- package/vendor/directive-content/docs/scope-provenance.md +4 -0
- package/vendor/directive-content/packs/lessons/lessons-pack-0.1.json +15 -0
- package/vendor/directive-content/packs/skills/skills-pack-0.1.json +2 -2
- package/vendor/directive-content/skills/deft-directive-design-critique/SKILL.md +1 -1
- package/vendor/directive-content/skills/deft-directive-release/SKILL.md +54 -1
- package/vendor/directive-content/tasks/materialize.cjs +106 -5
- package/vendor/directive-content/tasks/materialize.test.cjs +108 -0
- package/vendor/directive-content/tasks/materialize.yml +14 -2
- package/vendor/directive-core/dist/.tsbuildinfo +1 -1
- package/vendor/directive-core/dist/authz/classify.d.ts +18 -0
- package/vendor/directive-core/dist/authz/classify.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/classify.js +196 -14
- package/vendor/directive-core/dist/authz/classify.js.map +1 -1
- package/vendor/directive-core/dist/authz/evaluate.d.ts +5 -0
- package/vendor/directive-core/dist/authz/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/evaluate.js +15 -5
- package/vendor/directive-core/dist/authz/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/authz/templates.d.ts +2 -2
- package/vendor/directive-core/dist/authz/templates.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/templates.js +1 -0
- package/vendor/directive-core/dist/authz/templates.js.map +1 -1
- package/vendor/directive-core/dist/authz/types.d.ts +1 -1
- package/vendor/directive-core/dist/authz/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/types.js +2 -0
- package/vendor/directive-core/dist/authz/types.js.map +1 -1
- package/vendor/directive-core/dist/authz/verb-classification.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/verb-classification.js +30 -3
- package/vendor/directive-core/dist/authz/verb-classification.js.map +1 -1
- package/vendor/directive-core/dist/cache/fetch.d.ts.map +1 -1
- package/vendor/directive-core/dist/cache/fetch.js +50 -4
- package/vendor/directive-core/dist/cache/fetch.js.map +1 -1
- package/vendor/directive-core/dist/check/cached-orchestrator.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/cached-orchestrator.js +101 -2
- package/vendor/directive-core/dist/check/cached-orchestrator.js.map +1 -1
- package/vendor/directive-core/dist/check/context.d.ts +199 -0
- package/vendor/directive-core/dist/check/context.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/context.js +417 -2
- package/vendor/directive-core/dist/check/context.js.map +1 -1
- package/vendor/directive-core/dist/check/gate-lists.d.ts +42 -0
- package/vendor/directive-core/dist/check/gate-lists.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/gate-lists.js +226 -0
- package/vendor/directive-core/dist/check/gate-lists.js.map +1 -1
- package/vendor/directive-core/dist/check/index.d.ts +1 -0
- package/vendor/directive-core/dist/check/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/index.js +1 -0
- package/vendor/directive-core/dist/check/index.js.map +1 -1
- package/vendor/directive-core/dist/check/named-cause.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/named-cause.js +1 -0
- package/vendor/directive-core/dist/check/named-cause.js.map +1 -1
- package/vendor/directive-core/dist/check/orchestrator.d.ts +1 -0
- package/vendor/directive-core/dist/check/orchestrator.d.ts.map +1 -1
- package/vendor/directive-core/dist/check/orchestrator.js +69 -4
- package/vendor/directive-core/dist/check/orchestrator.js.map +1 -1
- package/vendor/directive-core/dist/design-critique/arc-dest.d.ts +22 -5
- package/vendor/directive-core/dist/design-critique/arc-dest.d.ts.map +1 -1
- package/vendor/directive-core/dist/design-critique/arc-dest.js +61 -0
- package/vendor/directive-core/dist/design-critique/arc-dest.js.map +1 -1
- package/vendor/directive-core/dist/design-critique/run-posture.d.ts +7 -2
- package/vendor/directive-core/dist/design-critique/run-posture.d.ts.map +1 -1
- package/vendor/directive-core/dist/design-critique/run-posture.js +6 -1
- package/vendor/directive-core/dist/design-critique/run-posture.js.map +1 -1
- package/vendor/directive-core/dist/finish-loop/pr-finish-loop.d.ts +7 -0
- package/vendor/directive-core/dist/finish-loop/pr-finish-loop.d.ts.map +1 -1
- package/vendor/directive-core/dist/finish-loop/pr-finish-loop.js +42 -0
- package/vendor/directive-core/dist/finish-loop/pr-finish-loop.js.map +1 -1
- package/vendor/directive-core/dist/hooks/classify/host-session-identity.d.ts +15 -2
- package/vendor/directive-core/dist/hooks/classify/host-session-identity.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/classify/host-session-identity.js +46 -5
- package/vendor/directive-core/dist/hooks/classify/host-session-identity.js.map +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.js +235 -22
- package/vendor/directive-core/dist/hooks/dispatcher.js.map +1 -1
- package/vendor/directive-core/dist/hooks/scope.d.ts +38 -9
- package/vendor/directive-core/dist/hooks/scope.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/scope.js +102 -16
- package/vendor/directive-core/dist/hooks/scope.js.map +1 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.d.ts +5 -0
- package/vendor/directive-core/dist/hooks/shell-write-targets.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.js +18 -1
- package/vendor/directive-core/dist/hooks/shell-write-targets.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.d.ts +5 -0
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.js +22 -9
- package/vendor/directive-core/dist/init-deposit/host-hook-outer.js.map +1 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.d.ts +8 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.d.ts.map +1 -1
- package/vendor/directive-core/dist/init-deposit/scaffold.js +38 -4
- package/vendor/directive-core/dist/init-deposit/scaffold.js.map +1 -1
- package/vendor/directive-core/dist/install-health/cheap.d.ts +13 -1
- package/vendor/directive-core/dist/install-health/cheap.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/cheap.js +39 -4
- package/vendor/directive-core/dist/install-health/cheap.js.map +1 -1
- package/vendor/directive-core/dist/install-health/constants.d.ts +18 -2
- package/vendor/directive-core/dist/install-health/constants.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/constants.js +18 -2
- package/vendor/directive-core/dist/install-health/constants.js.map +1 -1
- package/vendor/directive-core/dist/install-health/index.d.ts +1 -1
- package/vendor/directive-core/dist/install-health/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/index.js +1 -1
- package/vendor/directive-core/dist/install-health/index.js.map +1 -1
- package/vendor/directive-core/dist/policy/deft-directive-disable.d.ts +42 -5
- package/vendor/directive-core/dist/policy/deft-directive-disable.d.ts.map +1 -1
- package/vendor/directive-core/dist/policy/deft-directive-disable.js +71 -41
- package/vendor/directive-core/dist/policy/deft-directive-disable.js.map +1 -1
- package/vendor/directive-core/dist/policy/write-fence.d.ts +7 -0
- package/vendor/directive-core/dist/policy/write-fence.d.ts.map +1 -1
- package/vendor/directive-core/dist/policy/write-fence.js +81 -14
- package/vendor/directive-core/dist/policy/write-fence.js.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.d.ts +6 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.js +24 -12
- package/vendor/directive-core/dist/pr-closeout-attestable/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.d.ts +68 -14
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.js +278 -47
- package/vendor/directive-core/dist/pr-closeout-attestable/pr-head-assert.js.map +1 -1
- package/vendor/directive-core/dist/pr-closing-keywords/main.d.ts +19 -0
- package/vendor/directive-core/dist/pr-closing-keywords/main.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-closing-keywords/main.js +31 -16
- package/vendor/directive-core/dist/pr-closing-keywords/main.js.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/compute.d.ts +8 -0
- package/vendor/directive-core/dist/pr-merge-readiness/compute.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/compute.js +54 -2
- package/vendor/directive-core/dist/pr-merge-readiness/compute.js.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/gh.d.ts +7 -0
- package/vendor/directive-core/dist/pr-merge-readiness/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/gh.js +180 -49
- package/vendor/directive-core/dist/pr-merge-readiness/gh.js.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/main.d.ts +2 -0
- package/vendor/directive-core/dist/pr-merge-readiness/main.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-merge-readiness/main.js +1 -0
- package/vendor/directive-core/dist/pr-merge-readiness/main.js.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/monitor.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/monitor.js +1 -0
- package/vendor/directive-core/dist/pr-monitor/monitor.js.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/readiness.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/readiness.js +1 -0
- package/vendor/directive-core/dist/pr-monitor/readiness.js.map +1 -1
- package/vendor/directive-core/dist/pr-monitor/types.d.ts +2 -0
- package/vendor/directive-core/dist/pr-monitor/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/cascade.d.ts +6 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/cascade.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/cascade.js +27 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/cascade.js.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/constants.d.ts +15 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/constants.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/constants.js +18 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/constants.js.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/index.d.ts +2 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/index.js +2 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/index.js.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/semantic-green.d.ts +81 -0
- package/vendor/directive-core/dist/pr-wait-mergeable/semantic-green.d.ts.map +1 -1
- package/vendor/directive-core/dist/pr-wait-mergeable/semantic-green.js +687 -3
- package/vendor/directive-core/dist/pr-wait-mergeable/semantic-green.js.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/controller.d.ts +59 -1
- package/vendor/directive-core/dist/pre-pr-controller/controller.d.ts.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/controller.js +155 -2
- package/vendor/directive-core/dist/pre-pr-controller/controller.js.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/index.d.ts +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/index.js +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/index.js.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/phases.d.ts +7 -0
- package/vendor/directive-core/dist/pre-pr-controller/phases.d.ts.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/phases.js +11 -0
- package/vendor/directive-core/dist/pre-pr-controller/phases.js.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/types.d.ts +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/pre-pr-controller/types.js.map +1 -1
- package/vendor/directive-core/dist/preflight-gh/pre-push.d.ts.map +1 -1
- package/vendor/directive-core/dist/preflight-gh/pre-push.js +58 -2
- package/vendor/directive-core/dist/preflight-gh/pre-push.js.map +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.d.ts +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.d.ts.map +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.js +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/acceptance-resolver.js.map +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/index.d.ts +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/index.js +1 -1
- package/vendor/directive-core/dist/product-first-done-gate/index.js.map +1 -1
- package/vendor/directive-core/dist/release/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/gh.js +2 -1
- package/vendor/directive-core/dist/release/gh.js.map +1 -1
- package/vendor/directive-core/dist/release/pipeline.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/pipeline.js +13 -1
- package/vendor/directive-core/dist/release/pipeline.js.map +1 -1
- package/vendor/directive-core/dist/release/preflight.d.ts +11 -0
- package/vendor/directive-core/dist/release/preflight.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/preflight.js +65 -0
- package/vendor/directive-core/dist/release/preflight.js.map +1 -1
- package/vendor/directive-core/dist/release/types.d.ts +4 -0
- package/vendor/directive-core/dist/release/types.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/version.d.ts +4 -2
- package/vendor/directive-core/dist/release/version.d.ts.map +1 -1
- package/vendor/directive-core/dist/release/version.js +4 -2
- package/vendor/directive-core/dist/release/version.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/gh-api.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/gh-api.js +4 -2
- package/vendor/directive-core/dist/release-publish/gh-api.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/main.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/main.js +15 -4
- package/vendor/directive-core/dist/release-publish/main.js.map +1 -1
- package/vendor/directive-core/dist/release-publish/pipeline.d.ts +11 -0
- package/vendor/directive-core/dist/release-publish/pipeline.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-publish/pipeline.js +143 -2
- package/vendor/directive-core/dist/release-publish/pipeline.js.map +1 -1
- package/vendor/directive-core/dist/release-rollback/gh.d.ts.map +1 -1
- package/vendor/directive-core/dist/release-rollback/gh.js +2 -1
- package/vendor/directive-core/dist/release-rollback/gh.js.map +1 -1
- package/vendor/directive-core/dist/scope/delivery-evidence.d.ts +37 -0
- package/vendor/directive-core/dist/scope/delivery-evidence.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope/delivery-evidence.js +106 -6
- package/vendor/directive-core/dist/scope/delivery-evidence.js.map +1 -1
- package/vendor/directive-core/dist/scope/transition.d.ts +3 -1
- package/vendor/directive-core/dist/scope/transition.d.ts.map +1 -1
- package/vendor/directive-core/dist/scope/transition.js +4 -0
- package/vendor/directive-core/dist/scope/transition.js.map +1 -1
- package/vendor/directive-core/dist/session/git.d.ts +21 -2
- package/vendor/directive-core/dist/session/git.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/git.js +21 -4
- package/vendor/directive-core/dist/session/git.js.map +1 -1
- package/vendor/directive-core/dist/session/occupancy.d.ts +93 -6
- package/vendor/directive-core/dist/session/occupancy.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/occupancy.js +215 -52
- package/vendor/directive-core/dist/session/occupancy.js.map +1 -1
- package/vendor/directive-core/dist/session/session-start.d.ts.map +1 -1
- package/vendor/directive-core/dist/session/session-start.js +5 -2
- package/vendor/directive-core/dist/session/session-start.js.map +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.d.ts +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/dest-place.js +36 -41
- package/vendor/directive-core/dist/swarm/dest-place.js.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-owed.d.ts +14 -0
- package/vendor/directive-core/dist/swarm/finalize-owed.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/finalize-owed.js +214 -48
- package/vendor/directive-core/dist/swarm/finalize-owed.js.map +1 -1
- package/vendor/directive-core/dist/swarm/launch.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/launch.js +15 -4
- package/vendor/directive-core/dist/swarm/launch.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktree-pm-install.d.ts +49 -2
- package/vendor/directive-core/dist/swarm/worktree-pm-install.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktree-pm-install.js +207 -12
- package/vendor/directive-core/dist/swarm/worktree-pm-install.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees-cli.d.ts +6 -0
- package/vendor/directive-core/dist/swarm/worktrees-cli.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees-cli.js +79 -2
- package/vendor/directive-core/dist/swarm/worktrees-cli.js.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees.d.ts +12 -1
- package/vendor/directive-core/dist/swarm/worktrees.d.ts.map +1 -1
- package/vendor/directive-core/dist/swarm/worktrees.js +34 -26
- package/vendor/directive-core/dist/swarm/worktrees.js.map +1 -1
- package/vendor/directive-core/dist/verify-ac/evaluate.d.ts +52 -0
- package/vendor/directive-core/dist/verify-ac/evaluate.d.ts.map +1 -1
- package/vendor/directive-core/dist/verify-ac/evaluate.js +361 -1
- package/vendor/directive-core/dist/verify-ac/evaluate.js.map +1 -1
- package/vendor/directive-core/dist/verify-ac/index.d.ts +1 -1
- package/vendor/directive-core/dist/verify-ac/index.d.ts.map +1 -1
- package/vendor/directive-core/dist/verify-ac/index.js +1 -1
- package/vendor/directive-core/dist/verify-ac/index.js.map +1 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { closedVerbEnvBypassKey, evaluateClosedVerb } from "../authz/closed-verb.js";
|
|
2
|
-
import { listActiveHumanGrants, loadAuthzState, loadGrant, markGrantUsed } from "../authz/store.js";
|
|
2
|
+
import { claimSingleUseGrantForApply, listActiveHumanGrants, loadAuthzState, loadGrant, markGrantUsed, } from "../authz/store.js";
|
|
3
3
|
import { loadVerbClassification } from "../authz/verb-classification.js";
|
|
4
4
|
import { EXIT_OK, EXIT_VIOLATION } from "../release/constants.js";
|
|
5
|
+
import { resolveGh } from "../release/gh.js";
|
|
6
|
+
import { spawnText } from "../release/spawn.js";
|
|
7
|
+
import { plainGhEnv } from "../subprocess/plain-gh-env.js";
|
|
5
8
|
import { editReleasePublish, viewRelease } from "./gh-api.js";
|
|
6
9
|
export function emit(label, status) {
|
|
7
10
|
process.stderr.write(`[publish] ${label}... ${status}\n`);
|
|
@@ -27,13 +30,151 @@ export function evaluateReleasePublishGate(version, projectRoot, options = {}) {
|
|
|
27
30
|
classification,
|
|
28
31
|
});
|
|
29
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Fail-closed gate before npm latest promotion (#5852 P2 / Greptile P1).
|
|
35
|
+
* release-publish grants / DEFT_ALLOW_RELEASE_PUBLISH do not authorize this verb.
|
|
36
|
+
*/
|
|
37
|
+
export function evaluateReleasePromoteLatestGate(version, projectRoot, options = {}) {
|
|
38
|
+
const classification = loadVerbClassification(projectRoot);
|
|
39
|
+
const state = loadAuthzState(projectRoot);
|
|
40
|
+
const grants = options.grants ?? listActiveHumanGrants(projectRoot, state);
|
|
41
|
+
return evaluateClosedVerb({
|
|
42
|
+
verb: "release-promote-latest",
|
|
43
|
+
target: version,
|
|
44
|
+
grants,
|
|
45
|
+
env: options.env ?? process.env,
|
|
46
|
+
projectRoot,
|
|
47
|
+
repo: options.repo ?? null,
|
|
48
|
+
classification,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function emitPromote(label, status) {
|
|
52
|
+
process.stderr.write(`[promote-latest] ${label}... ${status}\n`);
|
|
53
|
+
}
|
|
54
|
+
/** Dispatch promote-latest workflow only after the closed-verb gate allows. */
|
|
55
|
+
export function runPromoteLatest(config, seams = {}) {
|
|
56
|
+
const { version, repo, dryRun, projectRoot } = config;
|
|
57
|
+
const tag = `v${version}`;
|
|
58
|
+
// Workflow promote-latest accepts only stable vX.Y.Z; refuse earlier so grants are not spent (#5852).
|
|
59
|
+
if (!/^[0-9]+\.[0-9]+\.[0-9]+$/.test(version)) {
|
|
60
|
+
emitPromote(`Stable version gate ${tag}`, "FAIL (only a stable X.Y.Z may be promoted to latest)");
|
|
61
|
+
return EXIT_VIOLATION;
|
|
62
|
+
}
|
|
63
|
+
const gateSeams = seams;
|
|
64
|
+
const gate = evaluateReleasePromoteLatestGate(version, projectRoot, {
|
|
65
|
+
grants: gateSeams.closedVerbGrants,
|
|
66
|
+
env: gateSeams.closedVerbEnv,
|
|
67
|
+
repo,
|
|
68
|
+
});
|
|
69
|
+
if (!gate.allowed) {
|
|
70
|
+
const bypassKey = gate.envBypassKey ??
|
|
71
|
+
closedVerbEnvBypassKey("release-promote-latest", projectRoot) ??
|
|
72
|
+
"DEFT_ALLOW_RELEASE_PROMOTE_LATEST";
|
|
73
|
+
emitPromote(`Closed-verb gate release-promote-latest ${tag}`, `FAIL (${gate.code}: ${gate.reason})`);
|
|
74
|
+
process.stderr.write(`[promote-latest] denied code=${gate.code} — set ${bypassKey}=1 or ` +
|
|
75
|
+
`mint \`deft authz:grant -- --template release-promote-latest --target ${version}\`\n`);
|
|
76
|
+
return EXIT_VIOLATION;
|
|
77
|
+
}
|
|
78
|
+
emitPromote(`Closed-verb gate release-promote-latest ${tag}`, `OK (${gate.code}${gate.humanApprovalRef !== null ? ` grant=${gate.humanApprovalRef}` : ""})`);
|
|
79
|
+
const args = [
|
|
80
|
+
"workflow",
|
|
81
|
+
"run",
|
|
82
|
+
"npm-publish.yml",
|
|
83
|
+
"--repo",
|
|
84
|
+
repo,
|
|
85
|
+
"--ref",
|
|
86
|
+
"master",
|
|
87
|
+
"-f",
|
|
88
|
+
"action=promote-latest",
|
|
89
|
+
"-f",
|
|
90
|
+
`tag=${tag}`,
|
|
91
|
+
];
|
|
92
|
+
const label = `Dispatch promote-latest ${tag} on ${repo}`;
|
|
93
|
+
if (dryRun) {
|
|
94
|
+
emitPromote(label, `DRYRUN (would run \`gh ${args.join(" ")}\`)`);
|
|
95
|
+
return EXIT_OK;
|
|
96
|
+
}
|
|
97
|
+
const ghPath = resolveGh(seams);
|
|
98
|
+
if (ghPath === null) {
|
|
99
|
+
emitPromote(label, "FAIL (gh CLI not found on PATH)");
|
|
100
|
+
return EXIT_VIOLATION;
|
|
101
|
+
}
|
|
102
|
+
const spawn = seams.spawnText ?? spawnText;
|
|
103
|
+
// Returned-failure only (no throw): operational gh miss / non-zero are caller-may-retry
|
|
104
|
+
// (#5852 intent-constraint / Greptile P2). plainGhEnv drops color-force vars (#6032).
|
|
105
|
+
const dispatchOnce = () => {
|
|
106
|
+
let result;
|
|
107
|
+
try {
|
|
108
|
+
result = spawn(ghPath, args, { timeoutMs: 120_000, env: plainGhEnv() });
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return { ok: false, reason: "gh CLI not found on PATH" };
|
|
112
|
+
}
|
|
113
|
+
if (result.status !== 0) {
|
|
114
|
+
return {
|
|
115
|
+
ok: false,
|
|
116
|
+
reason: (result.stderr ?? "").trim() || "gh workflow run failed",
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
return { ok: true };
|
|
120
|
+
};
|
|
121
|
+
// Exclusive claim → revalidate → permanent spend, THEN dispatch (#5852 Greptile P1).
|
|
122
|
+
// Do not put dispatch in claim `apply`: a lost/ambiguous gh response must not roll
|
|
123
|
+
// usedAt back (that would let one approval queue promote-latest twice). Remint on
|
|
124
|
+
// true dispatch failure. Concurrent claimants fail closed on the lock.
|
|
125
|
+
if (gate.humanApprovalRef !== null && gate.code === "closed-verb-allow") {
|
|
126
|
+
const gateSeamsClaim = seams;
|
|
127
|
+
const claim = gateSeamsClaim.claimGrant ?? claimSingleUseGrantForApply;
|
|
128
|
+
const claimed = claim(projectRoot, gate.humanApprovalRef, {
|
|
129
|
+
revalidate: (g) => {
|
|
130
|
+
if (g.semantics.revokedAt !== null) {
|
|
131
|
+
return { ok: false, reason: `grant ${g.id} revoked` };
|
|
132
|
+
}
|
|
133
|
+
if (g.semantics.expiresAt !== null && Date.parse(g.semantics.expiresAt) <= Date.now()) {
|
|
134
|
+
return { ok: false, reason: `grant ${g.id} expired` };
|
|
135
|
+
}
|
|
136
|
+
const again = evaluateReleasePromoteLatestGate(version, projectRoot, {
|
|
137
|
+
grants: [g],
|
|
138
|
+
env: gateSeams.closedVerbEnv ?? {},
|
|
139
|
+
repo,
|
|
140
|
+
});
|
|
141
|
+
if (!again.allowed || again.code !== "closed-verb-allow") {
|
|
142
|
+
return {
|
|
143
|
+
ok: false,
|
|
144
|
+
reason: again.reason || `grant ${g.id} no longer authorizes promote-latest`,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return { ok: true };
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
if (!claimed.ok) {
|
|
151
|
+
emitPromote(label, `FAIL (${claimed.reason})`);
|
|
152
|
+
return EXIT_VIOLATION;
|
|
153
|
+
}
|
|
154
|
+
emitPromote(`Spend grant ${gate.humanApprovalRef}`, "OK (claimed before dispatch)");
|
|
155
|
+
const dispatched = dispatchOnce();
|
|
156
|
+
if (!dispatched.ok) {
|
|
157
|
+
emitPromote(label, `FAIL (${dispatched.reason}; grant already spent — remint to retry)`);
|
|
158
|
+
return EXIT_VIOLATION;
|
|
159
|
+
}
|
|
160
|
+
emitPromote(label, "OK (workflow dispatched; grant claimed before dispatch)");
|
|
161
|
+
return EXIT_OK;
|
|
162
|
+
}
|
|
163
|
+
const dispatched = dispatchOnce();
|
|
164
|
+
if (!dispatched.ok) {
|
|
165
|
+
emitPromote(label, `FAIL (${dispatched.reason})`);
|
|
166
|
+
return EXIT_VIOLATION;
|
|
167
|
+
}
|
|
168
|
+
emitPromote(label, "OK (workflow dispatched)");
|
|
169
|
+
return EXIT_OK;
|
|
170
|
+
}
|
|
30
171
|
export function runPublish(config, seams = {}) {
|
|
31
172
|
const { version, repo, dryRun, projectRoot } = config;
|
|
32
173
|
const tag = `v${version}`;
|
|
33
174
|
const viewLabel = `View ${tag} on ${repo}`;
|
|
34
175
|
if (dryRun) {
|
|
35
176
|
emit(viewLabel, `DRYRUN (would run \`gh api --paginate repos/${repo}/releases?per_page=100\` and filter for tag_name == ${tag})`);
|
|
36
|
-
emit(`Edit ${tag}`, `DRYRUN (would run \`gh api -X PATCH repos/${repo}/releases/<id> -F draft=false\`)`);
|
|
177
|
+
emit(`Edit ${tag}`, `DRYRUN (would run \`gh api -X PATCH repos/${repo}/releases/<id> -F draft=false -f make_latest=false\`)`);
|
|
37
178
|
return EXIT_OK;
|
|
38
179
|
}
|
|
39
180
|
const [state, payload, reason] = viewRelease(version, repo, seams);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/release-publish/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAe,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/release-publish/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAe,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,cAAc,EACd,SAAS,EACT,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG9D,MAAM,UAAU,IAAI,CAAC,KAAa,EAAE,MAAc;IAChD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAA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AAI,IAAI,CAAC,gBAAgB,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACxE,MAAM,cAAc,GAAG,KAEtB,CAAC;QACF,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,IAAI,aAAa,CAAC;QACzD,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACxD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC7D,IAAI,MAAM,EAAE,SAAS,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;gBACpE,IAAI,CACF,eAAe,IAAI,CAAC,gBAAgB,EAAE,EACtC,8EAA8E,CAC/E,CAAC;gBACF,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,WAAW,GAAG,iBAAiB,IAAI,eAAe,IAAI,CAAC,gBAAgB,kDAAkD,CAC1H,CAAC;gBACF,OAAO,cAAc,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,8BAA8B,IAAI,KAAK,CAAC,CAAC;IAC5E,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gh.d.ts","sourceRoot":"","sources":["../../src/release-rollback/gh.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gh.d.ts","sourceRoot":"","sources":["../../src/release-rollback/gh.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAElE,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,aAAkB,GACxB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,EAAE,MAAM,CAAC,CAwC5C;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,aAAkB,GACxB,CAAC,QAAQ,GAAG,WAAW,GAAG,OAAO,EAAE,gBAAgB,GAAG,IAAI,EAAE,MAAM,CAAC,CAUrE;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,aAAkB,GACxB,CAAC,OAAO,EAAE,MAAM,CAAC,CAwBnB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolveGh, spawnText } from "../release/index.js";
|
|
2
|
+
import { plainGhEnv } from "../subprocess/plain-gh-env.js";
|
|
2
3
|
export function ghReleaseViewJson(version, repo, seams = {}) {
|
|
3
4
|
if (seams.ghReleaseViewJson) {
|
|
4
5
|
return seams.ghReleaseViewJson(version, repo);
|
|
@@ -20,7 +21,7 @@ export function ghReleaseViewJson(version, repo, seams = {}) {
|
|
|
20
21
|
"isDraft,name,tagName,createdAt,publishedAt,assets,url",
|
|
21
22
|
], {
|
|
22
23
|
timeoutMs: 60_000,
|
|
23
|
-
env:
|
|
24
|
+
env: plainGhEnv(),
|
|
24
25
|
});
|
|
25
26
|
if (result.status !== 0) {
|
|
26
27
|
return [false, null, result.stderr.trim()];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gh.js","sourceRoot":"","sources":["../../src/release-rollback/gh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG3D,MAAM,UAAU,iBAAiB,CAC/B,OAAe,EACf,IAAY,EACZ,QAAuB,EAAE;IAEzB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IA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,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,IAAY,EACZ,QAAuB,EAAE;IAEzB,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC;IAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC;IAC3C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,KAAK,CAClB,MAAM,EACN,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,EACpE;YACE,SAAS,EAAE,MAAM;YACjB,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE;SACxB,CACF,CAAC;QACF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,CAAC,KAAK,EAAE,6BAA6B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,qBAAqB,CAAC,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
|
@@ -62,6 +62,12 @@ export interface CompletionProvenance {
|
|
|
62
62
|
* Consumers read sibling `plan.metadata.completedSessionId`, not this field.
|
|
63
63
|
*/
|
|
64
64
|
readonly completedSessionId?: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* How the story→PR identity was proven. Absent means the forge closer set
|
|
67
|
+
* (closingIssuesReferences). `brief-in-pr-diff` means the PR added this brief
|
|
68
|
+
* itself because the issue was linked after merge (#3675 fallback).
|
|
69
|
+
*/
|
|
70
|
+
readonly identityBasis?: StoryPrIdentityBasis;
|
|
65
71
|
}
|
|
66
72
|
export interface DeliveryEvidenceInput {
|
|
67
73
|
readonly repository?: string | null;
|
|
@@ -98,6 +104,13 @@ export interface ClosingIssueRef {
|
|
|
98
104
|
* Each entry MUST preserve its own repository (cross-repo closers).
|
|
99
105
|
*/
|
|
100
106
|
export type FetchClosingIssueIdsFn = (prNumber: number, repository: string) => ClosingIssueRef[] | null;
|
|
107
|
+
/** One changed file in a PR (REST `pulls/{n}/files`). */
|
|
108
|
+
export interface PrChangedFile {
|
|
109
|
+
readonly filename: string;
|
|
110
|
+
readonly status: string;
|
|
111
|
+
}
|
|
112
|
+
/** Changed files of a PR, or null on lookup failure (fail closed). */
|
|
113
|
+
export type FetchPrChangedFilesFn = (prNumber: number, repository: string) => PrChangedFile[] | null;
|
|
101
114
|
export interface DeliveryGateOptions {
|
|
102
115
|
readonly projectRoot: string;
|
|
103
116
|
readonly plan: Record<string, unknown>;
|
|
@@ -119,6 +132,13 @@ export interface DeliveryGateOptions {
|
|
|
119
132
|
readonly fetchPrPayload?: FetchPrPayloadFn;
|
|
120
133
|
/** Test / inject seam: authoritative closing issue ids only (#3675). */
|
|
121
134
|
readonly fetchClosingIssueIds?: FetchClosingIssueIdsFn;
|
|
135
|
+
/**
|
|
136
|
+
* File name of the brief being completed (basename). Enables the
|
|
137
|
+
* brief-in-PR-diff identity fallback when the forge closer set lacks the story.
|
|
138
|
+
*/
|
|
139
|
+
readonly briefBasename?: string;
|
|
140
|
+
/** Test / inject seam: PR changed files for the brief-in-PR-diff fallback. */
|
|
141
|
+
readonly fetchPrChangedFiles?: FetchPrChangedFilesFn;
|
|
122
142
|
}
|
|
123
143
|
export interface DeliveryGateResult {
|
|
124
144
|
readonly ok: boolean;
|
|
@@ -163,6 +183,19 @@ export declare function defaultFetchPrPayload(prNumber: number, repository: stri
|
|
|
163
183
|
* closers keep their own repository. Does not union body/commit intent.
|
|
164
184
|
*/
|
|
165
185
|
export declare function defaultFetchClosingIssueIds(prNumber: number, repository: string, runGh?: RunGhFn): ClosingIssueRef[] | null;
|
|
186
|
+
/**
|
|
187
|
+
* PR changed files via REST `pulls/{n}/files` (paginated). Any failure or
|
|
188
|
+
* unparseable line returns null so the caller fails closed.
|
|
189
|
+
*/
|
|
190
|
+
export declare function defaultFetchPrChangedFiles(prNumber: number, repository: string, runGh?: RunGhFn): PrChangedFile[] | null;
|
|
191
|
+
export type StoryPrIdentityBasis = "forge-closer" | "brief-in-pr-diff";
|
|
192
|
+
/**
|
|
193
|
+
* Brief-in-PR-diff identity (#3675 fallback). Holds only when the merged PR
|
|
194
|
+
* added this exact brief file to a lifecycle folder AND changed at least one
|
|
195
|
+
* file outside the lifecycle folders. A PR that only edits or moves the brief
|
|
196
|
+
* (a lifecycle PR) does not qualify.
|
|
197
|
+
*/
|
|
198
|
+
export declare function prDiffAddsBrief(files: readonly PrChangedFile[], briefBasename: string): boolean;
|
|
166
199
|
export interface StoryPrMergeIdentityResult {
|
|
167
200
|
readonly ok: boolean;
|
|
168
201
|
readonly message: string;
|
|
@@ -171,6 +204,7 @@ export interface StoryPrMergeIdentityResult {
|
|
|
171
204
|
readonly mergedAt?: string;
|
|
172
205
|
readonly prBase?: string | null;
|
|
173
206
|
readonly headSha?: string | null;
|
|
207
|
+
readonly identityBasis?: StoryPrIdentityBasis;
|
|
174
208
|
}
|
|
175
209
|
/**
|
|
176
210
|
* Prefer-A story→PR→merge identity join before delivery liveness (#3675).
|
|
@@ -186,6 +220,9 @@ export declare function verifyStoryPrMergeIdentity(input: {
|
|
|
186
220
|
readonly mergeCommit: string;
|
|
187
221
|
readonly fetchPrPayload: FetchPrPayloadFn;
|
|
188
222
|
readonly fetchClosingIssueIds: FetchClosingIssueIdsFn;
|
|
223
|
+
/** Basename of the brief being completed; enables the brief-in-PR-diff fallback. */
|
|
224
|
+
readonly briefBasename?: string;
|
|
225
|
+
readonly fetchPrChangedFiles?: FetchPrChangedFilesFn;
|
|
189
226
|
}): StoryPrMergeIdentityResult;
|
|
190
227
|
/**
|
|
191
228
|
* Classify stored completion provenance for read paths.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-evidence.d.ts","sourceRoot":"","sources":["../../src/scope/delivery-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAoB,KAAK,SAAS,EAAiB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"delivery-evidence.d.ts","sourceRoot":"","sources":["../../src/scope/delivery-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAoB,KAAK,SAAS,EAAiB,MAAM,mBAAmB,CAAC;AAqBpF,+EAA+E;AAC/E,eAAO,MAAM,cAAc,2EAKjB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,6EAA6E;AAC7E,eAAO,MAAM,yBAAyB,uFAK5B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,+DAA+D;AAC/D,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,uBAAuB,GACvB,eAAe,GACf,sBAAsB,GACtB,SAAS,GACT,YAAY,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;I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AAO,CAAC;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,8BAA8B,GACtC;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,GACD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAkCrD;;;;;;;;GAQG;AACH,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,+BAA+B,GACvC,8BAA8B,CAgMhC"}
|
|
@@ -14,6 +14,7 @@ import { assertSafeBranchName, FIELD_DELIVERY_BRANCH, isSafeBranchName, resolveD
|
|
|
14
14
|
import { defaultRunGh } from "../pr-protected-issues/gh.js";
|
|
15
15
|
import { defaultGitRunner, gitIsAncestor } from "../session/git.js";
|
|
16
16
|
import { readRitualState } from "../session/ritual-sentinel.js";
|
|
17
|
+
import { LIFECYCLE_FOLDERS } from "./constants.js";
|
|
17
18
|
/** Prefer-A #5545: refuse resolver error when branch is empty or unsafe. */
|
|
18
19
|
function refuseUnsafeResolvedDelivery(resolved) {
|
|
19
20
|
if (resolved.error !== null) {
|
|
@@ -314,6 +315,70 @@ export function defaultFetchClosingIssueIds(prNumber, repository, runGh = defaul
|
|
|
314
315
|
}
|
|
315
316
|
return out;
|
|
316
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* PR changed files via REST `pulls/{n}/files` (paginated). Any failure or
|
|
320
|
+
* unparseable line returns null so the caller fails closed.
|
|
321
|
+
*/
|
|
322
|
+
export function defaultFetchPrChangedFiles(prNumber, repository, runGh = defaultRunGh) {
|
|
323
|
+
const parsed = parseOwnerRepo(repository);
|
|
324
|
+
if (parsed === null) {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
let result;
|
|
328
|
+
try {
|
|
329
|
+
result = runGh([
|
|
330
|
+
"gh",
|
|
331
|
+
"api",
|
|
332
|
+
"--paginate",
|
|
333
|
+
`repos/${parsed.owner}/${parsed.name}/pulls/${prNumber}/files?per_page=100`,
|
|
334
|
+
"--jq",
|
|
335
|
+
".[] | [.status, .filename] | @tsv",
|
|
336
|
+
]);
|
|
337
|
+
}
|
|
338
|
+
catch {
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
if (result.returncode !== 0) {
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
const out = [];
|
|
345
|
+
for (const line of result.stdout.split("\n")) {
|
|
346
|
+
if (line.trim().length === 0)
|
|
347
|
+
continue;
|
|
348
|
+
const tab = line.indexOf("\t");
|
|
349
|
+
if (tab <= 0 || tab === line.length - 1) {
|
|
350
|
+
return null;
|
|
351
|
+
}
|
|
352
|
+
out.push({ status: line.slice(0, tab), filename: line.slice(tab + 1) });
|
|
353
|
+
}
|
|
354
|
+
return out;
|
|
355
|
+
}
|
|
356
|
+
const LIFECYCLE_FOLDER_SET = new Set(LIFECYCLE_FOLDERS);
|
|
357
|
+
function lifecycleBriefBasename(filename) {
|
|
358
|
+
const parts = filename.split("/");
|
|
359
|
+
// Require xbrief|vbrief/<lifecycle>/<file> so docs/active/... cannot prove delivery.
|
|
360
|
+
if (parts.length < 3)
|
|
361
|
+
return null;
|
|
362
|
+
const root = parts[parts.length - 3] ?? "";
|
|
363
|
+
if (root !== "xbrief" && root !== "vbrief")
|
|
364
|
+
return null;
|
|
365
|
+
const folder = parts[parts.length - 2] ?? "";
|
|
366
|
+
return LIFECYCLE_FOLDER_SET.has(folder) ? (parts[parts.length - 1] ?? null) : null;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Brief-in-PR-diff identity (#3675 fallback). Holds only when the merged PR
|
|
370
|
+
* added this exact brief file to a lifecycle folder AND changed at least one
|
|
371
|
+
* file outside the lifecycle folders. A PR that only edits or moves the brief
|
|
372
|
+
* (a lifecycle PR) does not qualify.
|
|
373
|
+
*/
|
|
374
|
+
export function prDiffAddsBrief(files, briefBasename) {
|
|
375
|
+
const name = briefBasename.trim();
|
|
376
|
+
if (name.length === 0)
|
|
377
|
+
return false;
|
|
378
|
+
const addsBrief = files.some((f) => f.status === "added" && lifecycleBriefBasename(f.filename) === name);
|
|
379
|
+
const touchesCode = files.some((f) => lifecycleBriefBasename(f.filename) === null);
|
|
380
|
+
return addsBrief && touchesCode;
|
|
381
|
+
}
|
|
317
382
|
/**
|
|
318
383
|
* Prefer-A story→PR→merge identity join before delivery liveness (#3675).
|
|
319
384
|
*
|
|
@@ -385,12 +450,30 @@ export function verifyStoryPrMergeIdentity(input) {
|
|
|
385
450
|
const closerSet = linked.flatMap((ref) => closerSetFromIssueIds(ref.repository, [ref.issueNumber]));
|
|
386
451
|
const expectedRepoKey = expected.repository.trim().toLowerCase();
|
|
387
452
|
const closesStory = closerSet.some((origin) => origin.repo === expectedRepoKey && origin.issueId === expected.issueNumber);
|
|
453
|
+
let identityBasis = "forge-closer";
|
|
388
454
|
if (!closesStory) {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
455
|
+
const closerMiss = `Delivery identity join failed: PR #${prNumber} forge closer set does not include ` +
|
|
456
|
+
`${expected.repository}#${expected.issueNumber} (wrong story / absent association) (#3675).`;
|
|
457
|
+
const briefBasename = input.briefBasename?.trim() ?? "";
|
|
458
|
+
if (briefBasename.length === 0 || input.fetchPrChangedFiles === undefined) {
|
|
459
|
+
return { ok: false, message: closerMiss };
|
|
460
|
+
}
|
|
461
|
+
const files = input.fetchPrChangedFiles(prNumber, expected.repository);
|
|
462
|
+
if (files === null) {
|
|
463
|
+
return {
|
|
464
|
+
ok: false,
|
|
465
|
+
message: `${closerMiss} Brief-in-PR-diff fallback could not read PR #${prNumber} changed files ` +
|
|
466
|
+
`(lookup failure).`,
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
if (!prDiffAddsBrief(files, briefBasename)) {
|
|
470
|
+
return {
|
|
471
|
+
ok: false,
|
|
472
|
+
message: `${closerMiss} Brief-in-PR-diff fallback also failed: PR #${prNumber} did not add ` +
|
|
473
|
+
`${briefBasename} alongside code changes.`,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
identityBasis = "brief-in-pr-diff";
|
|
394
477
|
}
|
|
395
478
|
if (!shasEqual(input.mergeCommit, mergeCommitSha)) {
|
|
396
479
|
return {
|
|
@@ -423,11 +506,13 @@ export function verifyStoryPrMergeIdentity(input) {
|
|
|
423
506
|
}
|
|
424
507
|
return {
|
|
425
508
|
ok: true,
|
|
426
|
-
message: `story→PR→merge identity joined: ${expected.repository}#${expected.issueNumber} via PR #${prNumber}
|
|
509
|
+
message: `story→PR→merge identity joined: ${expected.repository}#${expected.issueNumber} via PR #${prNumber}` +
|
|
510
|
+
(identityBasis === "brief-in-pr-diff" ? " (brief-in-PR-diff)" : ""),
|
|
427
511
|
mergeCommitSha,
|
|
428
512
|
mergedAt,
|
|
429
513
|
prBase,
|
|
430
514
|
headSha,
|
|
515
|
+
identityBasis,
|
|
431
516
|
};
|
|
432
517
|
}
|
|
433
518
|
/**
|
|
@@ -666,6 +751,10 @@ export function verifyDeliveryAncestry(projectRoot, mergeCommit, deliveryBranch,
|
|
|
666
751
|
function buildProvenance(input) {
|
|
667
752
|
const e = input.evidence ?? {};
|
|
668
753
|
return {
|
|
754
|
+
// Only non-default bases are recorded; absent keeps existing records unchanged.
|
|
755
|
+
...(input.identityBasis !== undefined && input.identityBasis !== "forge-closer"
|
|
756
|
+
? { identityBasis: input.identityBasis }
|
|
757
|
+
: {}),
|
|
669
758
|
repository: e.repository ?? null,
|
|
670
759
|
implementationCommit: e.implementationCommit ?? null,
|
|
671
760
|
prNumber: e.prNumber ?? null,
|
|
@@ -706,6 +795,12 @@ export function evaluateDeliveryGate(options) {
|
|
|
706
795
|
((prNumber, repository) => defaultFetchPrPayload(prNumber, repository, runGh));
|
|
707
796
|
const fetchClosingIssueIds = options.fetchClosingIssueIds ??
|
|
708
797
|
((prNumber, repository) => defaultFetchClosingIssueIds(prNumber, repository, runGh));
|
|
798
|
+
// Default the changed-files fetcher only when closer refs are not injected, so
|
|
799
|
+
// injected test seams never fall through to a live gh call.
|
|
800
|
+
const fetchPrChangedFiles = options.fetchPrChangedFiles ??
|
|
801
|
+
(options.fetchClosingIssueIds === undefined
|
|
802
|
+
? (prNumber, repository) => defaultFetchPrChangedFiles(prNumber, repository, runGh)
|
|
803
|
+
: undefined);
|
|
709
804
|
const verifier = options.verifier ?? "scope:complete";
|
|
710
805
|
const codeBearing = isCodeBearingScope(options.plan);
|
|
711
806
|
// #5693: experiment_archived Findings check runs before the non-code early
|
|
@@ -837,6 +932,8 @@ export function evaluateDeliveryGate(options) {
|
|
|
837
932
|
mergeCommit,
|
|
838
933
|
fetchPrPayload,
|
|
839
934
|
fetchClosingIssueIds,
|
|
935
|
+
briefBasename: options.briefBasename,
|
|
936
|
+
fetchPrChangedFiles,
|
|
840
937
|
});
|
|
841
938
|
if (!identity.ok) {
|
|
842
939
|
return {
|
|
@@ -864,6 +961,7 @@ export function evaluateDeliveryGate(options) {
|
|
|
864
961
|
nowIso: options.nowIso,
|
|
865
962
|
verifier,
|
|
866
963
|
deliveryCommit: boundEvidence.deliveryCommit ?? boundEvidence.mergeCommit,
|
|
964
|
+
identityBasis: identity.identityBasis,
|
|
867
965
|
});
|
|
868
966
|
return {
|
|
869
967
|
ok: true,
|
|
@@ -906,6 +1004,7 @@ export function evaluateDeliveryGate(options) {
|
|
|
906
1004
|
nowIso: options.nowIso,
|
|
907
1005
|
verifier,
|
|
908
1006
|
deliveryCommit: ancestry.remoteTip,
|
|
1007
|
+
identityBasis: identity.identityBasis,
|
|
909
1008
|
});
|
|
910
1009
|
return {
|
|
911
1010
|
ok: true,
|
|
@@ -942,6 +1041,7 @@ export function stampDeliveryProvenance(plan, provenance) {
|
|
|
942
1041
|
provenance.completedSessionId.trim().length > 0
|
|
943
1042
|
? { completedSessionId: provenance.completedSessionId.trim() }
|
|
944
1043
|
: {}),
|
|
1044
|
+
...(provenance.identityBasis !== undefined ? { identityBasis: provenance.identityBasis } : {}),
|
|
945
1045
|
};
|
|
946
1046
|
meta.deliveryDisposition = provenance.disposition;
|
|
947
1047
|
meta.handoffState = provenance.handoffState;
|