session-orchestrator 5.0.0 → 5.2.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/.agents/skills/autopilot/SKILL.md +1 -0
- package/.agents/skills/bootstrap/SKILL.md +2 -0
- package/.agents/skills/brainstorm/SKILL.md +3 -0
- package/.agents/skills/close/SKILL.md +17 -0
- package/.agents/skills/debug/SKILL.md +2 -0
- package/.agents/skills/discovery/SKILL.md +2 -1
- package/.agents/skills/dispatcher/SKILL.md +2 -0
- package/.agents/skills/eli5/SKILL.md +2 -0
- package/.agents/skills/eval/SKILL.md +1 -0
- package/.agents/skills/evolve/SKILL.md +2 -1
- package/.agents/skills/go/SKILL.md +18 -0
- package/.agents/skills/grill/SKILL.md +2 -0
- package/.agents/skills/harness-audit/SKILL.md +16 -0
- package/.agents/skills/memory-cleanup/SKILL.md +1 -0
- package/.agents/skills/persona-panel/SKILL.md +1 -0
- package/.agents/skills/plan/SKILL.md +3 -1
- package/.agents/skills/portfolio/SKILL.md +17 -0
- package/.agents/skills/reconcile/SKILL.md +1 -0
- package/.agents/skills/release/SKILL.md +18 -0
- package/.agents/skills/repo-audit/SKILL.md +1 -0
- package/.agents/skills/spinout/SKILL.md +1 -0
- package/.agents/skills/sunset-review/SKILL.md +2 -0
- package/.agents/skills/test/SKILL.md +17 -0
- package/.agents/skills/ux-grill/SKILL.md +2 -0
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +2 -2
- package/.codex-plugin/skills/autopilot/SKILL.md +5 -4
- package/.codex-plugin/skills/bootstrap/SKILL.md +8 -4
- package/.codex-plugin/skills/brainstorm/SKILL.md +11 -4
- package/.codex-plugin/skills/close/SKILL.md +3 -3
- package/.codex-plugin/skills/convergence-monitoring/SKILL.md +2 -0
- package/.codex-plugin/skills/convergence-monitoring/agents/openai.yaml +5 -0
- package/.codex-plugin/skills/debug/SKILL.md +11 -4
- package/.codex-plugin/skills/discovery/SKILL.md +8 -4
- package/.codex-plugin/skills/dispatcher/SKILL.md +4 -4
- package/.codex-plugin/skills/eli5/SKILL.md +9 -4
- package/.codex-plugin/skills/eval/SKILL.md +9 -4
- package/.codex-plugin/skills/evolve/SKILL.md +9 -4
- package/.codex-plugin/skills/go/SKILL.md +3 -3
- package/.codex-plugin/skills/grill/SKILL.md +11 -4
- package/.codex-plugin/skills/harness-audit/SKILL.md +4 -3
- package/.codex-plugin/skills/memory-cleanup/SKILL.md +9 -4
- package/.codex-plugin/skills/npm-publish/SKILL.md +2 -0
- package/.codex-plugin/skills/npm-publish/agents/openai.yaml +5 -0
- package/.codex-plugin/skills/persona-panel/SKILL.md +5 -5
- package/.codex-plugin/skills/plan/SKILL.md +8 -4
- package/.codex-plugin/skills/portfolio/SKILL.md +3 -3
- package/.codex-plugin/skills/reconcile/SKILL.md +9 -4
- package/.codex-plugin/skills/release/SKILL.md +3 -3
- package/.codex-plugin/skills/repo-audit/SKILL.md +6 -4
- package/.codex-plugin/skills/spinout/SKILL.md +4 -4
- package/.codex-plugin/skills/sunset-review/SKILL.md +5 -4
- package/.codex-plugin/skills/test/SKILL.md +3 -3
- package/.codex-plugin/skills/ux-grill/SKILL.md +11 -4
- package/.cursor/commands/autopilot.md +4 -4
- package/.cursor/commands/bootstrap.md +5 -4
- package/.cursor/commands/brainstorm.md +5 -4
- package/.cursor/commands/close.md +4 -3
- package/.cursor/commands/convergence-monitoring.md +13 -0
- package/.cursor/commands/debug.md +4 -4
- package/.cursor/commands/discovery.md +4 -4
- package/.cursor/commands/dispatcher.md +4 -4
- package/.cursor/commands/eli5.md +4 -4
- package/.cursor/commands/eval.md +4 -4
- package/.cursor/commands/evolve.md +4 -4
- package/.cursor/commands/go.md +4 -3
- package/.cursor/commands/grill.md +4 -4
- package/.cursor/commands/harness-audit.md +3 -3
- package/.cursor/commands/memory-cleanup.md +4 -4
- package/.cursor/commands/npm-publish.md +13 -0
- package/.cursor/commands/persona-panel.md +4 -4
- package/.cursor/commands/plan.md +5 -4
- package/.cursor/commands/portfolio.md +3 -3
- package/.cursor/commands/reconcile.md +4 -4
- package/.cursor/commands/release.md +4 -3
- package/.cursor/commands/repo-audit.md +4 -4
- package/.cursor/commands/spinout.md +4 -4
- package/.cursor/commands/sunset-review.md +4 -4
- package/.cursor/commands/test.md +3 -3
- package/.cursor/commands/ux-grill.md +4 -4
- package/.cursor/rules/010-session-workflow.mdc +2 -2
- package/.cursor/skills/bootstrap/SKILL.md +1 -0
- package/.cursor/skills/close/SKILL.md +13 -0
- package/.cursor/skills/debug/SKILL.md +0 -1
- package/.cursor/skills/discovery/SKILL.md +0 -1
- package/.cursor/skills/dispatcher/SKILL.md +0 -1
- package/.cursor/skills/eli5/SKILL.md +0 -1
- package/.cursor/skills/evolve/SKILL.md +0 -1
- package/.cursor/skills/go/SKILL.md +13 -0
- package/.cursor/skills/grill/SKILL.md +0 -1
- package/.cursor/skills/harness-audit/SKILL.md +12 -0
- package/.cursor/skills/portfolio/SKILL.md +12 -0
- package/.cursor/skills/release/SKILL.md +13 -0
- package/.cursor/skills/repo-audit/SKILL.md +0 -1
- package/.cursor/skills/sunset-review/SKILL.md +0 -1
- package/.cursor/skills/test/SKILL.md +12 -0
- package/.cursor/skills/ux-grill/SKILL.md +0 -1
- package/.cursor-plugin/plugin.json +2 -2
- package/.orchestrator/policy/blocked-commands.json +10 -0
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +80 -0
- package/README.md +74 -235
- package/commands/session.md +10 -0
- package/docs/USER-GUIDE.md +24 -0
- package/docs/ci-setup.md +53 -0
- package/docs/codex-setup.md +1 -1
- package/docs/components.md +12 -5
- package/docs/events-schema.md +5 -1
- package/docs/install.md +128 -0
- package/docs/persona-panel.md +1 -1
- package/docs/pi-setup.md +1 -1
- package/docs/rule-authoring.md +83 -14
- package/docs/scope-collision-guard.md +2 -0
- package/docs/session-config-reference.md +6 -4
- package/docs/session-config-template.md +38 -0
- package/docs/telemetry.md +15 -0
- package/hooks/_lib/hook-import-set.json +46 -6
- package/hooks/_lib/subagent-paths.mjs +15 -0
- package/hooks/_lib/vcs-create-matcher.mjs +217 -62
- package/hooks/enforce-scope.mjs +42 -1
- package/hooks/hooks-codex.json +1 -1
- package/hooks/hooks.json +1 -1
- package/hooks/on-session-end.mjs +14 -2
- package/hooks/on-stop.mjs +43 -1
- package/hooks/post-bash-write-verify.mjs +3 -0
- package/hooks/pre-auq-clarity.mjs +3 -0
- package/hooks/pre-bash-issue-budget.mjs +103 -17
- package/hooks/pre-task-scope-disjoint.mjs +152 -3
- package/hooks/skill-invocation-telemetry.mjs +2 -1
- package/package.json +3 -2
- package/pi/prompts/autopilot.md +3 -3
- package/pi/prompts/bootstrap.md +3 -3
- package/pi/prompts/brainstorm.md +3 -3
- package/pi/prompts/close.md +2 -2
- package/pi/prompts/convergence-monitoring.md +11 -0
- package/pi/prompts/debug.md +3 -3
- package/pi/prompts/discovery.md +3 -3
- package/pi/prompts/dispatcher.md +3 -3
- package/pi/prompts/eli5.md +3 -3
- package/pi/prompts/eval.md +3 -3
- package/pi/prompts/evolve.md +3 -3
- package/pi/prompts/go.md +2 -2
- package/pi/prompts/grill.md +3 -3
- package/pi/prompts/harness-audit.md +2 -3
- package/pi/prompts/memory-cleanup.md +3 -3
- package/pi/prompts/npm-publish.md +11 -0
- package/pi/prompts/persona-panel.md +3 -3
- package/pi/prompts/plan.md +3 -3
- package/pi/prompts/portfolio.md +2 -2
- package/pi/prompts/reconcile.md +3 -3
- package/pi/prompts/release.md +3 -3
- package/pi/prompts/repo-audit.md +3 -4
- package/pi/prompts/session.md +1 -1
- package/pi/prompts/spinout.md +3 -3
- package/pi/prompts/sunset-review.md +3 -3
- package/pi/prompts/templates-ack.md +1 -1
- package/pi/prompts/test.md +3 -3
- package/pi/prompts/ux-grill.md +3 -3
- package/scripts/archive-closed-prds.mjs +2 -2
- package/scripts/auq-audit.mjs +2 -3
- package/scripts/backfill-abandoned-sessions.mjs +57 -3
- package/scripts/backfill-evidence-digest.mjs +2 -1
- package/scripts/backfill-learnings-from-vault.mjs +2 -2
- package/scripts/check-package-manager.mjs +2 -2
- package/scripts/ci/assert-vitest-green.mjs +2 -1
- package/scripts/emit-session.mjs +2 -3
- package/scripts/export-hw-learnings.mjs +2 -1
- package/scripts/express-path.mjs +1 -1
- package/scripts/gc-stale-worktrees.mjs +2 -1
- package/scripts/generate-codex-skills.mjs +48 -4
- package/scripts/generate-cursor-adapter.mjs +173 -9
- package/scripts/generate-hook-import-set.mjs +12 -27
- package/scripts/generate-pi-prompts.mjs +183 -13
- package/scripts/github-protection-audit.mjs +2 -3
- package/scripts/lib/agent-frontmatter.mjs +23 -1
- package/scripts/lib/claude-md-budget-lint.mjs +2 -5
- package/scripts/lib/command-blocker.mjs +209 -9
- package/scripts/lib/config/drift-check.mjs +19 -0
- package/scripts/lib/convergence-monitor.mjs +2 -2
- package/scripts/lib/cursor-hook-bridge.mjs +2 -2
- package/scripts/lib/description-surface.mjs +2 -5
- package/scripts/lib/dispatcher/cli.mjs +2 -1
- package/scripts/lib/ecosystem-wizard.mjs +2 -1
- package/scripts/lib/fetch-baseline.mjs +3 -8
- package/scripts/lib/gitlab-ops/stale-mr-sweep.mjs +2 -1
- package/scripts/lib/gitlab-portfolio/cli.mjs +2 -1
- package/scripts/lib/instruction-budget-guard.mjs +186 -46
- package/scripts/lib/is-main-module.mjs +82 -0
- package/scripts/lib/locks/index.mjs +32 -25
- package/scripts/lib/maintenance-due-banner.mjs +69 -3
- package/scripts/lib/peer-discovery.mjs +2 -5
- package/scripts/lib/playwright-driver/runner.mjs +63 -2
- package/scripts/lib/reconcile/rule-expiry-sweep.mjs +642 -0
- package/scripts/lib/rules-sync.mjs +2 -5
- package/scripts/lib/scope-echo.mjs +392 -7
- package/scripts/lib/session-close-backfill.mjs +58 -6
- package/scripts/lib/state-md.mjs +84 -3
- package/scripts/lib/sunset/walker.mjs +31 -4
- package/scripts/lib/tests-src-ratio.mjs +2 -6
- package/scripts/lib/tmux-layout/telemetry-stats.mjs +2 -1
- package/scripts/lib/user-invocable-skills.mjs +185 -0
- package/scripts/lib/validate/check-banner-parity.mjs +2 -2
- package/scripts/lib/validate/check-cursor-adapter.mjs +2 -2
- package/scripts/lib/validate/check-dead-bridge.mjs +2 -2
- package/scripts/lib/validate/check-doc-cli-commands.mjs +2 -2
- package/scripts/lib/validate/check-entry-guard.mjs +366 -0
- package/scripts/lib/validate/check-guard-requires-parity.mjs +2 -2
- package/scripts/lib/validate/check-hooks-emit-event-guard.mjs +2 -2
- package/scripts/lib/validate/check-learning-provenance.mjs +2 -2
- package/scripts/lib/validate/check-skill-links.mjs +27 -6
- package/scripts/lib/validate/check-skill-script-paths.mjs +2 -2
- package/scripts/lib/validate/check-test-git-config-target.mjs +2 -2
- package/scripts/lib/validate/check-unicode-safety.mjs +2 -2
- package/scripts/lib/validate/check-untracked-test-deps.mjs +2 -2
- package/scripts/lib/validate/check-unwired-features.mjs +266 -11
- package/scripts/lib/validate/check-validator-registration.mjs +2 -2
- package/scripts/lib/validate/check-vcs-repo-flag.mjs +2 -2
- package/scripts/lib/validate-vendored-rules.mjs +35 -9
- package/scripts/lib/wave-transcript-tail.mjs +2 -2
- package/scripts/lock-reaper.mjs +2 -1
- package/scripts/materialize-wave-scope.mjs +87 -4
- package/scripts/migrate-sessions-jsonl.mjs +2 -1
- package/scripts/migrate-vault-paths.mjs +2 -3
- package/scripts/release.mjs +124 -35
- package/scripts/relocate-vault-corpus.mjs +2 -3
- package/scripts/repair-invalid-sessions.mjs +2 -2
- package/scripts/session-shape.mjs +2 -2
- package/scripts/site-numbers.mjs +35 -11
- package/scripts/sweep-expired-rules.mjs +216 -0
- package/scripts/validate-plugin.mjs +9 -0
- package/scripts/vault-consolidate.mjs +2 -2
- package/scripts/vault-mirror.mjs +2 -3
- package/scripts/wave-scope-binding.mjs +2 -3
- package/skills/_shared/bootstrap-gate.md +1 -1
- package/skills/_shared/monitor-patterns.md +1 -1
- package/skills/_shared/research-evidence.md +53 -0
- package/skills/_shared/state-ownership.md +3 -0
- package/skills/autopilot/SKILL.md +58 -4
- package/skills/bootstrap/SKILL.md +51 -1
- package/skills/brainstorm/SKILL.md +16 -0
- package/skills/claude-md-drift-check/checker.mjs +49 -11
- package/{commands/close.md → skills/close/SKILL.md} +9 -3
- package/skills/debug/SKILL.md +10 -0
- package/skills/discovery/SKILL.md +24 -1
- package/skills/discovery/probes-session.md +2 -2
- package/skills/dispatcher/SKILL.md +38 -7
- package/skills/eli5/SKILL.md +11 -0
- package/skills/eval/SKILL.md +14 -0
- package/skills/evolve/SKILL.md +8 -1
- package/skills/evolve/references/evolve-dialectic-mode.md +6 -2
- package/{commands/go.md → skills/go/SKILL.md} +9 -1
- package/skills/grill/SKILL.md +19 -0
- package/{commands/harness-audit.md → skills/harness-audit/SKILL.md} +7 -2
- package/skills/hook-development/SKILL.md +46 -41
- package/skills/memory-cleanup/SKILL.md +7 -0
- package/skills/npm-publish/SKILL.md +1 -1
- package/skills/persona-panel/SKILL.md +56 -1
- package/skills/persona-panel/persona-format.md +1 -1
- package/skills/plan/SKILL.md +28 -1
- package/skills/playwright-driver/SKILL.md +7 -10
- package/{commands/portfolio.md → skills/portfolio/SKILL.md} +8 -2
- package/skills/reconcile/SKILL.md +10 -0
- package/{commands/release.md → skills/release/SKILL.md} +16 -2
- package/skills/repo-audit/SKILL.md +7 -0
- package/skills/session-end/plan-verification.md +2 -2
- package/skills/session-plan/SKILL.md +1 -1
- package/skills/session-start/SKILL.md +5 -4
- package/skills/session-start/phase-8-5-express-path.md +6 -6
- package/skills/session-start/references/phase-1-5-session-continuity.md +1 -1
- package/skills/session-start/references/phase-2-7-portfolio-snapshot.md +1 -1
- package/skills/session-start/references/phase-4-ssot-environment-check.md +4 -3
- package/skills/spinout/SKILL.md +12 -1
- package/skills/sunset-review/SKILL.md +13 -0
- package/{commands/test.md → skills/test/SKILL.md} +10 -4
- package/skills/ux-grill/SKILL.md +19 -1
- package/skills/wave-executor/SKILL.md +7 -4
- package/skills/wave-executor/references/wave-executor-state-init.md +13 -1
- package/skills/wave-executor/references/wave-loop-dispatch.md +3 -1
- package/skills/wave-executor/references/wave-loop-review.md +17 -1
- package/commands/autopilot.md +0 -80
- package/commands/bootstrap.md +0 -56
- package/commands/brainstorm.md +0 -48
- package/commands/debug.md +0 -36
- package/commands/discovery.md +0 -32
- package/commands/dispatcher.md +0 -59
- package/commands/eli5.md +0 -33
- package/commands/eval.md +0 -28
- package/commands/evolve.md +0 -10
- package/commands/grill.md +0 -45
- package/commands/memory-cleanup.md +0 -26
- package/commands/persona-panel.md +0 -121
- package/commands/plan.md +0 -15
- package/commands/reconcile.md +0 -23
- package/commands/repo-audit.md +0 -24
- package/commands/spinout.md +0 -15
- package/commands/sunset-review.md +0 -27
- package/commands/ux-grill.md +0 -51
package/pi/prompts/dispatcher.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use when you want the orchestrator to pick the next repo to work on across your whole portfolio — it enumerates candidate repos below the confinement root, resolves free/busy from each repo's session.lock lease, ranks the FREE ones by backlog priority × staleness × readiness, recommends the single most worthwhile one via AskUserQuestion, atomically claims it, and routes you to the chosen entry command. Triggers: \"what should I work on next\", \"dispatch me to a repo\", \"pick the next project\", \"run /dispatcher\". <example>Context: operator finished a session and wants the next-best repo across the portfolio. user: \"/dispatcher\" assistant: \"Ranked 18 free repos — top recommendation: Pencil-Designs (score 4.50, 90d stale). Confirm via the picker, I'll claim its lease atomically, then route you to /session deep.\"</example>"
|
|
3
3
|
argument-hint: "[--dry-run] [--repo <name>]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /dispatcher
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/dispatcher/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/eli5.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Explain a topic like I'm a 5 year old — restate my last output, or a named topic, in plain words without dropping a single fact. Use when the user types /eli5 [topic], or says an answer was too technical, too long, or unclear about what he now has to do."
|
|
3
3
|
argument-hint: "[topic]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /eli5
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/eli5/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/eval.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use this skill to run an honest session-process evaluation (Standard v1, aiat-llm-eval/1.0) — score the last completed orchestrator session against the pre-registered rubric-v1 dimensions, run /eval, evaluate this session, produce an eval report, or re-verify a stored eval run for reproducibility. Deterministic-first with an optional advisory LLM judge; never produces a global score."
|
|
3
3
|
argument-hint: "[--session <id>] [--no-write] [--verify <run-id>]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /eval
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/eval/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/evolve.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use this skill when extracting session patterns into reusable learnings. Three modes: analyze (extract from session history), review (edit/manage existing learnings), list (display active learnings). Manages .orchestrator/metrics/learnings.jsonl."
|
|
3
3
|
argument-hint: "[analyze|review|list|dialectic [--apply]]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /evolve
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/evolve/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/go.md
CHANGED
|
@@ -5,8 +5,8 @@ argument-hint: "[optional instructions]"
|
|
|
5
5
|
|
|
6
6
|
# /go
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/go/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/grill.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use when the user wants a plan, design, or PRD stress-tested before any build — relentlessly interrogates one decision at a time, grounds every question in the codebase, hunts contradictions against the domain language and the code, and challenges the load-bearing assumptions. Triggered by \"grill me\", \"stress-test this plan\", \"poke holes in my design\". Composable — run standalone or as an adversarial pass before /plan feature."
|
|
3
3
|
argument-hint: "[file-path-or-topic]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /grill
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/grill/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Run the harness audit and report the rubric score for this repository
|
|
3
|
-
argument-hint: ""
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# /harness-audit
|
|
7
6
|
|
|
8
|
-
Use the Session Orchestrator
|
|
7
|
+
Use the Session Orchestrator skill definition at `skills/harness-audit/SKILL.md`.
|
|
9
8
|
|
|
10
9
|
Arguments: $@
|
|
11
10
|
|
|
12
|
-
Read that
|
|
11
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use this skill when performing manual memory consolidation (Dream-equivalent). Reviews, consolidates, and prunes memory files under ~/.claude/projects/*/memory/. Run after major refactors, every 5+ sessions, or when memory quality degrades (broken links, stale references, contradictions, MEMORY.md > 200 lines). Invoke with /memory-cleanup."
|
|
3
3
|
argument-hint: "[--dry-run | --apply-pending]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /memory-cleanup
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/memory-cleanup/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Use when publishing this package to npm — a version release (npm publish), verifying the registry/pi.dev listing, or diagnosing npm auth failures (E403 2FA/token errors). Token-based flow via NPM_TOKEN in .env.local with a temp userconfig, the leakage gate before every publish, post-publish verification and marker/badge upkeep. Trigger on \"publish to npm\", \"npm release\", \"E403 publish error\"."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /npm-publish
|
|
6
|
+
|
|
7
|
+
Use the Session Orchestrator skill definition at `skills/npm-publish/SKILL.md`.
|
|
8
|
+
|
|
9
|
+
Arguments: $@
|
|
10
|
+
|
|
11
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use this skill when you need multi-persona parallel content review — domain experts, buyer personas, compliance reviewers, or custom catalog entries reviewing a target file or output. Dispatches N persona agents in parallel, consolidates verdicts via a configurable mode (voting-quorum, hard-gate-threshold, or coordinator-summary), and writes a timestamped sidecar to .orchestrator/persona-panel/. Invoked via /persona-panel <target-path>."
|
|
3
3
|
argument-hint: "<target> [--personas <names,...>] [--mode <voting|hard-gate|summary>] [--threshold <M-of-N|all|any>] [--grounding <off|re-derive>] [--dry-run]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /persona-panel
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/persona-panel/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/plan.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use this skill when performing structured project planning and PRD generation with three modes: new (project kickoff with repo scaffolding), feature (compact feature PRD), retro (data-driven retrospective). All modes share a researched Q&A engine that dispatches parallel Explore agents before each question wave, presents options via AskUserQuestion with recommendations, and produces documents with prioritized issue creation."
|
|
3
3
|
argument-hint: "[new|feature|retro]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /plan
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/plan/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/portfolio.md
CHANGED
|
@@ -5,8 +5,8 @@ argument-hint: "[--dry-run] [--repo <name>]"
|
|
|
5
5
|
|
|
6
6
|
# /portfolio
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/portfolio/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/reconcile.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Use this skill when the user wants to reconcile learnings into rules, run /reconcile, propose rules from learnings, turn learnings into .claude/rules/ entries, or review what rules would be generated from current session learnings. On-demand version of session-end Phase 3.6.8.
|
|
3
3
|
argument-hint: "[--dry-run]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /reconcile
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/reconcile/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/release.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Cut a release — the order the steps must run in, and the criteria that abort a release
|
|
2
|
+
description: "Cut a release — the order the steps must run in, and the criteria that abort a release"
|
|
3
3
|
argument-hint: "[X.Y.Z]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /release
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/release/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/repo-audit.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
argument-hint: ""
|
|
2
|
+
description: "Use this skill when the user wants to audit a repository for baseline compliance, check code quality, security posture, CI/CD setup, testing, documentation, and ecosystem configuration. Runs 9 checklist categories and emits a Markdown report plus JSON sidecar at .orchestrator/metrics/repo-audit-<timestamp>.json. <example>Context: User is in a project repo and wants a baseline compliance check. user: \"/repo-audit\" assistant: \"Running repo-audit across 9 categories — Configuration, Code Quality, Git Hygiene, CI/CD, Testing, Security, Documentation, Clank Integration (optional), and MCP Configuration. Will produce a Markdown checklist report and JSON sidecar.\" <commentary>The user wants a compliance check; this skill is appropriate because it runs all 9 categories with pass/fail/warn/skipped statuses and writes structured output.</commentary></example>"
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# /repo-audit
|
|
7
6
|
|
|
8
|
-
Use the Session Orchestrator
|
|
7
|
+
Use the Session Orchestrator skill definition at `skills/repo-audit/SKILL.md`.
|
|
9
8
|
|
|
10
9
|
Arguments: $@
|
|
11
10
|
|
|
12
|
-
Read that
|
|
11
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/session.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Start a development session (housekeeping, feature, deep; ultradeep = deep + profile)
|
|
2
|
+
description: "Start a development session (housekeeping, feature, deep; ultradeep = deep + profile)"
|
|
3
3
|
argument-hint: "[housekeeping|feature|deep|ultradeep]"
|
|
4
4
|
---
|
|
5
5
|
|
package/pi/prompts/spinout.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use when extracting a project into its own repo — a venture spinout (e.g. a product leaving its incubator repo) or a sanitized content-snapshot fork. Guided 5-step runbook: target sphere + path, confidentiality/sanitize check, copy + fresh git init, SNAPSHOT-FREEZE marker in the source repo, remotes + registration. Trigger on 'spin out X', 'extract this into its own repo', 'fork X sanitized'."
|
|
3
3
|
argument-hint: "[--type venture|snapshot] [--dry-run]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /spinout
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/spinout/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use this skill when the user wants to identify unused, near-zero-use, or stale skills/agents/commands in the plugin surface so they can be demoted or retired. Combines agent-dispatch telemetry (start-events only) with static reference scanning, classifies every surface item into Active / Investigate / Demote / Retire, and emits a Markdown report plus JSON sidecar. NEVER auto-deletes — surfaces candidates for human decision. Quarterly cadence. <example>Context: The plugin surface has grown and the maintainer wants to prune dead weight. user: \"/sunset-review\" assistant: \"Running the sunset walk — classifying skills, agents, and commands by usage telemetry + static refs, grouped by Retire / Demote / Investigate / Active. No item is deleted automatically; I'll surface Retire/Demote candidates for your decision.\" <commentary>The user wants a usage-driven prune candidate list; this skill runs the read-only walker, presents grouped verdicts, and writes a sidecar — it never deletes.</commentary></example>"
|
|
3
3
|
argument-hint: "[--kind skill|agent|command] [--window-days N]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /sunset-review
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/sunset-review/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Acknowledge templates-first policy for the current session — bypasses the pre-bash-templates-first hook for the remainder of the session
|
|
2
|
+
description: "Acknowledge templates-first policy for the current session — bypasses the pre-bash-templates-first hook for the remainder of the session"
|
|
3
3
|
argument-hint: "[optional-reason]"
|
|
4
4
|
---
|
|
5
5
|
|
package/pi/prompts/test.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Agentic end-to-end test orchestrator — drive web/macOS flows, evaluate UX rubric, reconcile issues
|
|
2
|
+
description: "Agentic end-to-end test orchestrator — drive web/macOS flows, evaluate UX rubric, reconcile issues"
|
|
3
3
|
argument-hint: "[scope|profile-name] [--since <git-ref>] [--full]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /test
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/test/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
package/pi/prompts/ux-grill.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: "Use when a running web app's UX has to be audited reproducibly rather than by feel — a deterministic mechanical pass over routes and viewports (axe, target size, horizontal overflow, page title, scripted journeys) followed by a screenshot-grounded interrogation of the operator, journey by journey, with two persona lenses from the target repo's manifest. Triggered by \"grill the UX\", \"roast the dashboard\", \"UX-Audit\", \"/ux-grill\". Bootstraps its own manifest from a loopback URL on the first run, so it never requires a hand-written file to start."
|
|
3
3
|
argument-hint: "[url | manifest-path]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /ux-grill
|
|
7
7
|
|
|
8
|
-
Use the Session Orchestrator
|
|
8
|
+
Use the Session Orchestrator skill definition at `skills/ux-grill/SKILL.md`.
|
|
9
9
|
|
|
10
10
|
Arguments: $@
|
|
11
11
|
|
|
12
|
-
Read that
|
|
12
|
+
Read that skill file and follow it exactly. When it references `$ARGUMENTS`, substitute the arguments above. Keep all Session Orchestrator platform fallbacks intact.
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
|
|
42
42
|
import { readFileSync } from 'node:fs';
|
|
43
43
|
import { spawnSync } from 'node:child_process';
|
|
44
|
-
import { pathToFileURL } from 'node:url';
|
|
45
44
|
import { join } from 'node:path';
|
|
46
45
|
|
|
47
46
|
import { findProjectRoot, resolveInstructionFile, warn } from './lib/common.mjs';
|
|
@@ -52,6 +51,7 @@ import { defaultGlabRepo } from './lib/vcs-repo-spec.mjs';
|
|
|
52
51
|
import { readLock } from './lib/session-lock.mjs';
|
|
53
52
|
import { resolveStateMdPath } from './lib/state-md/frontmatter-mutators.mjs';
|
|
54
53
|
import { parseStateMd } from './lib/state-md/yaml-parser.mjs';
|
|
54
|
+
import { isMainModule } from './lib/is-main-module.mjs';
|
|
55
55
|
|
|
56
56
|
const DEFAULT_PRD_DIR = 'docs/prd';
|
|
57
57
|
const DEFAULT_VAULT_SUBDIR = '01-projects/session-orchestrator/prd';
|
|
@@ -635,7 +635,7 @@ export function main({
|
|
|
635
635
|
// CLI guard — prevents process.exit during test-time imports
|
|
636
636
|
// ---------------------------------------------------------------------------
|
|
637
637
|
|
|
638
|
-
if (
|
|
638
|
+
if (isMainModule(import.meta.url)) {
|
|
639
639
|
try {
|
|
640
640
|
const { code } = main();
|
|
641
641
|
process.exit(code ?? 0);
|
package/scripts/auq-audit.mjs
CHANGED
|
@@ -76,6 +76,7 @@ import {
|
|
|
76
76
|
} from './lib/auq/schema.mjs';
|
|
77
77
|
import { corpusKindOf, parseRepo } from './lib/auq/parse.mjs';
|
|
78
78
|
import { writeStdoutLineSync } from './lib/io.mjs';
|
|
79
|
+
import { isMainModule } from './lib/is-main-module.mjs';
|
|
79
80
|
|
|
80
81
|
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
81
82
|
const REPO_ROOT_DEFAULT = path.resolve(HERE, '..');
|
|
@@ -818,8 +819,6 @@ function pkgVersion() {
|
|
|
818
819
|
}
|
|
819
820
|
}
|
|
820
821
|
|
|
821
|
-
const invokedDirectly =
|
|
822
|
-
process.argv[1] !== undefined &&
|
|
823
|
-
path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url));
|
|
822
|
+
const invokedDirectly =isMainModule(import.meta.url);
|
|
824
823
|
|
|
825
824
|
if (invokedDirectly) main();
|
|
@@ -39,11 +39,13 @@
|
|
|
39
39
|
import fs from 'node:fs';
|
|
40
40
|
import path from 'node:path';
|
|
41
41
|
import { parseArgs } from 'node:util';
|
|
42
|
-
import { fileURLToPath } from 'node:url';
|
|
43
42
|
|
|
44
43
|
import { backfillAbandonedSession, isUuid } from './lib/session-close-backfill.mjs';
|
|
45
44
|
import { emitEvent } from './lib/events.mjs';
|
|
46
45
|
import { getProjectDir } from './lib/platform.mjs';
|
|
46
|
+
import { isMainModule } from './lib/is-main-module.mjs';
|
|
47
|
+
import { isLockLive, readLock } from './lib/session-lock.mjs';
|
|
48
|
+
import { readProcessLocalSessionIds } from './lib/session-identity/own-session.mjs';
|
|
47
49
|
|
|
48
50
|
const LOCK_ACQUIRED = 'orchestrator.session.lock.acquired';
|
|
49
51
|
const SESSION_STARTED = 'orchestrator.session.started';
|
|
@@ -101,6 +103,24 @@ function readJsonl(filePath) {
|
|
|
101
103
|
* session.started UUID, each bridged to its semantic id via lock.acquired
|
|
102
104
|
* where one exists. Preserves first-seen order.
|
|
103
105
|
*
|
|
106
|
+
* THIS VERY PROCESS is excluded (#1376). The shared core's own
|
|
107
|
+
* `skipped-own-live-lock` branch used to carry that job alone, but it is now
|
|
108
|
+
* defeasible: `ownSessionIsEnding` lets the SessionEnd hook record its own
|
|
109
|
+
* session, so the CLI must not depend on a branch whose meaning the caller
|
|
110
|
+
* chooses. The exclusion needs THREE conjuncts, and dropping any one of them
|
|
111
|
+
* breaks it in a different direction:
|
|
112
|
+
* 1. the candidate names the lock (by either id, including the #863 (d)
|
|
113
|
+
* lock shape that stores the semantic id in `session_id`),
|
|
114
|
+
* 2. the lock is LIVE — a stale lock names a session nobody is running, and
|
|
115
|
+
* reconstructing it is exactly this CLI's job, and
|
|
116
|
+
* 3. a PROCESS-LOCAL id (hook payload / harness env, never the repo-global
|
|
117
|
+
* lock — see `readProcessLocalSessionIds`) matches the lock, which is
|
|
118
|
+
* what distinguishes THIS process from a PEER's running session in the
|
|
119
|
+
* same working copy. Without it the repo-global lock would vouch for
|
|
120
|
+
* itself and a peer's live session would read as "me".
|
|
121
|
+
* A peer's live session is NOT excluded here and does not need to be: the core
|
|
122
|
+
* still rejects it through the untouched own/foreign live-lock guards.
|
|
123
|
+
*
|
|
104
124
|
* @param {{ repoRoot: string }} args
|
|
105
125
|
* @returns {Array<{ sessionId: string, semanticSessionId: string|null }>}
|
|
106
126
|
*/
|
|
@@ -124,17 +144,51 @@ export function planSessions({ repoRoot }) {
|
|
|
124
144
|
}
|
|
125
145
|
const semanticByUuid = new Map([...semanticFromEnded, ...semanticFromLock]);
|
|
126
146
|
|
|
147
|
+
const runningIds = readRunningSessionIds(repoRoot);
|
|
148
|
+
|
|
127
149
|
const seen = new Set();
|
|
128
150
|
const plan = [];
|
|
129
151
|
for (const ev of events) {
|
|
130
152
|
if (ev.event !== SESSION_STARTED || typeof ev.session_id !== 'string') continue;
|
|
131
153
|
if (seen.has(ev.session_id)) continue;
|
|
132
154
|
seen.add(ev.session_id);
|
|
133
|
-
|
|
155
|
+
const semanticSessionId = semanticByUuid.get(ev.session_id) ?? null;
|
|
156
|
+
if (runningIds.has(ev.session_id)
|
|
157
|
+
|| (semanticSessionId !== null && runningIds.has(semanticSessionId))) continue;
|
|
158
|
+
plan.push({ sessionId: ev.session_id, semanticSessionId });
|
|
134
159
|
}
|
|
135
160
|
return plan;
|
|
136
161
|
}
|
|
137
162
|
|
|
163
|
+
/**
|
|
164
|
+
* The id(s) naming the session THIS process is, when that session holds the
|
|
165
|
+
* live lock — else the empty set (#1376). Never throws: an unreadable lock,
|
|
166
|
+
* an absent one, or an env without any process-local id all degrade to "no
|
|
167
|
+
* exclusion", which is the pre-#1376 behaviour.
|
|
168
|
+
*
|
|
169
|
+
* @param {string} repoRoot
|
|
170
|
+
* @returns {Set<string>}
|
|
171
|
+
*/
|
|
172
|
+
function readRunningSessionIds(repoRoot) {
|
|
173
|
+
const ids = new Set();
|
|
174
|
+
try {
|
|
175
|
+
const lock = readLock({ repoRoot });
|
|
176
|
+
if (!lock || !isLockLive(lock)) return ids;
|
|
177
|
+
const lockIds = [lock.session_id, lock.semantic_session_id]
|
|
178
|
+
.filter((id) => typeof id === 'string' && id.length > 0);
|
|
179
|
+
const processLocal = new Set(readProcessLocalSessionIds());
|
|
180
|
+
// Conjunct 3 — only a PROCESS-LOCAL witness may promote the repo-global
|
|
181
|
+
// lock to "this is me". Membership is tested against the lock's ids, not
|
|
182
|
+
// the other way round, so an env var that happens to name some other
|
|
183
|
+
// session never widens the exclusion.
|
|
184
|
+
if (!lockIds.some((id) => processLocal.has(id))) return ids;
|
|
185
|
+
for (const id of lockIds) ids.add(id);
|
|
186
|
+
} catch {
|
|
187
|
+
/* readLock is no-throw by contract; the contract is not ours to trust */
|
|
188
|
+
}
|
|
189
|
+
return ids;
|
|
190
|
+
}
|
|
191
|
+
|
|
138
192
|
/**
|
|
139
193
|
* Cheap pre-filter (#926): the set of session ids ALREADY present in
|
|
140
194
|
* sessions.jsonl.
|
|
@@ -527,7 +581,7 @@ async function main() {
|
|
|
527
581
|
process.exit(0);
|
|
528
582
|
}
|
|
529
583
|
|
|
530
|
-
const isDirectRun =
|
|
584
|
+
const isDirectRun = isMainModule(import.meta.url);
|
|
531
585
|
if (isDirectRun) {
|
|
532
586
|
main().catch((err) => {
|
|
533
587
|
process.stderr.write(`backfill-abandoned-sessions: unexpected error: ${err?.stack ?? err}\n`);
|
|
@@ -50,6 +50,7 @@ import { existsSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
|
|
|
50
50
|
import { join, relative, resolve } from 'node:path';
|
|
51
51
|
|
|
52
52
|
import { computeEvidenceDigest } from './lib/reconcile/renderer.mjs';
|
|
53
|
+
import { isMainModule } from './lib/is-main-module.mjs';
|
|
53
54
|
|
|
54
55
|
/** ISO-8601 instant — mirrors the renderer's `EVIDENCE_RECORDED_AT_RE`. */
|
|
55
56
|
const EVIDENCE_RECORDED_AT_RE = /^\d{4}-\d{2}-\d{2}T[0-9:.]+(?:Z|[+-]\d{2}:\d{2})$/;
|
|
@@ -373,4 +374,4 @@ function main(argv) {
|
|
|
373
374
|
process.exit(unsealable === 0 ? 0 : 1);
|
|
374
375
|
}
|
|
375
376
|
|
|
376
|
-
if (import.meta.url
|
|
377
|
+
if (isMainModule(import.meta.url)) main(process.argv.slice(2));
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
|
|
65
65
|
import { readFileSync, readdirSync, existsSync } from 'node:fs';
|
|
66
66
|
import { join, resolve, dirname, basename, relative } from 'node:path';
|
|
67
|
-
import { pathToFileURL } from 'node:url';
|
|
68
67
|
|
|
69
68
|
import { findProjectRoot, resolveInstructionFile, expandTilde } from './lib/common.mjs';
|
|
70
69
|
import { parseSessionConfig } from './lib/config.mjs';
|
|
@@ -72,6 +71,7 @@ import { subjectToSlug, parseFrontmatter } from './lib/vault-mirror/utils.mjs';
|
|
|
72
71
|
import { kebab } from './lib/learnings/kebab.mjs';
|
|
73
72
|
import { validateLearning } from './lib/learnings/schema.mjs';
|
|
74
73
|
import { appendLearning, isBackupOf } from './lib/learnings/io.mjs';
|
|
74
|
+
import { isMainModule } from './lib/is-main-module.mjs';
|
|
75
75
|
|
|
76
76
|
const DEFAULT_RULES_DIR = '.claude/rules';
|
|
77
77
|
const DEFAULT_STORE = '.orchestrator/metrics/learnings.jsonl';
|
|
@@ -962,7 +962,7 @@ export async function main(argv = [], deps = {}) {
|
|
|
962
962
|
}
|
|
963
963
|
|
|
964
964
|
/* c8 ignore start — CLI entrypoint */
|
|
965
|
-
if (import.meta.url
|
|
965
|
+
if (isMainModule(import.meta.url)) {
|
|
966
966
|
main(process.argv.slice(2))
|
|
967
967
|
.then(({ code }) => process.exit(code))
|
|
968
968
|
.catch((err) => {
|
|
@@ -67,6 +67,7 @@ import { existsSync, lstatSync, readFileSync } from 'node:fs';
|
|
|
67
67
|
import { dirname, join, resolve } from 'node:path';
|
|
68
68
|
import { spawnSync } from 'node:child_process';
|
|
69
69
|
import { fileURLToPath } from 'node:url';
|
|
70
|
+
import { isMainModule } from './lib/is-main-module.mjs';
|
|
70
71
|
|
|
71
72
|
const SELF_DIR = dirname(fileURLToPath(import.meta.url));
|
|
72
73
|
|
|
@@ -388,8 +389,7 @@ function parseArgs(argv) {
|
|
|
388
389
|
}
|
|
389
390
|
|
|
390
391
|
// CLI entry — only when run directly, not when imported (e.g. by tests).
|
|
391
|
-
const isMain =
|
|
392
|
-
process.argv[1] !== undefined && resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
392
|
+
const isMain =isMainModule(import.meta.url);
|
|
393
393
|
|
|
394
394
|
if (isMain) {
|
|
395
395
|
const { opts, unknown } = parseArgs(process.argv.slice(2));
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
// the existing bare message and the exit-code contract is unchanged.
|
|
51
51
|
|
|
52
52
|
import { readFileSync } from 'node:fs';
|
|
53
|
+
import { isMainModule } from '../lib/is-main-module.mjs';
|
|
53
54
|
|
|
54
55
|
const DEFAULT_MIN_TESTS = 5000;
|
|
55
56
|
|
|
@@ -232,7 +233,7 @@ function parseArgs(argv) {
|
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
// CLI entry — only when run directly, not when imported by tests.
|
|
235
|
-
const isMain =
|
|
236
|
+
const isMain =isMainModule(import.meta.url);
|
|
236
237
|
if (isMain) {
|
|
237
238
|
const { path, minTests, logPath } = parseArgs(process.argv.slice(2));
|
|
238
239
|
if (!path) {
|
package/scripts/emit-session.mjs
CHANGED
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
|
|
27
27
|
import { existsSync, readFileSync } from 'node:fs';
|
|
28
28
|
import { dirname, join } from 'node:path';
|
|
29
|
-
import { fileURLToPath } from 'node:url';
|
|
30
29
|
import { appendJsonl } from './lib/common.mjs';
|
|
31
30
|
import {
|
|
32
31
|
MEMORY_CLEANUP_EVENT,
|
|
@@ -42,6 +41,7 @@ import {
|
|
|
42
41
|
clampTimestampsMonotonic,
|
|
43
42
|
aliasLegacyEndedAt,
|
|
44
43
|
} from './lib/session-schema.mjs';
|
|
44
|
+
import { isMainModule } from './lib/is-main-module.mjs';
|
|
45
45
|
|
|
46
46
|
export { serializeSessionLineChecked };
|
|
47
47
|
|
|
@@ -277,8 +277,7 @@ async function main() {
|
|
|
277
277
|
// not when imported as a module (e.g. by tests that exercise the exported
|
|
278
278
|
// serializeSessionLineChecked seam — #662). Without this guard, importing the
|
|
279
279
|
// module would block on stdin / exit the test process.
|
|
280
|
-
const _isDirectRun =
|
|
281
|
-
process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1];
|
|
280
|
+
const _isDirectRun =isMainModule(import.meta.url);
|
|
282
281
|
|
|
283
282
|
if (_isDirectRun) {
|
|
284
283
|
main().catch((err) => {
|
|
@@ -63,6 +63,7 @@ import { parseSessionConfig } from './lib/config.mjs';
|
|
|
63
63
|
import { createSecretValueMasker } from './lib/secret-masker.mjs';
|
|
64
64
|
import { stableHostname, readHostAliases } from './lib/host-identity.mjs';
|
|
65
65
|
import { emitEvent, sessionAttribution } from './lib/events.mjs';
|
|
66
|
+
import { isMainModule } from './lib/is-main-module.mjs';
|
|
66
67
|
|
|
67
68
|
// Vault-relative default write target (Epic #774 — docs Public-Split removed
|
|
68
69
|
// the prior in-repo generated telemetry doc in favor of the private Meta-Vault).
|
|
@@ -724,7 +725,7 @@ export async function exportHwLearnings(opts) {
|
|
|
724
725
|
}
|
|
725
726
|
|
|
726
727
|
// Run as CLI when invoked directly
|
|
727
|
-
const isMain =
|
|
728
|
+
const isMain =isMainModule(import.meta.url);
|
|
728
729
|
if (isMain) {
|
|
729
730
|
const opts = parseArgs(process.argv.slice(2));
|
|
730
731
|
|
package/scripts/express-path.mjs
CHANGED
|
@@ -281,7 +281,7 @@ async function main() {
|
|
|
281
281
|
|
|
282
282
|
// The banner the coordinator echoes into the transcript — `/go` and
|
|
283
283
|
// session-plan's Express Path Short-Circuit both key off this EXACT line
|
|
284
|
-
// (`
|
|
284
|
+
// (`skills/go/SKILL.md` § Express Path Detection), so it is written verbatim,
|
|
285
285
|
// without the `express-path:` diagnostic prefix. Still stderr: stdout belongs
|
|
286
286
|
// to the verdict.
|
|
287
287
|
if (verdict.activated) {
|