@paths.design/caws-cli 11.1.7 → 11.1.8
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/dist/index.js +55 -58
- package/dist/init/hook-packs/manifest-claude-code.d.ts +1 -1
- package/dist/init/hook-packs/manifest-claude-code.d.ts.map +1 -1
- package/dist/init/hook-packs/manifest-claude-code.js +260 -2
- package/dist/init/hook-packs/manifest-claude-code.js.map +1 -1
- package/dist/shell/binding/resolve-binding.d.ts.map +1 -1
- package/dist/shell/binding/resolve-binding.js +105 -1
- package/dist/shell/binding/resolve-binding.js.map +1 -1
- package/dist/shell/binding/types.d.ts +47 -3
- package/dist/shell/binding/types.d.ts.map +1 -1
- package/dist/shell/command-metadata.d.ts +93 -0
- package/dist/shell/command-metadata.d.ts.map +1 -0
- package/dist/shell/command-metadata.js +687 -0
- package/dist/shell/command-metadata.js.map +1 -0
- package/dist/shell/commands/agents.d.ts +1 -2
- package/dist/shell/commands/agents.d.ts.map +1 -1
- package/dist/shell/commands/claim.d.ts +16 -0
- package/dist/shell/commands/claim.d.ts.map +1 -1
- package/dist/shell/commands/claim.js +85 -26
- package/dist/shell/commands/claim.js.map +1 -1
- package/dist/shell/commands/events.d.ts +106 -0
- package/dist/shell/commands/events.d.ts.map +1 -0
- package/dist/shell/commands/events.js +510 -0
- package/dist/shell/commands/events.js.map +1 -0
- package/dist/shell/commands/gates.d.ts +2 -2
- package/dist/shell/commands/gates.d.ts.map +1 -1
- package/dist/shell/commands/gates.js +106 -25
- package/dist/shell/commands/gates.js.map +1 -1
- package/dist/shell/commands/init.d.ts.map +1 -1
- package/dist/shell/commands/init.js +26 -0
- package/dist/shell/commands/init.js.map +1 -1
- package/dist/shell/commands/prepush.d.ts +26 -0
- package/dist/shell/commands/prepush.d.ts.map +1 -0
- package/dist/shell/commands/prepush.js +373 -0
- package/dist/shell/commands/prepush.js.map +1 -0
- package/dist/shell/commands/scope.d.ts.map +1 -1
- package/dist/shell/commands/scope.js +31 -1
- package/dist/shell/commands/scope.js.map +1 -1
- package/dist/shell/commands/specs.d.ts +44 -3
- package/dist/shell/commands/specs.d.ts.map +1 -1
- package/dist/shell/commands/specs.js +411 -15
- package/dist/shell/commands/specs.js.map +1 -1
- package/dist/shell/commands/worktree.d.ts.map +1 -1
- package/dist/shell/commands/worktree.js +51 -1
- package/dist/shell/commands/worktree.js.map +1 -1
- package/dist/shell/gates/disposition.d.ts.map +1 -1
- package/dist/shell/gates/disposition.js +43 -2
- package/dist/shell/gates/disposition.js.map +1 -1
- package/dist/shell/index.d.ts +10 -4
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +22 -2
- package/dist/shell/index.js.map +1 -1
- package/dist/shell/legacy-command-map.js +832 -0
- package/dist/shell/push-range/classify-range.d.ts +99 -0
- package/dist/shell/push-range/classify-range.d.ts.map +1 -0
- package/dist/shell/push-range/classify-range.js +155 -0
- package/dist/shell/push-range/classify-range.js.map +1 -0
- package/dist/shell/push-range/scope-match.d.ts +13 -0
- package/dist/shell/push-range/scope-match.d.ts.map +1 -0
- package/dist/shell/push-range/scope-match.js +53 -0
- package/dist/shell/push-range/scope-match.js.map +1 -0
- package/dist/shell/register.d.ts.map +1 -1
- package/dist/shell/register.js +263 -228
- package/dist/shell/register.js.map +1 -1
- package/dist/shell/registered-command-groups.js +48 -0
- package/dist/shell/rules.d.ts +19 -0
- package/dist/shell/rules.d.ts.map +1 -1
- package/dist/shell/rules.js +27 -0
- package/dist/shell/rules.js.map +1 -1
- package/dist/shell/session/resolve-session.d.ts +29 -1
- package/dist/shell/session/resolve-session.d.ts.map +1 -1
- package/dist/shell/session/resolve-session.js +817 -11
- package/dist/shell/session/resolve-session.js.map +1 -1
- package/dist/shell/session/types.d.ts +127 -1
- package/dist/shell/session/types.d.ts.map +1 -1
- package/dist/shell/session/types.js +10 -4
- package/dist/shell/session/types.js.map +1 -1
- package/dist/store/doctor-snapshot.d.ts.map +1 -1
- package/dist/store/doctor-snapshot.js +26 -0
- package/dist/store/doctor-snapshot.js.map +1 -1
- package/dist/store/events-migration.d.ts +207 -0
- package/dist/store/events-migration.d.ts.map +1 -0
- package/dist/store/events-migration.js +358 -0
- package/dist/store/events-migration.js.map +1 -0
- package/dist/store/events-store.d.ts +47 -1
- package/dist/store/events-store.d.ts.map +1 -1
- package/dist/store/events-store.js +278 -0
- package/dist/store/events-store.js.map +1 -1
- package/dist/store/git-autocommit.d.ts +46 -0
- package/dist/store/git-autocommit.d.ts.map +1 -0
- package/dist/store/git-autocommit.js +198 -0
- package/dist/store/git-autocommit.js.map +1 -0
- package/dist/store/index.d.ts +4 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +7 -1
- package/dist/store/index.js.map +1 -1
- package/dist/store/leases-store.d.ts.map +1 -1
- package/dist/store/leases-store.js +58 -0
- package/dist/store/leases-store.js.map +1 -1
- package/dist/store/rules.d.ts +53 -0
- package/dist/store/rules.d.ts.map +1 -1
- package/dist/store/rules.js +54 -0
- package/dist/store/rules.js.map +1 -1
- package/dist/store/specs-migration.d.ts +128 -0
- package/dist/store/specs-migration.d.ts.map +1 -0
- package/dist/store/specs-migration.js +481 -0
- package/dist/store/specs-migration.js.map +1 -0
- package/dist/store/specs-store.d.ts.map +1 -1
- package/dist/store/specs-store.js +14 -2
- package/dist/store/specs-store.js.map +1 -1
- package/dist/store/specs-writer.d.ts +130 -3
- package/dist/store/specs-writer.d.ts.map +1 -1
- package/dist/store/specs-writer.js +941 -102
- package/dist/store/specs-writer.js.map +1 -1
- package/dist/store/types.d.ts +6 -0
- package/dist/store/types.d.ts.map +1 -1
- package/dist/store/waivers-store.d.ts.map +1 -1
- package/dist/store/waivers-store.js +8 -1
- package/dist/store/waivers-store.js.map +1 -1
- package/dist/store/worktrees-writer.d.ts +28 -0
- package/dist/store/worktrees-writer.d.ts.map +1 -1
- package/dist/store/worktrees-writer.js +110 -12
- package/dist/store/worktrees-writer.js.map +1 -1
- package/package.json +5 -2
- package/templates/hook-packs/claude-code/CLAUDE.md +7 -1
- package/templates/hook-packs/claude-code/agent-heartbeat.sh +1 -1
- package/templates/hook-packs/claude-code/agent-register.sh +1 -1
- package/templates/hook-packs/claude-code/agent-stop.sh +1 -1
- package/templates/hook-packs/claude-code/audit.sh +1 -1
- package/templates/hook-packs/claude-code/block-dangerous.sh +1 -1
- package/templates/hook-packs/claude-code/classify_command.py +1 -1
- package/templates/hook-packs/claude-code/cwd-guard.sh +30 -0
- package/templates/hook-packs/claude-code/dispatch/post_tool_use.sh +15 -4
- package/templates/hook-packs/claude-code/dispatch/pre_tool_use.sh +10 -2
- package/templates/hook-packs/claude-code/dispatch/session_start.sh +1 -1
- package/templates/hook-packs/claude-code/dispatch/stop.sh +2 -2
- package/templates/hook-packs/claude-code/duplicate-export-check.sh +156 -0
- package/templates/hook-packs/claude-code/god-object-check.sh +102 -0
- package/templates/hook-packs/claude-code/guard-strikes.sh +1 -1
- package/templates/hook-packs/claude-code/lib/parse-input.sh +115 -1
- package/templates/hook-packs/claude-code/lib/run-handlers.sh +1 -1
- package/templates/hook-packs/claude-code/loc-delta-check.sh +91 -0
- package/templates/hook-packs/claude-code/naming-check.sh +128 -0
- package/templates/hook-packs/claude-code/plan-transcript-finalize.sh +59 -0
- package/templates/hook-packs/claude-code/plan-transcript-snapshot.sh +86 -0
- package/templates/hook-packs/claude-code/protected-paths.sh +59 -0
- package/templates/hook-packs/claude-code/quiet-merge.sh +68 -0
- package/templates/hook-packs/claude-code/reset-danger-latch.sh +1 -1
- package/templates/hook-packs/claude-code/reset-strikes.sh +1 -1
- package/templates/hook-packs/claude-code/runtime-paths.sh +1 -1
- package/templates/hook-packs/claude-code/scan-secrets.sh +98 -0
- package/templates/hook-packs/claude-code/scope-guard.sh +47 -65
- package/templates/hook-packs/claude-code/session-caws-status.sh +1 -1
- package/templates/hook-packs/claude-code/session-log.sh +1 -1
- package/templates/hook-packs/claude-code/session_log_renderer.py +956 -0
- package/templates/hook-packs/claude-code/shortcut-language-check.sh +147 -0
- package/templates/hook-packs/claude-code/worktree-guard.sh +1 -1
- package/templates/hook-packs/claude-code/worktree-write-guard.sh +1 -1
package/dist/index.js
CHANGED
|
@@ -24,6 +24,15 @@ const { CLI_VERSION } = require('./config');
|
|
|
24
24
|
// Import error handling
|
|
25
25
|
const { handleCliError, findSimilarCommand } = require('./error-handler');
|
|
26
26
|
|
|
27
|
+
// Single authority for the registered v11 command groups (replaces the
|
|
28
|
+
// stale hand-maintained VALID_COMMANDS list) and the legacy-command
|
|
29
|
+
// diagnostic surface (CAWS-REMOVED-COMMAND-DIAGNOSTICS-001).
|
|
30
|
+
const { REGISTERED_COMMAND_GROUPS } = require('./shell/registered-command-groups');
|
|
31
|
+
const {
|
|
32
|
+
classifyLegacyCommand,
|
|
33
|
+
formatLegacyDiagnostic,
|
|
34
|
+
} = require('./shell/legacy-command-map');
|
|
35
|
+
|
|
27
36
|
// v11.0.0 entrypoint. The CLI surface is registered exclusively
|
|
28
37
|
// through `registerShellCommands(program)` further down. All legacy
|
|
29
38
|
// command groups, imports, public exports, and startup side effects
|
|
@@ -31,8 +40,13 @@ const { handleCliError, findSimilarCommand } = require('./error-handler');
|
|
|
31
40
|
// docs/architecture/caws-vnext-command-surface.md for the doctrine,
|
|
32
41
|
// removal table, and the canonical v11 surface.
|
|
33
42
|
//
|
|
34
|
-
// What v11 ships:
|
|
35
|
-
// evidence, waiver
|
|
43
|
+
// What v11.1 ships: the twelve registered command groups — init,
|
|
44
|
+
// doctor, status, scope, claim, gates, evidence, events, waiver, specs,
|
|
45
|
+
// worktree, agents. The authoritative list is REGISTERED_COMMAND_GROUPS
|
|
46
|
+
// (./shell/registered-command-groups), consumed by both register.ts and
|
|
47
|
+
// the unknown-command suggester below. (The original v11.0.0 governed
|
|
48
|
+
// core was eight groups; specs + worktree were restored in v11.1, and
|
|
49
|
+
// events + agents shipped ahead of the broader v11.2 multi-agent plan.)
|
|
36
50
|
|
|
37
51
|
// Initialize global configuration
|
|
38
52
|
const program = new Command();
|
|
@@ -47,28 +61,43 @@ program.configureHelp({
|
|
|
47
61
|
showError: () => {},
|
|
48
62
|
});
|
|
49
63
|
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
// The unknown-command fuzzy suggester reads REGISTERED_COMMAND_GROUPS
|
|
65
|
+
// (imported above from ./shell/registered-command-groups), the single
|
|
66
|
+
// authority for the registered v11 surface. The previous hand-maintained
|
|
67
|
+
// 8-entry VALID_COMMANDS array was removed in
|
|
68
|
+
// CAWS-REMOVED-COMMAND-DIAGNOSTICS-001: it had drifted to 8 entries while
|
|
69
|
+
// register.ts registers 12 groups, so suggestions never fired for events,
|
|
70
|
+
// specs, worktree, or agents.
|
|
71
|
+
|
|
72
|
+
// Shared unknown-command handler. First classifies the argv against the
|
|
73
|
+
// legacy v10.2 command map (longest-prefix); if it matches, prints typed
|
|
74
|
+
// migration guidance and exits 1 WITHOUT executing any v11 command (no
|
|
75
|
+
// alias, no shim, no dispatch). If no legacy match, falls back to the
|
|
76
|
+
// fuzzy suggester over REGISTERED_COMMAND_GROUPS for genuine typos.
|
|
77
|
+
function reportUnknownCommand(commandName) {
|
|
78
|
+
const legacy = classifyLegacyCommand(process.argv.slice(2));
|
|
79
|
+
if (legacy) {
|
|
80
|
+
console.error(chalk.red(`\nUnknown command: ${commandName}`));
|
|
81
|
+
const lines = formatLegacyDiagnostic(legacy);
|
|
82
|
+
for (const line of lines) {
|
|
83
|
+
console.error(chalk.yellow(line));
|
|
84
|
+
}
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const similar = findSimilarCommand(commandName, REGISTERED_COMMAND_GROUPS);
|
|
89
|
+
console.error(chalk.red(`\nUnknown command: ${commandName}`));
|
|
90
|
+
if (similar) {
|
|
91
|
+
console.error(chalk.yellow(`\nDid you mean: caws ${similar}?`));
|
|
92
|
+
}
|
|
93
|
+
console.error(chalk.yellow('Run: caws --help for the full command list'));
|
|
94
|
+
console.error(
|
|
95
|
+
chalk.blue(
|
|
96
|
+
'\nDocumentation: https://github.com/Paths-Design/coding-agent-working-standard/blob/main/docs/api/cli.md'
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
72
101
|
|
|
73
102
|
program.exitOverride((err) => {
|
|
74
103
|
// Handle help and version requests gracefully
|
|
@@ -84,23 +113,7 @@ program.exitOverride((err) => {
|
|
|
84
113
|
|
|
85
114
|
// Check for unknown command
|
|
86
115
|
if (err.code === 'commander.unknownCommand') {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
console.error(chalk.red(`\nUnknown command: ${commandName}`));
|
|
90
|
-
|
|
91
|
-
if (similar) {
|
|
92
|
-
console.error(chalk.yellow(`\nDid you mean: caws ${similar}?`));
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
console.error(chalk.yellow('Run: caws --help for the full command list'));
|
|
96
|
-
console.error(chalk.yellow('Try: caws --help for full command list'));
|
|
97
|
-
console.error(
|
|
98
|
-
chalk.blue(
|
|
99
|
-
'\nDocumentation: https://github.com/Paths-Design/coding-agent-working-standard/blob/main/docs/api/cli.md'
|
|
100
|
-
)
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
process.exit(1);
|
|
116
|
+
reportUnknownCommand(commandName);
|
|
104
117
|
}
|
|
105
118
|
|
|
106
119
|
// Check for unknown option
|
|
@@ -161,23 +174,7 @@ if (require.main === module) {
|
|
|
161
174
|
|
|
162
175
|
// Check for unknown command
|
|
163
176
|
if (error.code === 'commander.unknownCommand') {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
console.error(chalk.red(`\nUnknown command: ${commandName}`));
|
|
167
|
-
|
|
168
|
-
if (similar) {
|
|
169
|
-
console.error(chalk.yellow(`\nDid you mean: caws ${similar}?`));
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
console.error(chalk.yellow('Run: caws --help for the full command list'));
|
|
173
|
-
console.error(chalk.yellow('Try: caws --help for full command list'));
|
|
174
|
-
console.error(
|
|
175
|
-
chalk.blue(
|
|
176
|
-
'\nDocumentation: https://github.com/Paths-Design/coding-agent-working-standard/blob/main/docs/api/cli.md'
|
|
177
|
-
)
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
process.exit(1);
|
|
177
|
+
reportUnknownCommand(commandName);
|
|
181
178
|
}
|
|
182
179
|
|
|
183
180
|
// Check for unknown option
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-claude-code.d.ts","sourceRoot":"","sources":["../../../src/init/hook-packs/manifest-claude-code.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest-claude-code.d.ts","sourceRoot":"","sources":["../../../src/init/hook-packs/manifest-claude-code.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAoK1C,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,gBAAgB,EAAE,UAkU9B,CAAC"}
|
|
@@ -51,7 +51,143 @@ exports.CLAUDE_CODE_PACK = exports.CLAUDE_CODE_PACK_VERSION = void 0;
|
|
|
51
51
|
// Closes the enforcement gap that failure-lineage Entry 19 documented
|
|
52
52
|
// as visibility-without-enforcement. No new managed files; no stateModel
|
|
53
53
|
// changes (leases/worktrees.json already declared).
|
|
54
|
-
|
|
54
|
+
//
|
|
55
|
+
// Version 6: CAWS-HOOK-PACK-RENDERER-MISSING-001. Ships
|
|
56
|
+
// session_log_renderer.py alongside session-log.sh. Prior versions
|
|
57
|
+
// shipped session-log.sh with `RENDERER="$SCRIPT_DIR/session_log_renderer.py"`
|
|
58
|
+
// (line 35 of session-log.sh) but did NOT bundle the renderer
|
|
59
|
+
// itself, so every `caws init --agent-surface claude-code` produced
|
|
60
|
+
// a session-log.sh that crashed when invoked. Adds the renderer as
|
|
61
|
+
// a managed file (executable: false; invoked via `python3 <path>`).
|
|
62
|
+
// Removed Sterling-specific MEANINGFUL_COMMAND_KW entries (cargo
|
|
63
|
+
// test, cargo build, ruff, mypy) from the renderer's baseline;
|
|
64
|
+
// future work (CAWS-HOOK-PACK-RENDERER-CONFIG-001, not yet
|
|
65
|
+
// authored) may admit a sidecar config for consumer toolchain
|
|
66
|
+
// extensions. No stateModel changes (tmp/<session-id>/ already
|
|
67
|
+
// declared; the renderer writes into the same surface session-log.sh
|
|
68
|
+
// already declared as a write).
|
|
69
|
+
//
|
|
70
|
+
// Version 7: CAWS-HOOK-PACK-PROMOTE-001. Promotes all 7 PORT-classified
|
|
71
|
+
// hooks from the Sterling hook audit
|
|
72
|
+
// (docs/reports/sterling_hook_port_audit_001.md):
|
|
73
|
+
// - cwd-guard.sh (PreToolUse, lineage 22): blocks tool calls when
|
|
74
|
+
// the working directory has been deleted. Mitigates a documented
|
|
75
|
+
// Claude Code session-crash class.
|
|
76
|
+
// - protected-paths.sh (PreToolUse, lineage 23): blocks Write/Edit
|
|
77
|
+
// on .claude/hooks/* and .claude/logs/guard-strikes-*.json.
|
|
78
|
+
// Closes the doctrine-vs-enforcement gap that lets agents edit
|
|
79
|
+
// their own hook state.
|
|
80
|
+
// - scan-secrets.sh (PreToolUse, lineage 24): advisory on .env
|
|
81
|
+
// files, SSH keys, cloud configs. Never blocks.
|
|
82
|
+
// - naming-check.sh (PostToolUse, lineage 25): "no shadow files"
|
|
83
|
+
// enforcement. Banned modifier suffixes, version suffixes, date
|
|
84
|
+
// stamps. Genericized: dropped Sterling-era references to the
|
|
85
|
+
// v10 `caws naming check` CLI and `.caws/canonical-map.yaml`.
|
|
86
|
+
// - quiet-merge.sh (PreToolUse LAST, lineage 26): rewrites
|
|
87
|
+
// `caws worktree merge|destroy` bash commands to cd to repo
|
|
88
|
+
// root + suppress output, avoiding subagent CWD-destroyed
|
|
89
|
+
// crashes and context-window overflow on verbose merge output.
|
|
90
|
+
// Companion to cwd-guard.sh.
|
|
91
|
+
// - plan-transcript-snapshot.sh (PostToolUse on ExitPlanMode,
|
|
92
|
+
// lineage 27): snapshots the conversation transcript co-located
|
|
93
|
+
// with the plan file when ExitPlanMode fires.
|
|
94
|
+
// - plan-transcript-finalize.sh (Stop, lineage 27): drains the
|
|
95
|
+
// pending-snapshots list and overwrites each with the final
|
|
96
|
+
// turn-end transcript. Companion to plan-transcript-snapshot.sh.
|
|
97
|
+
// Dispatcher updates: pre_tool_use.sh adds cwd-guard, protected-paths,
|
|
98
|
+
// scan-secrets, quiet-merge (last); post_tool_use.sh adds
|
|
99
|
+
// naming-check, plan-transcript-snapshot; stop.sh adds
|
|
100
|
+
// plan-transcript-finalize. No stateModel changes (the plan-transcript
|
|
101
|
+
// pair writes to $HOME/.claude/.pending-plan-snapshots, outside the
|
|
102
|
+
// repo).
|
|
103
|
+
//
|
|
104
|
+
// Version 8: CAWS-LITE-MODE-RETIREMENT-001. Removes the v10 "Lite mode"
|
|
105
|
+
// branch from scope-guard.sh. The branch previously read
|
|
106
|
+
// `.caws/scope.json` and enforced lite-mode rules when no `.caws/specs/`
|
|
107
|
+
// directory was present — a v10 fallback that silently disagreed with
|
|
108
|
+
// `caws doctor`'s v11 view of the same project. v8 hooks ignore
|
|
109
|
+
// `.caws/scope.json` entirely; consumers with a legacy file get a
|
|
110
|
+
// doctor finding (informational) pointing at the migration guide.
|
|
111
|
+
// No stateModel changes; no new managed files. The retirement is the
|
|
112
|
+
// LIVE component of CAWS-LITE-MODE-RETIREMENT-001 — the spec also
|
|
113
|
+
// authorizes deleting v10 source archaeology (src/config/lite-scope.js,
|
|
114
|
+
// src/config/modes.js, src/scaffold/, the lite branches in
|
|
115
|
+
// src/commands/init.js + src/commands/specs.js) but those files are
|
|
116
|
+
// already excluded from the v11 npm package by build-cli.js's
|
|
117
|
+
// allowlist, so deleting them is hygiene, not a behavior change.
|
|
118
|
+
// Companion docs section in docs/migration-v10-to-v11.md.
|
|
119
|
+
//
|
|
120
|
+
// Version 9: CAWS-SCOPE-STRIKE-SOURCE-UNIFY-001. Makes scope-guard.sh
|
|
121
|
+
// delegate to `caws scope check <path>` (the kernel-backed authority)
|
|
122
|
+
// before falling through to its inline node block. This unifies the
|
|
123
|
+
// scope-decision source: the hook's ADMIT/REFUSE matches what
|
|
124
|
+
// `caws scope show <path>` would report, eliminating the divergence
|
|
125
|
+
// class that Sterling turn-043 (2026-05-26) hit, where
|
|
126
|
+
// `caws scope show` returned ADMIT but the hook kept incrementing
|
|
127
|
+
// strikes against a previously-rejected path.
|
|
128
|
+
//
|
|
129
|
+
// Side effect (intentional): strike-state staleness is auto-resolved.
|
|
130
|
+
// When the kernel says ADMIT, the hook exits 0 immediately without
|
|
131
|
+
// invoking the strike counter, regardless of prior strikes accumulated
|
|
132
|
+
// against the path. The user no longer needs to run
|
|
133
|
+
// `reset-strikes.sh --current` after a scope.in amendment that newly
|
|
134
|
+
// admits a hot file.
|
|
135
|
+
//
|
|
136
|
+
// The inline node block (which was the only scope-decision path in
|
|
137
|
+
// pack v8) remains as the fallback when `caws` is not on PATH, and as
|
|
138
|
+
// the source of structured diagnostic detail (out_of_scope vs
|
|
139
|
+
// not_in_scope, the offending pattern, union vs authoritative mode)
|
|
140
|
+
// since `caws scope check` only exposes admit/refuse via exit code.
|
|
141
|
+
// A future iteration can collapse the fallback once
|
|
142
|
+
// `caws scope check --explain` exposes the structured detail.
|
|
143
|
+
//
|
|
144
|
+
// No new managed files; no stateModel changes.
|
|
145
|
+
//
|
|
146
|
+
// Version 10: CAWS-WORKTREE-OWNERSHIP-HARNESS-ID-001. parse-input.sh now
|
|
147
|
+
// also writes/refreshes a per-repo caller-session pointer at
|
|
148
|
+
// `<repo_root>/tmp/.caller-session.json` (alongside the existing durable
|
|
149
|
+
// envelope). In agent-Bash HOOK_SESSION_ID is absent, so when multiple
|
|
150
|
+
// fresh sibling envelopes match the repo the resolver cannot tell which
|
|
151
|
+
// is the caller's and refuses (then a rotating capsule gets frozen as
|
|
152
|
+
// worktrees.json owner -> own-worktree foreign-claim lockout after
|
|
153
|
+
// rotation/compact). The pointer names the session that most recently
|
|
154
|
+
// fired a hook in this repo; the resolver consumes it ONLY to
|
|
155
|
+
// disambiguate that >=2-fresh-envelope case to the caller's own
|
|
156
|
+
// envelope. Evidence, not authority: absent/stale/malformed/non-matching
|
|
157
|
+
// pointer still refuses. NEVER newest-wins. No new managed files (the
|
|
158
|
+
// pointer is written by the already-shipped parse-input.sh); stateModel
|
|
159
|
+
// gains the pointer write path.
|
|
160
|
+
//
|
|
161
|
+
// Version 11: QG-HOOKS-EXTRACT-001. Adds four advisory PostToolUse hooks
|
|
162
|
+
// that form the edit-time quality plane, the boundary analogue of the
|
|
163
|
+
// load-bearing quality-gates signals (packages/quality-gates/*.mjs):
|
|
164
|
+
// - god-object-check.sh (lineage 28): SLOC-threshold advisory; warns
|
|
165
|
+
// when a written/edited file exceeds CAWS_GOD_OBJECT_LOC (default
|
|
166
|
+
// 2000). Always exit 0. Edit-time analogue of the `god_object` gate.
|
|
167
|
+
// - shortcut-language-check.sh (lineage 29): flags TODO/FIXME/XXX/
|
|
168
|
+
// placeholder/"not implemented" language in NON-test committed-bound
|
|
169
|
+
// source. The only one of the four that can block — escalates via the
|
|
170
|
+
// existing guard_enforce_progressive_strikes (strike 1 warn, 2 ask,
|
|
171
|
+
// 3 block). Edit-time analogue of the `todo_detection` gate.
|
|
172
|
+
// - duplicate-export-check.sh (lineage 30): on Write of a new JS/TS
|
|
173
|
+
// file, flags an exported symbol whose name already exists elsewhere
|
|
174
|
+
// in the enclosing package src tree (exact match, generic-name
|
|
175
|
+
// allowlist). Advisory; bounded ripgrep/grep, never node_modules.
|
|
176
|
+
// - loc-delta-check.sh (lineage 31): on Edit, warns when the
|
|
177
|
+
// new_string vs old_string newline delta exceeds
|
|
178
|
+
// CAWS_LOC_DELTA_WARN_THRESHOLD (default 300). Always advisory.
|
|
179
|
+
//
|
|
180
|
+
// These hooks reimplement detection INTENT in self-contained bash; they
|
|
181
|
+
// do NOT import, require, or shell out to any packages/quality-gates
|
|
182
|
+
// module, and they do NOT alter `caws gates run` (the governed policy-gate
|
|
183
|
+
// runner). This is option-C doctrine: the edit-time advisory plane is an
|
|
184
|
+
// installed hook-pack utility the repo tunes via env; the gates command
|
|
185
|
+
// remains a separate governed surface. Dispatcher update: dispatch/
|
|
186
|
+
// post_tool_use.sh registers the four new handlers in its HANDLERS array
|
|
187
|
+
// (advisory-self-filtering; ordering preserved). No stateModel changes
|
|
188
|
+
// (the hooks read only the file being checked + the existing guard-strikes
|
|
189
|
+
// state path under .claude/, already declared).
|
|
190
|
+
exports.CLAUDE_CODE_PACK_VERSION = 11;
|
|
55
191
|
exports.CLAUDE_CODE_PACK = {
|
|
56
192
|
id: 'claude-code',
|
|
57
193
|
targetSurface: 'claude-code',
|
|
@@ -77,9 +213,10 @@ exports.CLAUDE_CODE_PACK = {
|
|
|
77
213
|
'.claude/hooks/state/guard-strikes-*.json',
|
|
78
214
|
'.caws/leases/',
|
|
79
215
|
'tmp/<session-id>/',
|
|
216
|
+
'tmp/.caller-session.json',
|
|
80
217
|
],
|
|
81
218
|
},
|
|
82
|
-
lineageRefs: [1, 4, 6, 8, 11, 12, 13, 16, 17, 19],
|
|
219
|
+
lineageRefs: [1, 4, 6, 8, 11, 12, 13, 16, 17, 19, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
|
|
83
220
|
// Installed files. Order is deterministic (used by tests and by the
|
|
84
221
|
// install reporter). destPath is relative to repo root.
|
|
85
222
|
// sourcePath is relative to the pack root
|
|
@@ -174,6 +311,18 @@ exports.CLAUDE_CODE_PACK = {
|
|
|
174
311
|
executable: true,
|
|
175
312
|
managed: true,
|
|
176
313
|
},
|
|
314
|
+
{
|
|
315
|
+
// CAWS-HOOK-PACK-RENDERER-MISSING-001: session-log.sh shells out
|
|
316
|
+
// to this Python script via `python3 "$RENDERER"`. Before v6 the
|
|
317
|
+
// renderer was NOT bundled and every `caws init` shipped a broken
|
|
318
|
+
// session-log.sh that crashed on invocation. Not marked executable
|
|
319
|
+
// because it is invoked via python3 <path>, not as a standalone
|
|
320
|
+
// binary.
|
|
321
|
+
destPath: '.claude/hooks/session_log_renderer.py',
|
|
322
|
+
sourcePath: 'session_log_renderer.py',
|
|
323
|
+
executable: false,
|
|
324
|
+
managed: true,
|
|
325
|
+
},
|
|
177
326
|
{
|
|
178
327
|
destPath: '.claude/hooks/audit.sh',
|
|
179
328
|
sourcePath: 'audit.sh',
|
|
@@ -231,6 +380,115 @@ exports.CLAUDE_CODE_PACK = {
|
|
|
231
380
|
// settings.json (or to create one from the canonical snippet in
|
|
232
381
|
// CLAUDE.md if absent). This avoids JSON-merge complexity and
|
|
233
382
|
// preserves user-owned settings.
|
|
383
|
+
// -- CAWS-HOOK-PACK-PROMOTE-001 (v7): hooks promoted from Sterling --
|
|
384
|
+
// See docs/reports/sterling_hook_port_audit_001.md and
|
|
385
|
+
// docs/failure-lineage.md entries 22-25 for the governance gaps
|
|
386
|
+
// each closes.
|
|
387
|
+
{
|
|
388
|
+
// PreToolUse: blocks tool calls when the working directory has
|
|
389
|
+
// been deleted (worktree-destroyed-while-inside class).
|
|
390
|
+
destPath: '.claude/hooks/cwd-guard.sh',
|
|
391
|
+
sourcePath: 'cwd-guard.sh',
|
|
392
|
+
executable: true,
|
|
393
|
+
managed: true,
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
// PreToolUse: blocks agent-side Write/Edit on hook scripts and
|
|
397
|
+
// strike-state files. Structural enforcement of the doctrine
|
|
398
|
+
// that hooks may not be edited by an agent's local judgment.
|
|
399
|
+
destPath: '.claude/hooks/protected-paths.sh',
|
|
400
|
+
sourcePath: 'protected-paths.sh',
|
|
401
|
+
executable: true,
|
|
402
|
+
managed: true,
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
// PreToolUse: advisory-only warning on secret-bearing file paths.
|
|
406
|
+
destPath: '.claude/hooks/scan-secrets.sh',
|
|
407
|
+
sourcePath: 'scan-secrets.sh',
|
|
408
|
+
executable: true,
|
|
409
|
+
managed: true,
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
// PostToolUse: "no shadow files" doctrine enforcement.
|
|
413
|
+
// Advisory-only. Genericized: no v10 CLI references.
|
|
414
|
+
destPath: '.claude/hooks/naming-check.sh',
|
|
415
|
+
sourcePath: 'naming-check.sh',
|
|
416
|
+
executable: true,
|
|
417
|
+
managed: true,
|
|
418
|
+
},
|
|
419
|
+
// -- QG-HOOKS-EXTRACT-001 (v11): edit-time advisory quality plane --
|
|
420
|
+
// Four PostToolUse hooks that reimplement the load-bearing
|
|
421
|
+
// quality-gates detection INTENT (god_object, todo_detection,
|
|
422
|
+
// functional-duplication name collision, LOC-delta) in self-contained
|
|
423
|
+
// bash. They do NOT import or invoke any packages/quality-gates module
|
|
424
|
+
// and do NOT change `caws gates run` (option-C doctrine). Three are
|
|
425
|
+
// always-advisory (exit 0); shortcut-language-check escalates via
|
|
426
|
+
// guard-strikes on the third session strike. See failure-lineage
|
|
427
|
+
// entries 28-31.
|
|
428
|
+
{
|
|
429
|
+
// PostToolUse Write/Edit: SLOC-threshold god-object advisory.
|
|
430
|
+
destPath: '.claude/hooks/god-object-check.sh',
|
|
431
|
+
sourcePath: 'god-object-check.sh',
|
|
432
|
+
executable: true,
|
|
433
|
+
managed: true,
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
// PostToolUse Write/Edit: shortcut/placeholder-language progressive
|
|
437
|
+
// check (the only blocking one — strike 3 via guard-strikes).
|
|
438
|
+
destPath: '.claude/hooks/shortcut-language-check.sh',
|
|
439
|
+
sourcePath: 'shortcut-language-check.sh',
|
|
440
|
+
executable: true,
|
|
441
|
+
managed: true,
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
// PostToolUse Write: duplicate-export advisory (exact symbol-name
|
|
445
|
+
// collision in the enclosing package src tree).
|
|
446
|
+
destPath: '.claude/hooks/duplicate-export-check.sh',
|
|
447
|
+
sourcePath: 'duplicate-export-check.sh',
|
|
448
|
+
executable: true,
|
|
449
|
+
managed: true,
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
// PostToolUse Edit: LOC-delta advisory (new_string vs old_string
|
|
453
|
+
// newline delta over CAWS_LOC_DELTA_WARN_THRESHOLD).
|
|
454
|
+
destPath: '.claude/hooks/loc-delta-check.sh',
|
|
455
|
+
sourcePath: 'loc-delta-check.sh',
|
|
456
|
+
executable: true,
|
|
457
|
+
managed: true,
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
// PreToolUse (LAST): rewrites caws worktree merge|destroy
|
|
461
|
+
// bash commands for CWD safety + output suppression.
|
|
462
|
+
// MUST be last in dispatch/pre_tool_use.sh because it emits
|
|
463
|
+
// updatedInput which replaces any prior interceptor's
|
|
464
|
+
// updatedInput. Companion to cwd-guard.sh (lineage entry 22)
|
|
465
|
+
// for the worktree-destroyed-while-inside class. Lineage 26.
|
|
466
|
+
destPath: '.claude/hooks/quiet-merge.sh',
|
|
467
|
+
sourcePath: 'quiet-merge.sh',
|
|
468
|
+
executable: true,
|
|
469
|
+
managed: true,
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
// PostToolUse (ExitPlanMode-filtered): snapshots the session
|
|
473
|
+
// transcript co-located with the plan file at the moment
|
|
474
|
+
// ExitPlanMode fires. Paired with plan-transcript-finalize.sh
|
|
475
|
+
// (Stop). Lineage 27.
|
|
476
|
+
destPath: '.claude/hooks/plan-transcript-snapshot.sh',
|
|
477
|
+
sourcePath: 'plan-transcript-snapshot.sh',
|
|
478
|
+
executable: true,
|
|
479
|
+
managed: true,
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
// Stop: drains $HOME/.claude/.pending-plan-snapshots and
|
|
483
|
+
// overwrites each pending snapshot with the turn-end
|
|
484
|
+
// transcript. Companion to plan-transcript-snapshot.sh.
|
|
485
|
+
// Already referenced in dispatch/stop.sh; this entry makes
|
|
486
|
+
// the pack manifest install it. Lineage 27.
|
|
487
|
+
destPath: '.claude/hooks/plan-transcript-finalize.sh',
|
|
488
|
+
sourcePath: 'plan-transcript-finalize.sh',
|
|
489
|
+
executable: true,
|
|
490
|
+
managed: true,
|
|
491
|
+
},
|
|
234
492
|
// -- Doctrine landing for hook editors --
|
|
235
493
|
{
|
|
236
494
|
destPath: '.claude/hooks/CLAUDE.md',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-claude-code.js","sourceRoot":"","sources":["../../../src/init/hook-packs/manifest-claude-code.ts"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,EAAE;AACF,wEAAwE;AACxE,0EAA0E;AAC1E,uEAAuE;AACvE,wBAAwB;AACxB,EAAE;AACF,yCAAyC;AACzC,2BAA2B;AAC3B,mFAAmF;AACnF,oFAAoF;AACpF,kDAAkD;AAClD,uEAAuE;AACvE,oFAAoF;AACpF,gEAAgE;AAChE,yEAAyE;AACzE,0EAA0E;AAC1E,+GAA+G;AAC/G,+EAA+E;AAC/E,kFAAkF;AAClF,gFAAgF;AAChF,iFAAiF;AACjF,6EAA6E;AAC7E,6EAA6E;;;AAI7E,qEAAqE;AACrE,uEAAuE;AACvE,eAAe;AACf,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,gCAAgC;AAChC,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,sEAAsE;AACtE,oEAAoE;AACpE,oEAAoE;AACpE,sDAAsD;AACtD,EAAE;AACF,mEAAmE;AACnE,iEAAiE;AACjE,6DAA6D;AAC7D,mEAAmE;AACnE,oEAAoE;AACpE,sEAAsE;AACtE,oEAAoE;AACpE,qEAAqE;AACrE,sEAAsE;AACtE,yEAAyE;AACzE,oDAAoD;AACvC,QAAA,wBAAwB,GAAG,
|
|
1
|
+
{"version":3,"file":"manifest-claude-code.js","sourceRoot":"","sources":["../../../src/init/hook-packs/manifest-claude-code.ts"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,EAAE;AACF,wEAAwE;AACxE,0EAA0E;AAC1E,uEAAuE;AACvE,wBAAwB;AACxB,EAAE;AACF,yCAAyC;AACzC,2BAA2B;AAC3B,mFAAmF;AACnF,oFAAoF;AACpF,kDAAkD;AAClD,uEAAuE;AACvE,oFAAoF;AACpF,gEAAgE;AAChE,yEAAyE;AACzE,0EAA0E;AAC1E,+GAA+G;AAC/G,+EAA+E;AAC/E,kFAAkF;AAClF,gFAAgF;AAChF,iFAAiF;AACjF,6EAA6E;AAC7E,6EAA6E;;;AAI7E,qEAAqE;AACrE,uEAAuE;AACvE,eAAe;AACf,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,gCAAgC;AAChC,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,sEAAsE;AACtE,oEAAoE;AACpE,oEAAoE;AACpE,sDAAsD;AACtD,EAAE;AACF,mEAAmE;AACnE,iEAAiE;AACjE,6DAA6D;AAC7D,mEAAmE;AACnE,oEAAoE;AACpE,sEAAsE;AACtE,oEAAoE;AACpE,qEAAqE;AACrE,sEAAsE;AACtE,yEAAyE;AACzE,oDAAoD;AACpD,EAAE;AACF,wDAAwD;AACxD,mEAAmE;AACnE,+EAA+E;AAC/E,8DAA8D;AAC9D,oEAAoE;AACpE,mEAAmE;AACnE,oEAAoE;AACpE,iEAAiE;AACjE,+DAA+D;AAC/D,2DAA2D;AAC3D,8DAA8D;AAC9D,+DAA+D;AAC/D,qEAAqE;AACrE,gCAAgC;AAChC,EAAE;AACF,wEAAwE;AACxE,qCAAqC;AACrC,kDAAkD;AAClD,oEAAoE;AACpE,qEAAqE;AACrE,uCAAuC;AACvC,qEAAqE;AACrE,g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-
{"version":3,"file":"resolve-binding.d.ts","sourceRoot":"","sources":["../../../src/shell/binding/resolve-binding.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"resolve-binding.d.ts","sourceRoot":"","sources":["../../../src/shell/binding/resolve-binding.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAEV,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EAChB,MAAM,SAAS,CAAC;AA0BjB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,gBAAgB,EAAE,CAqChF;AAiGD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,eAAe,CAkI1E"}
|
|
@@ -140,6 +140,73 @@ function findRegistryMatch(cwdReal, registry) {
|
|
|
140
140
|
}
|
|
141
141
|
return best;
|
|
142
142
|
}
|
|
143
|
+
// SCOPE-CHECK-CWD-BINDING-RESOLUTION-001 helpers ─────────────────────────
|
|
144
|
+
//
|
|
145
|
+
// These power the target-path fallback (steps 2 and 3) when cwd does not
|
|
146
|
+
// resolve a worktree. They are pure functions of (targetPath, registry,
|
|
147
|
+
// specs) — no process.cwd(), no I/O beyond the realpath the caller already
|
|
148
|
+
// did — so the binding for a path is identical from any invocation cwd.
|
|
149
|
+
/**
|
|
150
|
+
* Normalize a repo-root-relative path to POSIX separators with no leading
|
|
151
|
+
* "./" or trailing slash, for stable matching against scope.in entries.
|
|
152
|
+
*/
|
|
153
|
+
function normalizeRel(p) {
|
|
154
|
+
return p.replace(/\\/g, '/').replace(/^\.\//, '').replace(/\/+$/, '');
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Anchored glob match supporting `*` (any run of non-separator or separator
|
|
158
|
+
* chars within a segment-agnostic match) and `?` (single char). A bare
|
|
159
|
+
* directory entry (no glob meta) matches the entry itself OR any descendant
|
|
160
|
+
* (prefix match on a path boundary) — mirroring how scope.in directory
|
|
161
|
+
* entries admit files beneath them. No dependency on minimatch.
|
|
162
|
+
*/
|
|
163
|
+
function scopeEntryMatches(entry, target) {
|
|
164
|
+
const e = normalizeRel(entry);
|
|
165
|
+
const t = normalizeRel(target);
|
|
166
|
+
if (e === t)
|
|
167
|
+
return true;
|
|
168
|
+
if (!/[*?]/.test(e)) {
|
|
169
|
+
// Directory/prefix entry: admit descendants on a path boundary.
|
|
170
|
+
return t.startsWith(e + '/');
|
|
171
|
+
}
|
|
172
|
+
// Glob entry: translate to an anchored RegExp. `*` → [^/]-agnostic any,
|
|
173
|
+
// `?` → single char. Escape all other regex meta.
|
|
174
|
+
const rx = e
|
|
175
|
+
.split('')
|
|
176
|
+
.map((ch) => {
|
|
177
|
+
if (ch === '*')
|
|
178
|
+
return '.*';
|
|
179
|
+
if (ch === '?')
|
|
180
|
+
return '.';
|
|
181
|
+
return ch.replace(/[.+^${}()|[\]\\]/g, '\\$&');
|
|
182
|
+
})
|
|
183
|
+
.join('');
|
|
184
|
+
return new RegExp(`^${rx}$`).test(t);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Step (3): find every active bound spec whose scope.in admits `targetPath`.
|
|
188
|
+
* Returns one claimant per matching spec, naming the spec, its worktree, and
|
|
189
|
+
* the exact scope.in entry that matched (for the actionable refusal).
|
|
190
|
+
*/
|
|
191
|
+
function findScopeInClaimants(targetPath, input) {
|
|
192
|
+
const claimants = [];
|
|
193
|
+
for (const [name, record] of Object.entries(input.registry)) {
|
|
194
|
+
const specId = record?.specId;
|
|
195
|
+
if (typeof specId !== 'string' || specId.length === 0)
|
|
196
|
+
continue;
|
|
197
|
+
const spec = input.specs.find((s) => s.id === specId);
|
|
198
|
+
if (spec === undefined)
|
|
199
|
+
continue;
|
|
200
|
+
if (spec.lifecycle_state !== 'active')
|
|
201
|
+
continue;
|
|
202
|
+
const scopeIn = spec.scope?.in ?? [];
|
|
203
|
+
const matched = scopeIn.find((entry) => scopeEntryMatches(entry, targetPath));
|
|
204
|
+
if (matched !== undefined) {
|
|
205
|
+
claimants.push({ specId, worktreeName: name, matchedScopeInEntry: matched });
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return claimants;
|
|
209
|
+
}
|
|
143
210
|
function resolveBinding(input) {
|
|
144
211
|
const cwdReal = safeRealpath(input.cwd);
|
|
145
212
|
const repoRootReal = safeRealpath(input.repoRoot);
|
|
@@ -182,7 +249,44 @@ function resolveBinding(input) {
|
|
|
182
249
|
}
|
|
183
250
|
}
|
|
184
251
|
if (candidate === null) {
|
|
185
|
-
|
|
252
|
+
// SCOPE-CHECK-CWD-BINDING-RESOLUTION-001: cwd resolved no worktree.
|
|
253
|
+
// Before falling to `unbound`, try to resolve the binding from the
|
|
254
|
+
// TARGET PATH so the verdict is cwd-independent.
|
|
255
|
+
if (typeof input.targetPath === 'string' && input.targetPath.length > 0) {
|
|
256
|
+
const targetAbs = safeRealpath(path.isAbsolute(input.targetPath)
|
|
257
|
+
? input.targetPath
|
|
258
|
+
: path.join(repoRootReal, input.targetPath));
|
|
259
|
+
// Step (2): target-path worktree-location. If the absolute path lies
|
|
260
|
+
// under a registered worktree's path, that worktree binds. Unambiguous
|
|
261
|
+
// (a path is inside at most one worktree dir); take the deepest match.
|
|
262
|
+
const locMatch = findRegistryMatch(targetAbs, input.registry);
|
|
263
|
+
if (locMatch !== null) {
|
|
264
|
+
candidate = locMatch;
|
|
265
|
+
source = 'target_worktree_location';
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
// Step (3): target-path scope.in claim.
|
|
269
|
+
const claimants = findScopeInClaimants(input.targetPath, input);
|
|
270
|
+
if (claimants.length === 1) {
|
|
271
|
+
const only = claimants[0];
|
|
272
|
+
candidate = { name: only.worktreeName, path: '' };
|
|
273
|
+
source = 'target_scope_in_claim';
|
|
274
|
+
}
|
|
275
|
+
else if (claimants.length > 1) {
|
|
276
|
+
// Refuse-on-conflict: name every claimant, pick none. `binding`
|
|
277
|
+
// stays `unbound` (safe default); the ambiguity rides in the
|
|
278
|
+
// dedicated `ambiguous` field that scope check inspects.
|
|
279
|
+
return {
|
|
280
|
+
binding: { kind: 'unbound' },
|
|
281
|
+
ambiguous: { targetPath: normalizeRel(input.targetPath), claimants },
|
|
282
|
+
source: 'target_scope_in_claim',
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (candidate === null) {
|
|
288
|
+
return { binding: { kind: 'unbound' }, source: 'none' };
|
|
289
|
+
}
|
|
186
290
|
}
|
|
187
291
|
// We have a worktree name. Now find the bound spec for kernel evaluation.
|
|
188
292
|
const record = input.registry[candidate.name];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-binding.js","sourceRoot":"","sources":["../../../src/shell/binding/resolve-binding.ts"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,6DAA6D;AAC7D,EAAE;AACF,aAAa;AACb,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,qEAAqE;AACrE,0EAA0E;AAC1E,4EAA4E;AAC5E,uEAAuE;AACvE,iCAAiC;AACjC,qEAAqE;AACrE,2EAA2E;AAC3E,gEAAgE;AAChE,yEAAyE;AACzE,mEAAmE;AACnE,0EAA0E;AAC1E,sEAAsE;AACtE,uDAAuD;AACvD,EAAE;AACF,kEAAkE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"resolve-binding.js","sourceRoot":"","sources":["../../../src/shell/binding/resolve-binding.ts"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,6DAA6D;AAC7D,EAAE;AACF,aAAa;AACb,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,qEAAqE;AACrE,0EAA0E;AAC1E,4EAA4E;AAC5E,uEAAuE;AACvE,iCAAiC;AACjC,qEAAqE;AACrE,2EAA2E;AAC3E,gEAAgE;AAChE,yEAAyE;AACzE,mEAAmE;AACnE,0EAA0E;AAC1E,sEAAsE;AACtE,uDAAuD;AACvD,EAAE;AACF,kEAAkE;;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