@yasaswy.nagavolu/agents 0.17.2 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/bin/cli.js +36 -1
- package/content/global/CLAUDE.md +9 -2
- package/content/manifest.json +133 -0
- package/content/manifest.schema.json +17 -1
- package/content/proxy/README.md +4 -3
- package/content/proxy/agent_model_guard.py +58 -12
- package/content/proxy/artifact_mocker_gate.py +9 -1
- package/content/proxy/bg_process_registry.py +12 -4
- package/content/proxy/code_is_law_lint_hook.py +9 -1
- package/content/proxy/edit_videos_intent_hook.py +97 -0
- package/content/proxy/execution_worker_review_gate.py +39 -6
- package/content/proxy/headless_process.py +48 -0
- package/content/proxy/headless_spawn_guard.py +164 -0
- package/content/proxy/memory_first_hook.py +9 -1
- package/content/proxy/model_id_leak_guard.py +9 -1
- package/content/proxy/no_openrouter_guard.py +9 -1
- package/content/proxy/portal/aggregator.py +8 -1
- package/content/proxy/prd_closing_gate.py +9 -1
- package/content/proxy/project_resolver.py +10 -1
- package/content/proxy/resolve_policy_guard.py +106 -0
- package/content/proxy/route_lock.py +11 -3
- package/content/proxy/shared_worktree_revert_guard.py +7 -1
- package/content/proxy/worktree_targets.py +20 -0
- package/content/skills/edit-videos/SKILL.md +66 -0
- package/content/skills/edit-videos/engine/__init__.py +0 -0
- package/content/skills/edit-videos/engine/__main__.py +4 -0
- package/content/skills/edit-videos/engine/blur.py +157 -0
- package/content/skills/edit-videos/engine/captions.py +127 -0
- package/content/skills/edit-videos/engine/cli.py +318 -0
- package/content/skills/edit-videos/engine/contact_sheet.py +63 -0
- package/content/skills/edit-videos/engine/detect_idle.py +117 -0
- package/content/skills/edit-videos/engine/ffmpeg_io.py +76 -0
- package/content/skills/edit-videos/engine/map_time.py +48 -0
- package/content/skills/edit-videos/engine/probe.py +31 -0
- package/content/skills/edit-videos/engine/render.py +179 -0
- package/content/skills/edit-videos/engine/resolve_export.py +336 -0
- package/content/skills/edit-videos/engine/schema.py +220 -0
- package/content/skills/edit-videos/engine/timeline.py +229 -0
- package/content/skills/edit-videos/engine/zoom.py +50 -0
- package/content/skills/edit-videos/pyproject.toml +32 -0
- package/content/skills/edit-videos/resolve_ui/__init__.py +0 -0
- package/content/skills/edit-videos/resolve_ui/__main__.py +4 -0
- package/content/skills/edit-videos/resolve_ui/cli.py +223 -0
- package/content/skills/edit-videos/resolve_ui/coord_clicks.py +77 -0
- package/content/skills/edit-videos/resolve_ui/dialogs.py +72 -0
- package/content/skills/edit-videos/resolve_ui/focus_guard.py +48 -0
- package/content/skills/edit-videos/resolve_ui/idle.py +42 -0
- package/content/skills/edit-videos/resolve_ui/importing.py +73 -0
- package/content/skills/edit-videos/resolve_ui/job_registry.py +33 -0
- package/content/skills/edit-videos/resolve_ui/jobs.py +144 -0
- package/content/skills/edit-videos/resolve_ui/menu.py +80 -0
- package/content/skills/edit-videos/resolve_ui/pages.py +30 -0
- package/content/skills/edit-videos/resolve_ui/proc_lock.py +33 -0
- package/content/skills/edit-videos/resolve_ui/project.py +202 -0
- package/content/skills/edit-videos/resolve_ui/screenshot.py +66 -0
- package/content/skills/edit-videos/resolve_ui/window.py +102 -0
- package/content/skills/edit-videos/tests/conftest.py +222 -0
- package/content/skills/edit-videos/tests/test_blur.py +75 -0
- package/content/skills/edit-videos/tests/test_captions.py +87 -0
- package/content/skills/edit-videos/tests/test_cli.py +388 -0
- package/content/skills/edit-videos/tests/test_contact_sheet.py +72 -0
- package/content/skills/edit-videos/tests/test_detect_idle.py +98 -0
- package/content/skills/edit-videos/tests/test_map_time.py +51 -0
- package/content/skills/edit-videos/tests/test_probe.py +18 -0
- package/content/skills/edit-videos/tests/test_render.py +75 -0
- package/content/skills/edit-videos/tests/test_resolve_export.py +324 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_cli.py +85 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_coord_clicks.py +66 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_focus_guard.py +76 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_idle.py +41 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_job_registry.py +33 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_jobs_bin_guard.py +26 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_jobs_naming.py +22 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_jobs_subtitle.py +90 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_live.py +67 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_menu.py +14 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_menu_retry.py +55 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_no_scripting.py +15 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_pages.py +22 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_proc_lock.py +49 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_project_guard.py +57 -0
- package/content/skills/edit-videos/tests/test_resolve_ui_window.py +37 -0
- package/content/skills/edit-videos/tests/test_schema.py +89 -0
- package/content/skills/edit-videos/tests/test_stdout_json_contract.py +77 -0
- package/content/skills/edit-videos/tests/test_time_mapping.py +59 -0
- package/content/skills/edit-videos/tests/test_timeline.py +186 -0
- package/content/skills/edit-videos/tests/test_workspace.py +61 -0
- package/content/skills/edit-videos/tests/test_workspace_guard.py +34 -0
- package/content/skills/edit-videos/tests/test_zoom.py +163 -0
- package/content/skills/edit-videos/uv.lock +473 -0
- package/content/skills/edit-videos/workspace.py +56 -0
- package/lib/agentsEnv.js +4 -0
- package/lib/claims.js +56 -0
- package/lib/doctor.js +6 -2
- package/lib/fsutil.js +79 -1
- package/lib/install.js +11 -5
- package/lib/menu.js +2 -3
- package/lib/pyenv.js +122 -0
- package/lib/uninstall.js +54 -2
- package/lib/update.js +50 -8
- package/lib/wiring.js +149 -46
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -273,6 +273,40 @@ output tells you the exact command to remove it yourself if you want to.
|
|
|
273
273
|
Uninstalling one of *several* dep-bundles while another is still installed
|
|
274
274
|
leaves the component alone entirely.
|
|
275
275
|
|
|
276
|
+
## Python environments (`python`-kind item field)
|
|
277
|
+
|
|
278
|
+
A `kind:"skill"` item whose deployed directory needs its own locked Python
|
|
279
|
+
dependencies (not just Claude-facing markdown/scripts) declares:
|
|
280
|
+
|
|
281
|
+
```json
|
|
282
|
+
{ "path": "skills/edit-videos", "kind": "skill", "python": { "manager": "uv", "locked": true } }
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
`manager` is currently only `"uv"`; `locked` must be `true` — the CLI never
|
|
286
|
+
resolves a fresh lockfile, only `<manager> sync --locked`. The item's folder
|
|
287
|
+
must ship its own `pyproject.toml` and `uv.lock` (tracked files, same as any
|
|
288
|
+
other content under `path`).
|
|
289
|
+
|
|
290
|
+
1. **After the item's files are copied**, the CLI runs
|
|
291
|
+
`uv sync --locked --no-dev` with `cwd` set to the deployed directory
|
|
292
|
+
(`<target-dir>/<path or targetPath>`), creating `.venv` there —
|
|
293
|
+
see `packages/cli/lib/pyenv.js`. This is install-time only: no network
|
|
294
|
+
access happens when the skill actually runs later.
|
|
295
|
+
2. **Idempotent.** Re-running install/update against an unchanged lockfile
|
|
296
|
+
is a fast no-op — `uv` itself decides that, the CLI always invokes it.
|
|
297
|
+
3. **`.venv`/`__pycache__` are never copied** from the source repo
|
|
298
|
+
(`fsutil.js`'s `walk()` already skips dot-directories and caches) and are
|
|
299
|
+
**never treated as orphaned** by `update` — the CLI never ledger-tracks
|
|
300
|
+
`.venv`, so upstream-removed-file detection can't touch it.
|
|
301
|
+
4. **`uv` missing.** The item's own files still install; the CLI reports
|
|
302
|
+
that one item as `missing-uv` with the exact install command
|
|
303
|
+
(`irm https://astral.sh/uv/install.ps1 | iex`) instead of leaving a
|
|
304
|
+
partial `.venv` — nothing else in the bundle is affected. A `missing-uv`
|
|
305
|
+
or `failed` sync is surfaced again at the very end of the install/update
|
|
306
|
+
run (a "Python environments needing attention" block), not just among
|
|
307
|
+
the per-bundle bullets — easy to miss otherwise.
|
|
308
|
+
5. **Uninstall** removes the item's deployed `.venv` along with its files.
|
|
309
|
+
|
|
276
310
|
## Secrets
|
|
277
311
|
|
|
278
312
|
Some bundles declare `secrets` in `manifest.json` (e.g. `GITLAB_TOKEN` for
|
|
@@ -371,6 +405,14 @@ same way `uninstall` would, and dropped from the ledger.
|
|
|
371
405
|
`install`/`uninstall`.
|
|
372
406
|
- `--json` prints a machine-readable summary (`{ targetBase, bundles, unresolvedConflicts, exitCode }`) instead of prose.
|
|
373
407
|
|
|
408
|
+
**0.18.0:** line-ending-insensitive content hashes; existing ledgers migrate
|
|
409
|
+
automatically. A text file's hash now normalizes CRLF to LF first (binary
|
|
410
|
+
files are unaffected), so a Windows checkout no longer produces a false
|
|
411
|
+
conflict against an LF-deployed copy of the same content. A ledger entry
|
|
412
|
+
written before 0.18.0 still recognizes an unchanged file (via its old
|
|
413
|
+
raw-byte hash) and silently re-baselines to the new hash on the next
|
|
414
|
+
`update` — no action needed, and a real edit is never masked by this.
|
|
415
|
+
|
|
374
416
|
## Uninstall
|
|
375
417
|
|
|
376
418
|
```bash
|
package/bin/cli.js
CHANGED
|
@@ -331,6 +331,13 @@ function installOneBundle({ bundleKey, bundleTitle, targetDir, targetConfig, ite
|
|
|
331
331
|
console.log(` ${mark('ok')} component "${component.key}": wrote ${component.filesWritten.join(', ')} to ${result.targetBase}`);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
+
for (const py of result.pythonSync || []) {
|
|
335
|
+
if (py.status === 'synced') {
|
|
336
|
+
console.log(` ${mark('ok')} "${py.item}": locked Python env synced (uv sync --locked --no-dev)`);
|
|
337
|
+
}
|
|
338
|
+
// missing-uv/failed are surfaced once more at the very end (see
|
|
339
|
+
// printPythonSyncIssues), not just here among the per-bundle bullets.
|
|
340
|
+
}
|
|
334
341
|
return result;
|
|
335
342
|
}
|
|
336
343
|
|
|
@@ -355,12 +362,28 @@ function printFinalSummary({ installed, skipped, targetBase }) {
|
|
|
355
362
|
for (const label of skipped) {
|
|
356
363
|
console.log(` ${mark('skip')} ${label}`);
|
|
357
364
|
}
|
|
365
|
+
printPythonSyncIssues(installed.map(({ result }) => result));
|
|
358
366
|
console.log(
|
|
359
367
|
`\nInstalled to ${ansi.bold(targetBase)}. Next: ${ansi.dim('agents-cli secrets')} to fill in any skipped ` +
|
|
360
368
|
`secrets, ${ansi.dim('agents-cli update --yes')} to refresh later.`
|
|
361
369
|
);
|
|
362
370
|
}
|
|
363
371
|
|
|
372
|
+
/**
|
|
373
|
+
* A python item's missing-uv/failed status is easy to miss among per-bundle
|
|
374
|
+
* component/hook bullets — surface it again as the last thing printed before
|
|
375
|
+
* any trailing "Next:" hint, across every result passed in (one bundle's
|
|
376
|
+
* `result` from installOneBundle, or the several in printFinalSummary).
|
|
377
|
+
*/
|
|
378
|
+
function printPythonSyncIssues(results) {
|
|
379
|
+
const issues = results.flatMap((r) => (r.pythonSync || []).filter((p) => p.status !== 'synced'));
|
|
380
|
+
if (issues.length === 0) return;
|
|
381
|
+
console.log(`\n${ansi.bold('Python environments needing attention')}`);
|
|
382
|
+
for (const p of issues) {
|
|
383
|
+
console.log(` ${mark('fail')} "${p.item}": ${p.message}`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
364
387
|
|
|
365
388
|
/**
|
|
366
389
|
* cliVersion recorded by the last install, or null if this machine has none.
|
|
@@ -536,7 +559,7 @@ async function runInstall(argv) {
|
|
|
536
559
|
try {
|
|
537
560
|
const { manifest } = loadManifest(PACKAGE_ROOT);
|
|
538
561
|
const bundle = findBundle(manifest, args.bundle);
|
|
539
|
-
installOneBundle({
|
|
562
|
+
const result = installOneBundle({
|
|
540
563
|
bundleKey: args.bundle,
|
|
541
564
|
bundleTitle: bundle ? bundle.title : args.bundle,
|
|
542
565
|
targetDir: args.targetDir,
|
|
@@ -549,6 +572,7 @@ async function runInstall(argv) {
|
|
|
549
572
|
manifest,
|
|
550
573
|
});
|
|
551
574
|
runSelfProfileStepsIfNeeded({ profile: args.profile, targetDir: args.targetDir });
|
|
575
|
+
printPythonSyncIssues([result]);
|
|
552
576
|
return 0;
|
|
553
577
|
} catch (err) {
|
|
554
578
|
if (err instanceof InstallError || err instanceof ManifestError || err instanceof LedgerError || err instanceof WiringError) {
|
|
@@ -624,6 +648,12 @@ async function runUninstall(argv) {
|
|
|
624
648
|
`${result.filesKeptUserEdited.join(', ')}`
|
|
625
649
|
);
|
|
626
650
|
}
|
|
651
|
+
if (result.filesKeptShared.length > 0) {
|
|
652
|
+
console.log(
|
|
653
|
+
` Kept ${result.filesKeptShared.length} shared file(s) still claimed by other installed bundles: ` +
|
|
654
|
+
`${result.filesKeptShared.map((f) => `${f.file} (now owned by ${f.owner})`).join(', ')}`
|
|
655
|
+
);
|
|
656
|
+
}
|
|
627
657
|
if (result.mcpKeptUserEdited.length > 0) {
|
|
628
658
|
console.log(
|
|
629
659
|
` Kept ${result.mcpKeptUserEdited.length} MCP server entry(ies) edited since install: ` +
|
|
@@ -641,6 +671,9 @@ async function runUninstall(argv) {
|
|
|
641
671
|
);
|
|
642
672
|
}
|
|
643
673
|
}
|
|
674
|
+
if (result.pythonEnvsRemoved && result.pythonEnvsRemoved.length > 0) {
|
|
675
|
+
console.log(` Removed locked Python env(s) (.venv) for: ${result.pythonEnvsRemoved.join(', ')}`);
|
|
676
|
+
}
|
|
644
677
|
|
|
645
678
|
// Secrets are shared across bundles (e.g. LITELLM_MASTER_KEY) and kept
|
|
646
679
|
// by default rather than deleted on uninstall — report which of this
|
|
@@ -950,6 +983,8 @@ async function runUpdate(argv) {
|
|
|
950
983
|
}
|
|
951
984
|
}
|
|
952
985
|
|
|
986
|
+
printPythonSyncIssues(result.bundles);
|
|
987
|
+
|
|
953
988
|
if (result.exitCode !== 0) {
|
|
954
989
|
console.error(
|
|
955
990
|
`\n${result.unresolvedConflicts.length} file(s) have unresolved conflicts (edited locally AND changed ` +
|
package/content/global/CLAUDE.md
CHANGED
|
@@ -9,12 +9,19 @@ When planning or modifying work, start a wayfinder map for anything too big for
|
|
|
9
9
|
Never `taskkill /F` or force-stop a shared daemon or another session's process — it can be serving other concurrent chats too (confirmed incident: killing the shared router mid-session broke every other active chat); restart it gracefully via its own scheduled task instead.
|
|
10
10
|
Grill the operator once per new goal to lock scope and shared understanding; once scope is locked, execute autonomously end-to-end without re-confirming each step — grilling gates scope, not execution.
|
|
11
11
|
A new finding or one-off issue surfaced mid-task gets its own PRD/issue tracked separately — do not solve it inline in the same session; nudge the operator to open a new ticket instead.
|
|
12
|
+
Never open a git issue by yourself you need to explain the issue with complete context concisely in terms of customer facing functionality so user can take a decision if this is really an issue. User also want you to find out with thorough investigation if this is really an issue as the pending git issues spam is a real problem.
|
|
12
13
|
Default to plain, simple technical English (ASD-STE100 style) and concise bullets/tables/ASCII diagrams over prose paragraphs.
|
|
13
14
|
In any report to the user, state each result once — never repeat an item already covered earlier in the same response or session.
|
|
15
|
+
When a code bug/defect is mentioned or identified always update the description of the main PRD git issue of that chat session, with the entry in the TODO task list and the status of the fixes in the comments of the PRD git issue.
|
|
16
|
+
Always open a worktree from the latest code of the default branch into your own folder so the work does not clash with ongoing work and it is easy to maintain and push to the default branches. Before committing again make sure you pull the latest from default branch as well.
|
|
17
|
+
Keep code lean: no narrative comments in source (no dates, rulings, ticket refs, doc citations, history, rationale essays) — traceability lives in the GitLab issue/PRD and one-brain only; a comment is at most one line stating a contract or a non-obvious WHY, and removed code leaves no tombstone.
|
|
18
|
+
Always clean up the idle agents after the agent reports or teammate finished and goes to idle state. Keep the TODO task list updated in the chat and PRD git issue.
|
|
19
|
+
The founder uses PowerShell (pwsh), not Git Bash. When giving the founder commands to run themselves, always write pwsh syntax and use the .ps1. This is the last resort if you can't execute and need help.
|
|
20
|
+
Always ship every code after test to the default branch and message other parallel chats in that repository to pull the latest this way code management is organized do not leave uncommitted files as you go along.
|
|
14
21
|
|
|
15
22
|
## Model Routing (HARD RULE)
|
|
16
23
|
|
|
17
|
-
The main-loop model (Fable/Opus) is a scarce planning resource; burn Sonnet, not Fable.
|
|
24
|
+
The main-loop model (Fable/Opus) is a scarce orchestration and planning resource; burn Sonnet, not Fable/Opus as subagents.
|
|
18
25
|
|
|
19
26
|
| Work | Who does it |
|
|
20
27
|
|---|---|
|
|
@@ -34,7 +41,7 @@ At the start of every session, before substantive work, call `mcp__claude_ai_one
|
|
|
34
41
|
|
|
35
42
|
**Save without asking.** When a session produces an architecture decision, bug fix, new convention, or structural/config change — especially to shared or global harness config, hooks, or any cross-project infrastructure — call `remember()` immediately in the same turn, without asking the user for permission first. Never ask "want me to save this to memory?" as a question; just do it. The only time it's appropriate to ask is genuine scope ambiguity — e.g. uncertainty about whether something is project-specific (`project=` param) or should be global (omit `project=`) — and even then, default to a reasonable guess and only ask if genuinely unclear, don't block on it.
|
|
36
43
|
|
|
37
|
-
**Surprise logging.**
|
|
44
|
+
**Surprise logging.** After investigating and due diligence if it is a revelation — log it to one-brain as BOTH `log_episode` and `remember` and also update the relevant PRDs and docs with the information fanning out. Applies whether the underlying task succeeds or fails.
|
|
38
45
|
|
|
39
46
|
## Codify Over Instruct
|
|
40
47
|
|
package/content/manifest.json
CHANGED
|
@@ -86,6 +86,19 @@
|
|
|
86
86
|
{
|
|
87
87
|
"path": "skills/ship-the-code",
|
|
88
88
|
"kind": "skill"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"path": "proxy/agents_env.py",
|
|
92
|
+
"kind": "hook",
|
|
93
|
+
"note": "Shared secrets-resolution library imported by this bundle's scripts — not wired to an event itself. Already deployed by other bundles too; safe to double-claim, install.js is idempotent per-file."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"path": "agents/scribe-agent",
|
|
97
|
+
"kind": "agent",
|
|
98
|
+
"exclude": [
|
|
99
|
+
"test_scribe_runner.py"
|
|
100
|
+
],
|
|
101
|
+
"note": "ship.py loads scribe_runner.py by file path for its GitLab helpers (skills/ship-the-code/ship.py scribe_agent_path); scribe_runner.py launches scribe_item_read.py/scribe_item_write.py, so the folder ships whole. Also claimed by agent-orchestration; safe to double-claim."
|
|
89
102
|
}
|
|
90
103
|
],
|
|
91
104
|
"deps": [],
|
|
@@ -174,6 +187,11 @@
|
|
|
174
187
|
"type": "command",
|
|
175
188
|
"command": "python ~/.claude/proxy/code_is_law_lint_hook.py"
|
|
176
189
|
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"path": "proxy/headless_process.py",
|
|
193
|
+
"kind": "hook",
|
|
194
|
+
"note": "Shared no-visible-window subprocess wrapper (headless_run/headless_popen) imported by code_is_law_lint_hook.py — not wired to an event itself."
|
|
177
195
|
}
|
|
178
196
|
],
|
|
179
197
|
"deps": [],
|
|
@@ -306,6 +324,11 @@
|
|
|
306
324
|
"command": "python ~/.claude/proxy/artifact_mocker_gate.py"
|
|
307
325
|
}
|
|
308
326
|
},
|
|
327
|
+
{
|
|
328
|
+
"path": "proxy/headless_process.py",
|
|
329
|
+
"kind": "hook",
|
|
330
|
+
"note": "Shared no-visible-window subprocess wrapper (headless_run/headless_popen) imported by artifact_mocker_gate.py — not wired to an event itself."
|
|
331
|
+
},
|
|
309
332
|
{
|
|
310
333
|
"path": "proxy/html_mocker_prompt_nudge.py",
|
|
311
334
|
"kind": "hook",
|
|
@@ -498,6 +521,11 @@
|
|
|
498
521
|
"advancedOnly": true,
|
|
499
522
|
"note": "Shared route-classification library imported by triage_gate_hook.py and (self-profile) agent_model_guard.py — not wired to an event itself."
|
|
500
523
|
},
|
|
524
|
+
{
|
|
525
|
+
"path": "proxy/headless_process.py",
|
|
526
|
+
"kind": "hook",
|
|
527
|
+
"note": "Shared no-visible-window subprocess wrapper (headless_run/headless_popen) imported by bg_process_registry.py, execution_worker_review_gate.py, and route_lock.py in this bundle, plus hooks in other bundles — not wired to an event itself."
|
|
528
|
+
},
|
|
501
529
|
{
|
|
502
530
|
"path": "proxy/agents_env.py",
|
|
503
531
|
"kind": "hook",
|
|
@@ -507,6 +535,11 @@
|
|
|
507
535
|
"path": "skills/launch-litellm",
|
|
508
536
|
"kind": "skill",
|
|
509
537
|
"note": "Starts/restarts the LiteLLM proxy this bundle depends on, in a visible window outside the caller's process tree."
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"path": "proxy/git_shell_parse.py",
|
|
541
|
+
"kind": "hook",
|
|
542
|
+
"note": "Shared shell-command parsing helpers imported by execution_worker_review_gate.py (without it that hook dies with ModuleNotFoundError on every Bash call) — not wired to an event itself. Also claimed by self-infra; safe to double-claim."
|
|
510
543
|
}
|
|
511
544
|
],
|
|
512
545
|
"deps": [
|
|
@@ -742,6 +775,16 @@
|
|
|
742
775
|
"kind": "infra",
|
|
743
776
|
"note": "Registered PreToolUse Bash hook in settings.json, unscoped like publish_guard.py — blocks credential mutation/exposure for main session and every subagent."
|
|
744
777
|
},
|
|
778
|
+
{
|
|
779
|
+
"path": "proxy/headless_spawn_guard.py",
|
|
780
|
+
"kind": "infra",
|
|
781
|
+
"note": "Registered PreToolUse Bash|PowerShell hook in settings.json, unscoped like publish_guard.py — denies visible-window spawns (start/Start-Process without -WindowStyle Hidden/-NoNewWindow)."
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"path": "proxy/headless_process.py",
|
|
785
|
+
"kind": "infra",
|
|
786
|
+
"note": "Shared no-visible-window subprocess wrapper (headless_run/headless_popen) imported by headless_spawn_guard.py and every other self-infra hook that shells out — not wired to an event itself."
|
|
787
|
+
},
|
|
745
788
|
{
|
|
746
789
|
"path": "proxy/gitlab_mutation_guard.py",
|
|
747
790
|
"kind": "infra",
|
|
@@ -752,6 +795,11 @@
|
|
|
752
795
|
"kind": "infra",
|
|
753
796
|
"note": "Registered PreToolUse Agent hook in settings.json."
|
|
754
797
|
},
|
|
798
|
+
{
|
|
799
|
+
"path": "proxy/worktree_targets.py",
|
|
800
|
+
"kind": "infra",
|
|
801
|
+
"note": "Shared `worktree:` dispatch-prompt parser imported by agent_model_guard.py — byte-identical to social-manager/scripts/worktree_targets.py, not wired to an event itself."
|
|
802
|
+
},
|
|
755
803
|
{
|
|
756
804
|
"path": "proxy/validate_dispatch_tiers.py",
|
|
757
805
|
"kind": "infra",
|
|
@@ -928,6 +976,19 @@
|
|
|
928
976
|
"path": "proxy/project_resolver.py",
|
|
929
977
|
"kind": "infra",
|
|
930
978
|
"note": "Shared GitLab-project-slug resolution extracted from conclusion_scribe_hook.py, imported by gitlab_api.py, prd_closing_gate.py, tracker_proof_gate.py, and prd_registry.py — pure functions, no hook-event I/O of its own."
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
"path": "proxy/route_lock.py",
|
|
982
|
+
"kind": "hook",
|
|
983
|
+
"note": "Shared route-classification library imported by agent_model_guard.py, shared_worktree_revert_guard.py and validate_dispatch_tiers.py — not wired to an event itself. Also claimed by agent-orchestration; safe to double-claim."
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"path": "agents/scribe-agent",
|
|
987
|
+
"kind": "agent",
|
|
988
|
+
"exclude": [
|
|
989
|
+
"test_scribe_runner.py"
|
|
990
|
+
],
|
|
991
|
+
"note": "Module under test in test_scribe_runner.py (claimed above) plus the scribe_item_read.py/scribe_item_write.py scripts scribe_runner.py launches. Also claimed by agent-orchestration; safe to double-claim."
|
|
931
992
|
}
|
|
932
993
|
],
|
|
933
994
|
"deps": [
|
|
@@ -945,6 +1006,16 @@
|
|
|
945
1006
|
{
|
|
946
1007
|
"path": "scripts",
|
|
947
1008
|
"kind": "infra"
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
"path": "proxy/agents_env.py",
|
|
1012
|
+
"kind": "hook",
|
|
1013
|
+
"note": "Shared secrets-resolution library imported by this bundle's scripts — not wired to an event itself. Already deployed by other bundles too; safe to double-claim, install.js is idempotent per-file."
|
|
1014
|
+
},
|
|
1015
|
+
{
|
|
1016
|
+
"path": "proxy/project_resolver.py",
|
|
1017
|
+
"kind": "hook",
|
|
1018
|
+
"note": "Shared GitLab-project-slug resolution imported by prd_registry.py — pure functions, no hook-event I/O. Also claimed by self-infra; safe to double-claim."
|
|
948
1019
|
}
|
|
949
1020
|
],
|
|
950
1021
|
"deps": [],
|
|
@@ -1022,6 +1093,19 @@
|
|
|
1022
1093
|
"command": "python ~/.claude/proxy/grilling_format_gate.py"
|
|
1023
1094
|
}
|
|
1024
1095
|
]
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
"path": "proxy/agents_env.py",
|
|
1099
|
+
"kind": "hook",
|
|
1100
|
+
"note": "Shared secrets-resolution library imported by this bundle's scripts — not wired to an event itself. Already deployed by other bundles too; safe to double-claim, install.js is idempotent per-file."
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
"path": "agents/scribe-agent",
|
|
1104
|
+
"kind": "agent",
|
|
1105
|
+
"exclude": [
|
|
1106
|
+
"test_scribe_runner.py"
|
|
1107
|
+
],
|
|
1108
|
+
"note": "gitlab_phase.py loads scribe_runner.py by file path for its GitLab helpers; scribe_runner.py launches scribe_item_read.py/scribe_item_write.py, so the folder ships whole. Also claimed by agent-orchestration; safe to double-claim."
|
|
1025
1109
|
}
|
|
1026
1110
|
],
|
|
1027
1111
|
"deps": [],
|
|
@@ -1060,6 +1144,11 @@
|
|
|
1060
1144
|
"test_council_common.py"
|
|
1061
1145
|
],
|
|
1062
1146
|
"note": "Shared council preflight/exit-code contract — imported at runtime via parents[1]/lib by visual_diagnosis.py and visual_review_council_fanout.py."
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
"path": "proxy/agents_env.py",
|
|
1150
|
+
"kind": "hook",
|
|
1151
|
+
"note": "Shared secrets-resolution library imported by this bundle's scripts — not wired to an event itself. Already deployed by other bundles too; safe to double-claim, install.js is idempotent per-file."
|
|
1063
1152
|
}
|
|
1064
1153
|
],
|
|
1065
1154
|
"deps": [
|
|
@@ -1169,6 +1258,50 @@
|
|
|
1169
1258
|
],
|
|
1170
1259
|
"deps": [],
|
|
1171
1260
|
"secrets": []
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
"key": "video-editing",
|
|
1264
|
+
"title": "Video Editing (DaVinci Resolve)",
|
|
1265
|
+
"summary": "Edit video through a local ffmpeg/OpenCV engine (cut/trim/blur/caption/export) and hand off timelines to DaVinci Resolve's UI, with a prompt-intent nudge and a guard against Resolve Fusion Scripts-folder writes",
|
|
1266
|
+
"profile": "public",
|
|
1267
|
+
"advanced": false,
|
|
1268
|
+
"items": [
|
|
1269
|
+
{
|
|
1270
|
+
"path": "skills/edit-videos",
|
|
1271
|
+
"kind": "skill",
|
|
1272
|
+
"python": {
|
|
1273
|
+
"manager": "uv",
|
|
1274
|
+
"locked": true
|
|
1275
|
+
},
|
|
1276
|
+
"exclude": ["tests/"]
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
"path": "proxy/edit_videos_intent_hook.py",
|
|
1280
|
+
"kind": "hook",
|
|
1281
|
+
"wiring": {
|
|
1282
|
+
"event": "UserPromptSubmit",
|
|
1283
|
+
"type": "command",
|
|
1284
|
+
"command": "python ~/.claude/proxy/edit_videos_intent_hook.py"
|
|
1285
|
+
}
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
"path": "proxy/resolve_policy_guard.py",
|
|
1289
|
+
"kind": "hook",
|
|
1290
|
+
"wiring": {
|
|
1291
|
+
"event": "PreToolUse",
|
|
1292
|
+
"matcher": "Write|Edit|NotebookEdit|Bash|PowerShell",
|
|
1293
|
+
"type": "command",
|
|
1294
|
+
"command": "python ~/.claude/proxy/resolve_policy_guard.py"
|
|
1295
|
+
}
|
|
1296
|
+
},
|
|
1297
|
+
{
|
|
1298
|
+
"path": "proxy/git_shell_parse.py",
|
|
1299
|
+
"kind": "hook",
|
|
1300
|
+
"note": "Shared, project-agnostic shell-command parsing helpers (quote/heredoc/substitution-aware segment split) used by resolve_policy_guard.py to split Bash/PowerShell commands before scanning them — not wired to an event itself. Also claimed by agent-orchestration and self-infra; safe to double-claim."
|
|
1301
|
+
}
|
|
1302
|
+
],
|
|
1303
|
+
"deps": [],
|
|
1304
|
+
"secrets": []
|
|
1172
1305
|
}
|
|
1173
1306
|
],
|
|
1174
1307
|
"internal": [
|
|
@@ -117,12 +117,28 @@
|
|
|
117
117
|
},
|
|
118
118
|
"exclude": {
|
|
119
119
|
"type": "array",
|
|
120
|
-
"description": "Repo-relative-to-item-root
|
|
120
|
+
"description": "Repo-relative-to-item-root paths (POSIX separators) to skip when installing this item's folder. An entry ending in \"/\" excludes every file under that folder prefix (e.g. \"tests/\"); any other entry is an exact file match. Honored by fsutil.js's isExcluded() (install.js, claims.js, menu.js, update.js); excluded files still count as claimed (do not also list them in internal[]).",
|
|
121
121
|
"items": { "type": "string", "minLength": 1 }
|
|
122
122
|
},
|
|
123
123
|
"note": {
|
|
124
124
|
"type": "string",
|
|
125
125
|
"description": "Optional clarifying text for non-obvious items (e.g. an mcp item whose path points at a shared multi-server file)."
|
|
126
|
+
},
|
|
127
|
+
"python": {
|
|
128
|
+
"description": "Marks a kind:\"skill\" item's deployed directory as having a locked Python env (pyproject.toml + a lockfile matching `manager`, both shipped inside `path`/`targetPath`). After the item's files are copied, the CLI runs `<manager> sync --locked --no-dev` in the deployed directory (install-time only, no network at skill runtime), creating `.venv` there — see packages/cli/lib/pyenv.js. Idempotent: a re-run against an unchanged lockfile is a fast no-op. `.venv` and `__pycache__` are never copied (fsutil.js's walk() skips dot-directories/caches) and never treated as orphaned (the CLI never ledger-tracks them, so update's upstream-removed detection can't touch them). Uninstalling the item removes its `.venv` with the rest.",
|
|
129
|
+
"$ref": "#/$defs/pythonEnv"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"pythonEnv": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"additionalProperties": false,
|
|
136
|
+
"required": ["manager", "locked"],
|
|
137
|
+
"properties": {
|
|
138
|
+
"manager": { "type": "string", "enum": ["uv"] },
|
|
139
|
+
"locked": {
|
|
140
|
+
"type": "boolean",
|
|
141
|
+
"description": "Must be true — the only supported mode is `<manager> sync --locked`, never resolving a fresh lockfile at install time."
|
|
126
142
|
}
|
|
127
143
|
}
|
|
128
144
|
},
|
package/content/proxy/README.md
CHANGED
|
@@ -172,7 +172,7 @@ Tests: `proxy/tests/test_shared_worktree_revert_guard.py` (real temp git repos,
|
|
|
172
172
|
**What it does**
|
|
173
173
|
Compensating control for any leaf agent whose frontmatter declares `dispatch_tier: mandatory-review` (see `route_lock.py` / `agent_model_guard.py` above) — such a leaf is auto-dispatchable with no `@tag` and no route lock, so the control moves to commit time instead: if a mandatory-review agent has run in this farm-style project and no `clears_review: true` agent has run since (`route_lock.is_review_pending`), any `git commit` is denied until the reviewer dispatches (which clears the flag via `route_lock.clear_pending_review`).
|
|
174
174
|
|
|
175
|
-
Scoped to `git commit` invocations via both the settings.json `"if"` clause below AND its own token-based check on the command (shared `git_shell_parse.find_git_subcommand`/`unwind_shell_wrapper` primitives, not a bare regex — resolves `git commit` through `-C`/`-c` flags and unwinds the same wrapper shapes `shared_worktree_revert_guard.py` does) — belt-and-suspenders, so it's harmless to leave unconditionally wired to the `Bash` matcher.
|
|
175
|
+
Scoped to `git commit` invocations via both the settings.json handler-level `"if"` clause below AND its own token-based check on the command (shared `git_shell_parse.find_git_subcommand`/`unwind_shell_wrapper` primitives, not a bare regex — resolves `git commit` through `-C`/`-c` flags and unwinds the same wrapper shapes `shared_worktree_revert_guard.py` does) — belt-and-suspenders, so it's harmless to leave unconditionally wired to the `Bash` matcher.
|
|
176
176
|
|
|
177
177
|
**Manual setup**
|
|
178
178
|
|
|
@@ -181,13 +181,14 @@ Wire into PreToolUse in `~/.claude/settings.json`:
|
|
|
181
181
|
```json
|
|
182
182
|
"PreToolUse": [{
|
|
183
183
|
"matcher": "Bash",
|
|
184
|
-
"if": "Bash(git commit *)",
|
|
185
184
|
"hooks": [
|
|
186
|
-
{"type": "command", "command": "python C:/Users/<you>/.claude/proxy/execution_worker_review_gate.py"}
|
|
185
|
+
{"type": "command", "if": "Bash(git commit *)", "command": "python C:/Users/<you>/.claude/proxy/execution_worker_review_gate.py"}
|
|
187
186
|
]
|
|
188
187
|
}]
|
|
189
188
|
```
|
|
190
189
|
|
|
190
|
+
`if` goes on the hook handler (inside `hooks[]`, beside `type`/`command`), not on the matcher group — Claude Code silently ignores a group-level `if` and the hook then fires on every `Bash` call.
|
|
191
|
+
|
|
191
192
|
**Verify**
|
|
192
193
|
|
|
193
194
|
```bash
|
|
@@ -58,13 +58,13 @@ Original checks, retained semantics (first correction wins where relevant):
|
|
|
58
58
|
per-agent `dispatch_tier:` frontmatter declaration (see route_lock.py's
|
|
59
59
|
agent_dispatch_tier/list_agents_by_tier — never a hardcoded roster, so
|
|
60
60
|
it stays correct for any farm-style project): `dispatch_tier:
|
|
61
|
-
mandatory-review`
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
mandatory-review` bypasses the route lock the same way `dispatch_tier:
|
|
62
|
+
safe` does, but marks a pending-review flag that execution_worker_review_gate.py
|
|
63
|
+
checks before allowing `git commit`. A target that has adopted
|
|
64
|
+
scripts/review_pass.py clears that flag only via a verified stamp, never
|
|
65
|
+
by a dispatch; a target without it keeps the older behavior, where
|
|
65
66
|
dispatching an agent whose frontmatter declares `clears_review: true`
|
|
66
|
-
|
|
67
|
-
(route_lock.clear_pending_review).
|
|
67
|
+
clears the flag directly (route_lock.clear_pending_review).
|
|
68
68
|
|
|
69
69
|
Fails OPEN (prints nothing, exit 0) on any unexpected exception, missing
|
|
70
70
|
registry file, or malformed stdin — mirrors agent_dispatch_guard.py.
|
|
@@ -87,9 +87,11 @@ import json
|
|
|
87
87
|
import re
|
|
88
88
|
import secrets
|
|
89
89
|
import socket
|
|
90
|
+
import time
|
|
90
91
|
|
|
91
92
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
92
93
|
import route_lock
|
|
94
|
+
import worktree_targets
|
|
93
95
|
|
|
94
96
|
PROXY_HOST = "127.0.0.1"
|
|
95
97
|
PROXY_PORT = 3456
|
|
@@ -251,6 +253,49 @@ DEFAULT_WORKER_MODEL = "sonnet" # must be one of sonnet/opus/haiku/fable; the A
|
|
|
251
253
|
# dispatch with a schema validation error, confirmed in production 2026-07-05.
|
|
252
254
|
|
|
253
255
|
|
|
256
|
+
def _parse_worktree_targets(prompt: str) -> list[str]:
|
|
257
|
+
return worktree_targets.parse_worktree_targets(prompt)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def _mark_pending_review_per_target(cwd: str, prompt: str) -> None:
|
|
261
|
+
"""Marks each `worktree:`-named target's OWN pending flag when it
|
|
262
|
+
has adopted scripts/review_pass.py (per-target design) — bypassing
|
|
263
|
+
route_lock's shared git-common-dir root so a worktree's flag never
|
|
264
|
+
collapses onto its main checkout. A target without scripts/review_pass.py,
|
|
265
|
+
or no `worktree:` line at all, keeps the exact old cwd-keyed behavior."""
|
|
266
|
+
targets = _parse_worktree_targets(prompt)
|
|
267
|
+
if not targets:
|
|
268
|
+
route_lock.mark_pending_review(cwd)
|
|
269
|
+
return
|
|
270
|
+
for target in targets:
|
|
271
|
+
if os.path.isfile(os.path.join(target, "scripts", "review_pass.py")):
|
|
272
|
+
marker = os.path.join(target, ".claude", ".pending_review.json")
|
|
273
|
+
try:
|
|
274
|
+
os.makedirs(os.path.dirname(marker), exist_ok=True)
|
|
275
|
+
with open(marker, "w", encoding="utf-8") as fh:
|
|
276
|
+
json.dump({"pending_review": True, "ts": time.time()}, fh)
|
|
277
|
+
except Exception:
|
|
278
|
+
pass
|
|
279
|
+
else:
|
|
280
|
+
route_lock.mark_pending_review(target)
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
def _clear_pending_review_per_target(cwd: str, prompt: str) -> None:
|
|
284
|
+
"""Mirrors _mark_pending_review_per_target: clears each `worktree:`-named
|
|
285
|
+
target's OWN pending flag on a `clears_review: true` dispatch — but only
|
|
286
|
+
for a target that has NOT adopted scripts/review_pass.py. A target with
|
|
287
|
+
review_pass.py clears its flag exclusively via a verified stamp
|
|
288
|
+
(commit_repo.py's _check_review_stamp), never by a mere dispatch."""
|
|
289
|
+
targets = _parse_worktree_targets(prompt)
|
|
290
|
+
if not targets:
|
|
291
|
+
if not os.path.isfile(os.path.join(cwd, "scripts", "review_pass.py")):
|
|
292
|
+
route_lock.clear_pending_review(cwd)
|
|
293
|
+
return
|
|
294
|
+
for target in targets:
|
|
295
|
+
if not os.path.isfile(os.path.join(target, "scripts", "review_pass.py")):
|
|
296
|
+
route_lock.clear_pending_review(target)
|
|
297
|
+
|
|
298
|
+
|
|
254
299
|
def _deny(reason: str) -> None:
|
|
255
300
|
print(json.dumps({
|
|
256
301
|
"hookSpecificOutput": {
|
|
@@ -402,13 +447,14 @@ def _safe_main() -> None:
|
|
|
402
447
|
# frontmatter (route_lock.agent_dispatch_tier), never a hardcoded roster,
|
|
403
448
|
# so this stays correct for any farm-style project.
|
|
404
449
|
dispatch_tier = route_lock.agent_dispatch_tier(subagent_type, cwd) if subagent_type else None
|
|
405
|
-
if dispatch_tier == "
|
|
406
|
-
if route_lock.agent_clears_review(subagent_type, cwd) and route_lock.is_farm_style_project(cwd):
|
|
407
|
-
route_lock.clear_pending_review(cwd)
|
|
408
|
-
pass
|
|
409
|
-
elif dispatch_tier == "mandatory-review":
|
|
450
|
+
if dispatch_tier == "mandatory-review":
|
|
410
451
|
if route_lock.is_farm_style_project(cwd):
|
|
411
|
-
|
|
452
|
+
_mark_pending_review_per_target(cwd, prompt)
|
|
453
|
+
elif dispatch_tier == "safe":
|
|
454
|
+
# A target that has adopted scripts/review_pass.py clears its flag
|
|
455
|
+
# only via a verified stamp, never here — see _clear_pending_review_per_target.
|
|
456
|
+
if route_lock.agent_clears_review(subagent_type, cwd) and route_lock.is_farm_style_project(cwd):
|
|
457
|
+
_clear_pending_review_per_target(cwd, prompt)
|
|
412
458
|
elif subagent_type and _find_agent_file(subagent_type, cwd) and route_lock.is_farm_style_project(cwd):
|
|
413
459
|
lock = route_lock.read_lock(cwd)
|
|
414
460
|
if lock:
|
|
@@ -38,6 +38,14 @@ import json
|
|
|
38
38
|
import subprocess
|
|
39
39
|
import time
|
|
40
40
|
from pathlib import Path
|
|
41
|
+
from typing import Any
|
|
42
|
+
|
|
43
|
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
44
|
+
try:
|
|
45
|
+
from headless_process import headless_run # noqa: E402
|
|
46
|
+
except Exception: # pragma: no cover - defensive, fail open (no window suppression)
|
|
47
|
+
def headless_run(*args: Any, **kw: Any) -> subprocess.CompletedProcess:
|
|
48
|
+
return subprocess.run(*args, **kw)
|
|
41
49
|
|
|
42
50
|
MOCKER = Path.home() / ".claude" / "skills" / "html-mocker" / "mocker.py"
|
|
43
51
|
LOG = Path.home() / ".claude" / "logs" / "artifact_mocker_gate.log"
|
|
@@ -130,7 +138,7 @@ def _safe_main() -> None:
|
|
|
130
138
|
return # html-mocker not deployed on this machine -> allow
|
|
131
139
|
|
|
132
140
|
try:
|
|
133
|
-
proc =
|
|
141
|
+
proc = headless_run(
|
|
134
142
|
[sys.executable, str(MOCKER), file_path, "--json"],
|
|
135
143
|
capture_output=True,
|
|
136
144
|
text=True,
|
|
@@ -35,6 +35,14 @@ import subprocess
|
|
|
35
35
|
import sys
|
|
36
36
|
import time
|
|
37
37
|
import uuid
|
|
38
|
+
from typing import Any
|
|
39
|
+
|
|
40
|
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
41
|
+
try:
|
|
42
|
+
from headless_process import headless_run # noqa: E402
|
|
43
|
+
except Exception: # pragma: no cover - defensive, fail open (no window suppression)
|
|
44
|
+
def headless_run(*args: Any, **kw: Any) -> subprocess.CompletedProcess:
|
|
45
|
+
return subprocess.run(*args, **kw)
|
|
38
46
|
|
|
39
47
|
HOME = os.path.expanduser("~")
|
|
40
48
|
STATE_DIR = os.environ.get("BG_PROCESS_STATE_DIR_OVERRIDE") or os.path.join(HOME, ".claude", "logs")
|
|
@@ -256,7 +264,7 @@ def _find_matching_pids(entry: dict) -> list[int]:
|
|
|
256
264
|
env["BG_REAPER_FRAGMENT"] = fragment
|
|
257
265
|
env["BG_REAPER_MIN_DATE"] = launch_dt
|
|
258
266
|
try:
|
|
259
|
-
result =
|
|
267
|
+
result = headless_run(
|
|
260
268
|
["powershell", "-NoProfile", "-Command", _PS_MATCH_SCRIPT],
|
|
261
269
|
capture_output=True, text=True, timeout=20, env=env,
|
|
262
270
|
)
|
|
@@ -274,7 +282,7 @@ def _find_matching_pids(entry: dict) -> list[int]:
|
|
|
274
282
|
|
|
275
283
|
def kill_pid_tree(pid: int) -> bool:
|
|
276
284
|
try:
|
|
277
|
-
result =
|
|
285
|
+
result = headless_run(
|
|
278
286
|
["taskkill", "/PID", str(pid), "/T", "/F"],
|
|
279
287
|
capture_output=True, text=True, timeout=20,
|
|
280
288
|
)
|
|
@@ -317,7 +325,7 @@ def is_spine_claimed(pid: int, cwd: str | None) -> bool:
|
|
|
317
325
|
if script is None:
|
|
318
326
|
return False
|
|
319
327
|
try:
|
|
320
|
-
result =
|
|
328
|
+
result = headless_run(
|
|
321
329
|
[sys.executable, script, "check-claimed-by-pid", "--pid", str(pid)],
|
|
322
330
|
capture_output=True, text=True, timeout=15,
|
|
323
331
|
)
|
|
@@ -352,7 +360,7 @@ def sweep_spine_dead_locks(cwd: str | None) -> None:
|
|
|
352
360
|
if script is None:
|
|
353
361
|
return
|
|
354
362
|
try:
|
|
355
|
-
|
|
363
|
+
headless_run(
|
|
356
364
|
[sys.executable, script, "reap-sweep"],
|
|
357
365
|
capture_output=True, text=True, timeout=15,
|
|
358
366
|
)
|
|
@@ -15,6 +15,14 @@ if os.environ.get("CLAUDE_HOOK_CHILD"):
|
|
|
15
15
|
import json
|
|
16
16
|
import subprocess
|
|
17
17
|
from pathlib import Path
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
20
|
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
21
|
+
try:
|
|
22
|
+
from headless_process import headless_run # noqa: E402
|
|
23
|
+
except Exception: # pragma: no cover - defensive, fail open (no window suppression)
|
|
24
|
+
def headless_run(*args: Any, **kw: Any) -> subprocess.CompletedProcess:
|
|
25
|
+
return subprocess.run(*args, **kw)
|
|
18
26
|
|
|
19
27
|
LINT = Path.home() / ".claude" / "skills" / "code-is-law" / "lint_skill.py"
|
|
20
28
|
|
|
@@ -35,7 +43,7 @@ def main() -> int:
|
|
|
35
43
|
if not file_path or not is_target(file_path) or not LINT.is_file():
|
|
36
44
|
return 0
|
|
37
45
|
|
|
38
|
-
result =
|
|
46
|
+
result = headless_run([sys.executable, str(LINT), file_path],
|
|
39
47
|
capture_output=True, text=True)
|
|
40
48
|
if result.returncode == 0:
|
|
41
49
|
return 0
|