@deftai/directive-runtime 0.129.5 → 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 +3 -2
- package/dist/human-presence-mint.d.ts +6 -1
- package/dist/human-presence-mint.js +20 -6
- 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-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/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 +31 -1
- 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/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 +31 -1
- package/vendor/directive-core/dist/.tsbuildinfo +1 -1
- package/vendor/directive-core/dist/authz/classify.d.ts +12 -0
- package/vendor/directive-core/dist/authz/classify.d.ts.map +1 -1
- package/vendor/directive-core/dist/authz/classify.js +40 -12
- package/vendor/directive-core/dist/authz/classify.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/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/hooks/dispatcher.d.ts.map +1 -1
- package/vendor/directive-core/dist/hooks/dispatcher.js +174 -12
- package/vendor/directive-core/dist/hooks/dispatcher.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 +2 -1
- package/vendor/directive-core/dist/install-health/cheap.d.ts.map +1 -1
- package/vendor/directive-core/dist/install-health/cheap.js +4 -3
- 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/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/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/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/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/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
|
@@ -845,6 +845,241 @@ tasks:
|
|
|
845
845
|
vars:
|
|
846
846
|
ENGINE_CMD: 'release-wait-npm {{.CLI_ARGS}}'
|
|
847
847
|
|
|
848
|
+
# Phase 7 maintainer primary checkout closeout (#5953 Prefer-A Bound 6430511888).
|
|
849
|
+
# Inline cmds only — no engine:invoke / no deps:[ts:build] so the post-install
|
|
850
|
+
# payload can replace the N-1 runtime the cut was using. Never reset/force-push/
|
|
851
|
+
# commit / npm i -g.
|
|
852
|
+
release:local-update:
|
|
853
|
+
desc: "Phase 7 fail-closed maintainer checkout update (#5953) -- task release:local-update -- <version> --checkout <primary-occupancy-root>"
|
|
854
|
+
dir: '{{.USER_WORKING_DIR}}'
|
|
855
|
+
env:
|
|
856
|
+
PYTHONUTF8: "1"
|
|
857
|
+
cmds:
|
|
858
|
+
- |
|
|
859
|
+
set -e
|
|
860
|
+
# node -e bodies use shell single quotes + JS double quotes only (no apostrophes).
|
|
861
|
+
PARSE_OUT="$(node -e '
|
|
862
|
+
const raw = process.argv[1] || "";
|
|
863
|
+
const tokens = [];
|
|
864
|
+
let cur = "";
|
|
865
|
+
let q = null;
|
|
866
|
+
const DQ = String.fromCharCode(34);
|
|
867
|
+
const SQ = String.fromCharCode(39);
|
|
868
|
+
for (let i = 0; i < raw.length; i++) {
|
|
869
|
+
const ch = raw[i];
|
|
870
|
+
if (q) {
|
|
871
|
+
if (ch === q) { q = null; continue; }
|
|
872
|
+
cur += ch;
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
if (ch === DQ || ch === SQ) { q = ch; continue; }
|
|
876
|
+
if (/\s/.test(ch)) {
|
|
877
|
+
if (cur.length) { tokens.push(cur); cur = ""; }
|
|
878
|
+
continue;
|
|
879
|
+
}
|
|
880
|
+
cur += ch;
|
|
881
|
+
}
|
|
882
|
+
if (q) { console.error("release:local-update: unmatched quote in args"); process.exit(2); }
|
|
883
|
+
if (cur.length) tokens.push(cur);
|
|
884
|
+
let version = "";
|
|
885
|
+
let checkout = "";
|
|
886
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
887
|
+
const t = tokens[i];
|
|
888
|
+
if (t === "--checkout") {
|
|
889
|
+
const v = tokens[++i];
|
|
890
|
+
if (!v) { console.error("release:local-update: --checkout requires a path"); process.exit(2); }
|
|
891
|
+
checkout = v;
|
|
892
|
+
continue;
|
|
893
|
+
}
|
|
894
|
+
if (t.startsWith("--")) {
|
|
895
|
+
console.error("release:local-update: unknown flag " + t);
|
|
896
|
+
console.error("Usage: task release:local-update -- <version> --checkout <maintainer-primary-occupancy-root>");
|
|
897
|
+
process.exit(2);
|
|
898
|
+
}
|
|
899
|
+
if (!version) { version = t; continue; }
|
|
900
|
+
console.error("release:local-update: unexpected arg " + t);
|
|
901
|
+
process.exit(2);
|
|
902
|
+
}
|
|
903
|
+
if (!version) {
|
|
904
|
+
console.error("release:local-update: missing <version>");
|
|
905
|
+
console.error("Usage: task release:local-update -- <version> --checkout <maintainer-primary-occupancy-root>");
|
|
906
|
+
process.exit(2);
|
|
907
|
+
}
|
|
908
|
+
if (!checkout) {
|
|
909
|
+
console.error("release:local-update: refuse ambient release-worktree-only success; require --checkout naming the maintainer primary occupancy root (#5953)");
|
|
910
|
+
process.exit(1);
|
|
911
|
+
}
|
|
912
|
+
process.stdout.write(JSON.stringify({ version, checkout }));
|
|
913
|
+
' "{{.CLI_ARGS}}")"
|
|
914
|
+
VERSION="$(node -e 'const j=JSON.parse(process.argv[1]); process.stdout.write(j.version);' "$PARSE_OUT")"
|
|
915
|
+
CHECKOUT="$(node -e 'const j=JSON.parse(process.argv[1]); process.stdout.write(j.checkout);' "$PARSE_OUT")"
|
|
916
|
+
case "$CHECKOUT" in
|
|
917
|
+
/*|[A-Za-z]:*) ;;
|
|
918
|
+
*) CHECKOUT="$(pwd)/$CHECKOUT" ;;
|
|
919
|
+
esac
|
|
920
|
+
CHECKOUT="$(node -e 'const fs=require("fs"); const path=require("path"); const inPath=process.argv[1]; try { process.stdout.write(fs.realpathSync(inPath)); } catch { process.stdout.write(path.resolve(inPath)); }' "$CHECKOUT")"
|
|
921
|
+
if [ ! -d "$CHECKOUT/.git" ] && [ ! -f "$CHECKOUT/.git" ]; then
|
|
922
|
+
echo "release:local-update: --checkout is not a git checkout: $CHECKOUT" >&2
|
|
923
|
+
exit 1
|
|
924
|
+
fi
|
|
925
|
+
COMMON_DIR="$(git -C "$CHECKOUT" rev-parse --git-common-dir 2>/dev/null || true)"
|
|
926
|
+
if [ -z "$COMMON_DIR" ]; then
|
|
927
|
+
echo "release:local-update: cannot resolve git-common-dir for $CHECKOUT" >&2
|
|
928
|
+
exit 1
|
|
929
|
+
fi
|
|
930
|
+
case "$COMMON_DIR" in
|
|
931
|
+
/*|[A-Za-z]:*) ;;
|
|
932
|
+
*) COMMON_DIR="$CHECKOUT/$COMMON_DIR" ;;
|
|
933
|
+
esac
|
|
934
|
+
MAIN_ROOT="$(node -e 'const path=require("path"); process.stdout.write(path.resolve(path.dirname(process.argv[1])));' "$COMMON_DIR")"
|
|
935
|
+
SAME_MAIN="$(node -e 'const a=process.argv[1]; const b=process.argv[2]; const norm=s => process.platform==="win32" ? s.split(String.fromCharCode(92)).join("/").toLowerCase() : s.split(String.fromCharCode(92)).join("/"); process.stdout.write(norm(a)===norm(b)?"1":"0");' "$CHECKOUT" "$MAIN_ROOT")"
|
|
936
|
+
if [ "$SAME_MAIN" != "1" ]; then
|
|
937
|
+
echo "release:local-update: refuse ambient release-worktree-only success; --checkout must name the maintainer primary occupancy root (dirname git-common-dir=$MAIN_ROOT), not $CHECKOUT (#5953)" >&2
|
|
938
|
+
exit 1
|
|
939
|
+
fi
|
|
940
|
+
CHECKOUT_NORM="$(node -e 'process.stdout.write(String(process.argv[1]||"").split(String.fromCharCode(92)).join("/"));' "$CHECKOUT")"
|
|
941
|
+
case "$CHECKOUT_NORM" in
|
|
942
|
+
*/.deft-scratch/worktrees/*)
|
|
943
|
+
echo "release:local-update: refuse ambient release-worktree-only success; --checkout must name the maintainer primary occupancy root, not $CHECKOUT (#5953)" >&2
|
|
944
|
+
exit 1
|
|
945
|
+
;;
|
|
946
|
+
esac
|
|
947
|
+
print_deposit_recovery() {
|
|
948
|
+
echo "Phase 7 local closeout INCOMPLETE (#5953)." >&2
|
|
949
|
+
echo "Recovery: merge the version-matched agent-hook deposit for $VERSION onto tip, then re-run:" >&2
|
|
950
|
+
echo " task release:local-update -- $VERSION --checkout $CHECKOUT" >&2
|
|
951
|
+
echo "Expected managed deposit paths include: .grok/hooks/ .cursor/hooks.json .claude/settings.json .codex/ (and related deposit files)." >&2
|
|
952
|
+
echo "Do not auto-commit deposit bytes inside the release flow; do not npm i -g." >&2
|
|
953
|
+
}
|
|
954
|
+
OCC_FILE="$CHECKOUT/.deft/occupancy.json"
|
|
955
|
+
if [ -f "$OCC_FILE" ]; then
|
|
956
|
+
node -e '
|
|
957
|
+
const fs = require("fs");
|
|
958
|
+
const path = process.argv[1];
|
|
959
|
+
const checkout = process.argv[2];
|
|
960
|
+
const raw = fs.readFileSync(path, "utf8");
|
|
961
|
+
let rec;
|
|
962
|
+
try { rec = JSON.parse(raw); } catch { process.exit(0); }
|
|
963
|
+
const sid = String(rec.session_id || rec.sessionId || "");
|
|
964
|
+
const hb = Date.parse(rec.heartbeat_at || rec.heartbeatAt || "");
|
|
965
|
+
const claimed = Date.parse(rec.claimed_at || rec.claimedAt || "");
|
|
966
|
+
const now = Date.now();
|
|
967
|
+
const TTL = 20 * 60 * 1000;
|
|
968
|
+
const MAX = 24 * 60 * 60 * 1000;
|
|
969
|
+
if (!Number.isFinite(hb) || !Number.isFinite(claimed)) process.exit(0);
|
|
970
|
+
if (now - claimed > MAX || now - hb > TTL) process.exit(0);
|
|
971
|
+
const providers = ["grok", "claude", "cursor", "codex", "openclaw"];
|
|
972
|
+
const rawPresenters = [
|
|
973
|
+
process.env.DEFT_SESSION_ID,
|
|
974
|
+
process.env.GROK_SESSION_ID,
|
|
975
|
+
process.env.CLAUDE_SESSION_ID,
|
|
976
|
+
process.env.CURSOR_SESSION_ID,
|
|
977
|
+
process.env.CODEX_SESSION_ID,
|
|
978
|
+
].filter((v) => typeof v === "string" && v.trim().length > 0).map((v) => v.trim());
|
|
979
|
+
const presenters = new Set(rawPresenters);
|
|
980
|
+
for (const p of rawPresenters) {
|
|
981
|
+
if (p.startsWith("host:")) continue;
|
|
982
|
+
for (const provider of providers) {
|
|
983
|
+
presenters.add("host:" + provider + ":v1:" + Buffer.from(p, "utf8").toString("base64url"));
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
let sidRaw = null;
|
|
987
|
+
const m = /^host:([a-z]+):v1:([A-Za-z0-9_-]+)$/.exec(sid);
|
|
988
|
+
if (m) {
|
|
989
|
+
try { sidRaw = Buffer.from(m[2], "base64url").toString("utf8"); } catch { sidRaw = null; }
|
|
990
|
+
}
|
|
991
|
+
const grants = Array.isArray(rec.grants) ? rec.grants : [];
|
|
992
|
+
const grantIds = grants
|
|
993
|
+
.filter((g) => Date.parse(g.expires_at || g.expiresAt || 0) > now)
|
|
994
|
+
.map((g) => g.session_id || g.sessionId || g.child_session_id || g.childSessionId)
|
|
995
|
+
.filter(Boolean)
|
|
996
|
+
.map(String);
|
|
997
|
+
const admitted = [...presenters].some((p) => p === sid || grantIds.includes(p) || (sidRaw && p === sidRaw));
|
|
998
|
+
if (!admitted && presenters.size > 0) {
|
|
999
|
+
console.error("release:local-update: refuse live foreign occupancy lease on " + checkout + " (occupant=" + sid + ") before any write (#5953)");
|
|
1000
|
+
process.exit(1);
|
|
1001
|
+
}
|
|
1002
|
+
if (!admitted && presenters.size === 0 && sid) {
|
|
1003
|
+
console.error("release:local-update: refuse live occupancy lease on " + checkout + " (occupant=" + sid + "); no presenter session id in env (#5953)");
|
|
1004
|
+
process.exit(1);
|
|
1005
|
+
}
|
|
1006
|
+
' "$OCC_FILE" "$CHECKOUT"
|
|
1007
|
+
fi
|
|
1008
|
+
cd "$CHECKOUT"
|
|
1009
|
+
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
1010
|
+
echo "release:local-update: not a git work tree: $CHECKOUT" >&2
|
|
1011
|
+
exit 1
|
|
1012
|
+
fi
|
|
1013
|
+
if [ -n "$(git status --porcelain)" ]; then
|
|
1014
|
+
echo "release:local-update: refuse dirty tree at $CHECKOUT" >&2
|
|
1015
|
+
git status --short >&2
|
|
1016
|
+
exit 1
|
|
1017
|
+
fi
|
|
1018
|
+
DEFAULT_BRANCH="$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed "s@^refs/remotes/origin/@@" || true)"
|
|
1019
|
+
if [ -z "$DEFAULT_BRANCH" ]; then DEFAULT_BRANCH=master; fi
|
|
1020
|
+
CURRENT="$(git rev-parse --abbrev-ref HEAD)"
|
|
1021
|
+
if [ "$CURRENT" != "$DEFAULT_BRANCH" ]; then
|
|
1022
|
+
echo "release:local-update: refuse; checkout must be on default branch $DEFAULT_BRANCH (on $CURRENT)" >&2
|
|
1023
|
+
exit 1
|
|
1024
|
+
fi
|
|
1025
|
+
echo "release:local-update: ff-only pull on $DEFAULT_BRANCH at $CHECKOUT"
|
|
1026
|
+
git pull --ff-only
|
|
1027
|
+
if [ -f pnpm-workspace.yaml ]; then
|
|
1028
|
+
if grep -q "minimumReleaseAgeExclude" pnpm-workspace.yaml; then
|
|
1029
|
+
if ! grep -q "@deftai/directive-runtime@$VERSION" pnpm-workspace.yaml; then
|
|
1030
|
+
echo "release:local-update: AgeExclude missing @deftai/directive-runtime@$VERSION before frozen install (#5953 footnote)" >&2
|
|
1031
|
+
exit 1
|
|
1032
|
+
fi
|
|
1033
|
+
fi
|
|
1034
|
+
fi
|
|
1035
|
+
echo "release:local-update: pnpm install --frozen-lockfile"
|
|
1036
|
+
pnpm install --frozen-lockfile
|
|
1037
|
+
PIN_PKG="$(node -e 'const fs=require("fs"); const p=JSON.parse(fs.readFileSync("package.json","utf8")); const v=(p.dependencies||{})["@deftai/directive-runtime"]||(p.devDependencies||{})["@deftai/directive-runtime"]||""; console.log(String(v).replace(/^[^0-9]*/, ""));')"
|
|
1038
|
+
INST_PKG="$(node -e 'const fs=require("fs"); const p=JSON.parse(fs.readFileSync("node_modules/@deftai/directive-runtime/package.json","utf8")); console.log(p.version);')"
|
|
1039
|
+
if [ "$PIN_PKG" != "$VERSION" ] || [ "$INST_PKG" != "$VERSION" ]; then
|
|
1040
|
+
echo "release:local-update: tip-pin-equals-released FAILED; want $VERSION; package.json pin=$PIN_PKG installed=$INST_PKG" >&2
|
|
1041
|
+
exit 1
|
|
1042
|
+
fi
|
|
1043
|
+
echo "release:local-update: tip-pin-equals-released ok ($VERSION)"
|
|
1044
|
+
RUNTIME_BIN="node_modules/@deftai/directive-runtime/dist/bin.js"
|
|
1045
|
+
if [ ! -f "$RUNTIME_BIN" ]; then
|
|
1046
|
+
echo "release:local-update: missing checkout runtime bin $RUNTIME_BIN" >&2
|
|
1047
|
+
exit 1
|
|
1048
|
+
fi
|
|
1049
|
+
echo "release:local-update: require version-matched agent-hook deposit already on tip"
|
|
1050
|
+
if ! DEFT_DOCTOR_HOOK_DIAGNOSTIC=1 node "$RUNTIME_BIN" verify:hooks-installed --project-root "$CHECKOUT" --scope=agent; then
|
|
1051
|
+
print_deposit_recovery
|
|
1052
|
+
exit 1
|
|
1053
|
+
fi
|
|
1054
|
+
UPGRADE_BIN=""
|
|
1055
|
+
if [ -x "node_modules/.bin/directive" ]; then
|
|
1056
|
+
UPGRADE_BIN="node_modules/.bin/directive"
|
|
1057
|
+
elif [ -f "node_modules/@deftai/directive/dist/bin.js" ]; then
|
|
1058
|
+
UPGRADE_BIN="node node_modules/@deftai/directive/dist/bin.js"
|
|
1059
|
+
elif command -v directive >/dev/null 2>&1; then
|
|
1060
|
+
UPGRADE_BIN="directive"
|
|
1061
|
+
else
|
|
1062
|
+
echo "release:local-update: cannot resolve directive upgrade binary after frozen install" >&2
|
|
1063
|
+
exit 1
|
|
1064
|
+
fi
|
|
1065
|
+
echo "release:local-update: $UPGRADE_BIN upgrade --target-version $VERSION --yes --root $CHECKOUT"
|
|
1066
|
+
$UPGRADE_BIN upgrade --target-version "$VERSION" --yes --root "$CHECKOUT"
|
|
1067
|
+
if [ -n "$(git status --porcelain)" ]; then
|
|
1068
|
+
echo "release:local-update: tracked-file diff after upgrade; closeout non-zero/incomplete (#5953)" >&2
|
|
1069
|
+
git status --short >&2
|
|
1070
|
+
print_deposit_recovery
|
|
1071
|
+
exit 1
|
|
1072
|
+
fi
|
|
1073
|
+
echo "release:local-update: verify:hooks-installed --project-root --scope=all"
|
|
1074
|
+
DEFT_DOCTOR_HOOK_DIAGNOSTIC=1 node "$RUNTIME_BIN" verify:hooks-installed --project-root "$CHECKOUT" --scope=all
|
|
1075
|
+
INST_PKG2="$(node -e 'const fs=require("fs"); const p=JSON.parse(fs.readFileSync("node_modules/@deftai/directive-runtime/package.json","utf8")); console.log(p.version);')"
|
|
1076
|
+
if [ "$INST_PKG2" != "$VERSION" ]; then
|
|
1077
|
+
echo "release:local-update: post-upgrade runtime $INST_PKG2 != $VERSION" >&2
|
|
1078
|
+
exit 1
|
|
1079
|
+
fi
|
|
1080
|
+
echo "release:local-update COMPLETE; checkout=$CHECKOUT version=$INST_PKG2 hooks=verify:hooks-installed --scope=all green"
|
|
1081
|
+
echo "global npm i -g was NOT run (report-only drift remains Phase 7 step 2)."
|
|
1082
|
+
|
|
848
1083
|
|
|
849
1084
|
# ------------------------------------------------------------------
|
|
850
1085
|
# Triage v1 user-facing alias tasks (#845, #913).
|
|
@@ -949,6 +949,7 @@ Every **real** policy write (Phase 2 / Phase 4, and every other `meta/policy-cha
|
|
|
949
949
|
- **On-disk layout changed.** Old: `.deft-cache/issues/<owner>-<repo>/<N>.{json,md}` (flat sidecar). New: `.deft-cache/<source>/<key>/{raw.json,content.md,meta.json}` (per-entry directory; schema-validated meta envelope). `cache:get` validates `meta.json` against `vbrief/schemas/cache-meta.schema.json` on every read so a corrupt or version-incompatible file fails closed.
|
|
950
950
|
- **Audit log UNCHANGED.** `vbrief/.eval/candidates.jsonl` preserves accept / reject / defer / needs-ac / mark-duplicate / reset records across the migration. The Story 3 Tier-2 short-circuit (terminal-decision skip on bulk-* re-runs) operates on the same file.
|
|
951
951
|
- **All other `triage:*` actions UNCHANGED.** `triage:accept` / `triage:reject` / `triage:defer` / `triage:needs-ac` / `triage:mark-duplicate` / `triage:bulk-accept` / `triage:bulk-reject` / `triage:bulk-defer` / `triage:bulk-needs-ac` / `triage:status` / `triage:reset` / `triage:history` / `triage:refresh-active` keep their v0.25.x surface byte-for-byte (13 aliases). The rebind onto `cache:get` is internal. `triage:bootstrap` keeps its v0.25.x command surface but its on-disk output is the new `.deft-cache/<source>/<key>/` per-entry layout (now delegates to `cache:fetch-all`); see the Commands list above.
|
|
952
|
+
- **Gitcrawl fallback semantics no longer apply.** After this cache rebind, the old `docs/gitcrawl-fallback.md` gh-only install/recovery path is withdrawn. Do not follow that doc for v0.26+ triage/cache; use `cache:*` and this migration section instead (#1092).
|
|
952
953
|
|
|
953
954
|
### Rollback
|
|
954
955
|
|
|
@@ -65,7 +65,7 @@ Record `arc-mode: no-ingest` or `arc-mode: checkout` on the Stop 1 write-back. `
|
|
|
65
65
|
- ! Parent-unclaimed is its own MUST: `session:start --read-only`, or an explicit occupancy release if a mutation lease is already held. Dest create does not clear occupancy.
|
|
66
66
|
- ! Recognition of `no-ingest` happens before mutation initialization. Refuse github-only when mutation `session:start` has already occurred, unless the lease is released first.
|
|
67
67
|
- ! Posting path that survives a foreign lease: `gh issue comment --body-file -` (stdin). Least-authority envelope: bounded GitHub reads and one comment post.
|
|
68
|
-
- ! Parent fetches, then creates or verifies one dest at origin/<default> tip (`ensureArcDest`). dispatch-sha equals that tip. Against-implementation dest is the fetched PR head SHA, recorded on Stop 1. ⊗ Pin dest to local HEAD.
|
|
68
|
+
- ! Parent fetches, then creates or verifies one dest at origin/<default> tip via the sanctioned pin-bin verb `deft design-critique:ensure-arc-dest` (library `ensureArcDest`; guarded-prep default, or explicit `process-only-no-install`). When guarded-prep is selected, success requires the outer-visible runtime pin. dispatch-sha equals that tip. Against-implementation dest is the fetched PR head SHA, recorded on Stop 1. ⊗ Pin dest to local HEAD. ⊗ Treat gitignored `packages/core/dist` as SoT for `ensureArcDest` on framework-source.
|
|
69
69
|
- ! N>1 process-only critics share that dest with cwd-without-occupy. They are not swarm Phase 2 and not a #4066 mutating worker. Unique dest-lock stays for implement-class. Skip class is a host-visible Grok stdin marker (`subagent_type` `plan` or `process_only`), not dest-path. That marker is the process-only skip class, not an implementation-gate bypass: implement-class never sets `process_only`. ⊗ Skip #2885 on destProven. Keep #4066 primary-path deny. ⊗ Pin dest / process_only skip-class rules into `templates/agents-entry.md`.
|
|
70
70
|
- ! Pin reads to `git show <dispatch-sha>:` against the recorded SHA. ⊗ A moving branch ref.
|
|
71
71
|
- ! Before panel-deposit on a process-only dest, record a closed `verification-path:` line that either (a) names the read-only pin-read path (`git show <dispatch-sha>:`, dest cwd-without-occupy for on-pin file reads), or (b) records a provisioned runnable path when a specific check requires executing fixtures/tests. Default to (a). Keep N≥3 launch-probe (`evaluateN3LaunchProbe`) as launchability, separate from method-verification. `verificationPathRecordLine` / `evaluateVerificationPathBeforePanelDeposit` are the fixtures. ⊗ Mandate full install-on-dest for every panel.
|
|
@@ -195,6 +195,12 @@ OS-temp dests and commands with no recognized dest (`git status`,
|
|
|
195
195
|
remains **escape** polarity (in-tree dest whose realpath leaves the tree) and is
|
|
196
196
|
not this check. The hook still runs before the shell, so a link created between
|
|
197
197
|
check and write is TOCTOU.
|
|
198
|
+
- **Kill-switch / permanent opt-out plant (#6136):** Shell write reissue checks
|
|
199
|
+
`.deft-directive-disable` / `.no-deft-directive` basenames **before** the
|
|
200
|
+
`isInRepoShellWritePath` skip, so an out-of-tree plant cannot fail-open. Agent
|
|
201
|
+
Write/Edit/Shell of those basenames is always-on deny without a human-origin
|
|
202
|
+
settings grant (docs: `deft-directive-disable.md`). General protected-target /
|
|
203
|
+
out-of-tree floor work stays on #6138; deny wording on #6139.
|
|
198
204
|
|
|
199
205
|
Fail-open at this predicate is the bound posture (#3997). Inverting it to
|
|
200
206
|
fail-closed on dests the parser cannot prove external is that issue's refuted
|
|
@@ -82,11 +82,11 @@ rm .deft-directive-disable
|
|
|
82
82
|
# Start a NEW agent session
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
## Agent self-serve ban
|
|
85
|
+
## Agent self-serve ban (always-on, grant-gated) (#3186 / #6136)
|
|
86
86
|
|
|
87
|
-
Operators plant and remove this flag **outside** an agent session (or with a prior human-origin grant).
|
|
87
|
+
Operators plant and remove this flag **outside** an agent session (or with a prior human-origin grant covering **settings**). PreToolUse **always** denies agent Write / Edit / Shell that creates or renames-to `.deft-directive-disable` (and permanent opt-out `.no-deft-directive`) without that grant — not only under active UAT. Shell write reissue checks the protected basename **before** skipping out-of-tree dests, so a plant outside the repo tree cannot fail-open. Agents must not self-serve the kill-switch to bypass Write / push / PR / merge gates.
|
|
88
88
|
|
|
89
|
-
Related: `policy:allow-bot-merge`, `policy:allow-direct-commits`, and `policy:disable-directive` (peers) are
|
|
89
|
+
Related: `policy:allow-bot-merge`, `policy:allow-direct-commits`, and `policy:disable-directive` (peers) are settings under UAT and require a human grant.
|
|
90
90
|
|
|
91
91
|
## Non-goals (v1)
|
|
92
92
|
|
|
@@ -711,6 +711,21 @@
|
|
|
711
711
|
],
|
|
712
712
|
"source": "Issue #4888 Prefer-A Bound 6050812821 (parent #964). conflict_group mergeable-state-semantic-policy-invisibility.",
|
|
713
713
|
"body": "**Source:** Issue #4888 Prefer-A Bound 6050812821 (split from parent #964).\n\n**Failure mode:** GitHub `mergeable_state` / `mergeable` report only textual (axis-1) conflicts. After a PR opens, behavioral (CI/test) and policy (`task check` / required contexts) gates can land on the base without a textual conflict. Agents read dirty/clean as readiness or gap-size and miss the invisible policy miss until `task check` runs on the merge result.\n\n**Rule:** Use the three-axis model (textual / behavioral / policy). On conflict-resolve and behind-rebase (PR open; local HEAD matches live remote PR head), require machine-checkable candidate validation keyed to `(pr_head_sha, target_head_sha)` via `evaluateNonCascadeCandidateGreen` / `evaluateSemanticGreen({ requireCandidateValidation: true })`. Attestation is a named allowlisted probe exit 0 (typically pre-pr `task check` / `deft check`); prose stamps are not success. On pre-push, run that local merge-chokepoint gate before push; require the SHA-pair attestation only after push when local HEAD matches the live remote PR head. Do not weaken `--cascade` absolute stale-base refusal. Keep #4889 out; do not satisfy with a withdrawn Python semantic-drift script SoT. Forge supersession is #633/#1517 required Merge gate aggregator + up-to-date-required; local probe is interim.\n\n**Canonical encoding (strongest-applicable layer):** probe in `packages/core/src/pr-wait-mergeable/semantic-green.ts` (`requireCandidateValidation` / `validateCandidateAttestation`); operative MUST in `content/scm/github.md` § Cascade / Three-axis (#4888) and `skills/deft-directive-pre-pr/SKILL.md` merge-chokepoint attach; forge supersession in `content/scm/github.md` § Merge-gate aggregator (#633). AGENTS/agents-entry pointer only.\n\n**Cross-references:** #4888, #964, #2385, #1369, #633, #1517, #4883 (CLEAN = axis-1 necessity), #4889 (kept out)."
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"id": "edit-files-search-strings-must-capture-full-units-not-substrings-2026-05",
|
|
717
|
+
"title": "edit_files search strings MUST capture full units, not substrings (2026-05)",
|
|
718
|
+
"date": "2026-05",
|
|
719
|
+
"issue_refs": [
|
|
720
|
+
"#1037"
|
|
721
|
+
],
|
|
722
|
+
"tags": [
|
|
723
|
+
"debugging",
|
|
724
|
+
"agent-orchestration",
|
|
725
|
+
"github"
|
|
726
|
+
],
|
|
727
|
+
"source": "Issue #1037 Prefer-A Bound 6689115138. Recurrence: PR #1034 (2026-05-11); #911 cascade (2026-05-04).",
|
|
728
|
+
"body": "**Source:** Issue #1037 Prefer-A Bound 6689115138. Recurrence: PR #1034 (2026-05-11) Greptile P1 on truncated CHANGELOG #441 close-out bullet; sibling outcome class in the #911 cascade (2026-05-04).\n\n**Failure mode:** Exact-string replace tools (`edit_files` / StrReplace-class) replace only the matched `search` bytes. When the agent anchors on a substring of a longer single-line or multi-line entry (CHANGELOG bullet, ROADMAP list item, section body), the unmatched overflow past the search anchor is deleted with the match. The tool did what it was asked; the agent chose too short a search.\n\n**Rule:** When using exact-string-match replacement to modify a single-line or multi-line entry, the `search` value MUST match the FULL line / FULL entry being targeted, including any trailing prose / continuation the agent intends to preserve.\n\n**Anti-pattern:** Pick the first N words of a long bullet as the search anchor; the replacement silently truncates the bullet at the end of the matched substring.\n\n**Mitigation:**\n- ! When targeting a markdown bullet, the `search` value MUST extend to the next blank line or the next top-level list marker, whichever comes first. Re-read the file and capture ALL bytes that belong to the targeted entry.\n- ! When adding a new bullet ABOVE an existing one, an even safer pattern is to anchor `search` on the section heading (e.g. `### Refinement`) and re-emit the heading in `replace` followed by the new bullet and the existing first bullet -- but you MUST still capture every byte of that existing first bullet.\n- ! After every exact-string replace that touches CHANGELOG.md, ROADMAP.md, or any other append-only narrative file, re-read the surrounding 20 lines of the edited region and verify nothing was truncated. This is part of the standard pre-commit file review.\n\n**Recurrence record:**\n- PR #1034 (2026-05-11) -- CHANGELOG.md `### Refinement` first bullet truncated when adding a new bullet above it; Greptile caught it as a P1 in review-cycle.\n- PR #911 cascade (2026-05-04) -- different mechanism (HEAD-only slice resolution), same outcome class: CHANGELOG `[Unreleased]` branch entries dropped on conflict resolution.\n\n**Canonical encoding:** lessons-pack-0.1 entry (this body); projected via `task packs:render` into `meta/lessons.md`. Lesson-tier only -- no new AGENTS.md always-pin; optional `verify:changelog-bullets` stays out of Bound (#1037 Prefer-A Reject).\n\n**Cross-references:** Issue #1037, Prefer-A Bound 6689115138, PR #1034, PR #911 cascade, `skills/deft-directive-build/SKILL.md` / `skills/deft-directive-refinement/SKILL.md` pre-commit file review."
|
|
714
729
|
}
|
|
715
730
|
]
|
|
716
731
|
}
|