oh-my-copilot 5.19.2 → 5.19.4
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +70 -67
- package/agents/planner.md +4 -4
- package/bin/oh-my-copilot.js +5 -1
- package/bridge/claude-md-coordinator.cjs +2 -2
- package/bridge/cli.cjs +3043 -2635
- package/bridge/mcp-server.cjs +969 -867
- package/bridge/runtime-cli.cjs +244 -184
- package/bridge/team-bridge.cjs +17 -1
- package/bridge/team-mcp.cjs +208 -140
- package/bridge/team.js +73 -13
- package/copilot/agents/planner.md +4 -4
- package/dist/__tests__/ci-evidence.test.d.ts +2 -0
- package/dist/__tests__/ci-evidence.test.d.ts.map +1 -0
- package/dist/__tests__/ci-evidence.test.js +210 -0
- package/dist/__tests__/ci-evidence.test.js.map +1 -0
- package/dist/__tests__/copilot-hooks-manifest.test.js +1 -0
- package/dist/__tests__/copilot-hooks-manifest.test.js.map +1 -1
- package/dist/__tests__/doctor-conflicts.test.js +6 -5
- package/dist/__tests__/doctor-conflicts.test.js.map +1 -1
- package/dist/__tests__/hud/cli-diagnostic.test.js +4 -3
- package/dist/__tests__/hud/cli-diagnostic.test.js.map +1 -1
- package/dist/__tests__/mnemosyne/detector.test.js +3 -2
- package/dist/__tests__/mnemosyne/detector.test.js.map +1 -1
- package/dist/__tests__/run-cjs-windows-stdio-contract.test.js +50 -10
- package/dist/__tests__/run-cjs-windows-stdio-contract.test.js.map +1 -1
- package/dist/__tests__/session-end-process-exit.test.js +15 -5
- package/dist/__tests__/session-end-process-exit.test.js.map +1 -1
- package/dist/__tests__/session-start-script-context.test.js +1 -1
- package/dist/__tests__/session-start-script-context.test.js.map +1 -1
- package/dist/__tests__/setup/stub-skill-list-probe.d.ts +2 -0
- package/dist/__tests__/setup/stub-skill-list-probe.d.ts.map +1 -0
- package/dist/__tests__/setup/stub-skill-list-probe.js +11 -0
- package/dist/__tests__/setup/stub-skill-list-probe.js.map +1 -0
- package/dist/__tests__/setup-claude-md-script.test.js +7 -4
- package/dist/__tests__/setup-claude-md-script.test.js.map +1 -1
- package/dist/__tests__/setup-config-script.test.d.ts +2 -0
- package/dist/__tests__/setup-config-script.test.d.ts.map +1 -0
- package/dist/__tests__/setup-config-script.test.js +350 -0
- package/dist/__tests__/setup-config-script.test.js.map +1 -0
- package/dist/__tests__/shipyard-seed-locale.test.js +1 -1
- package/dist/__tests__/shipyard-seed-locale.test.js.map +1 -1
- package/dist/__tests__/shipyard-skills.test.js +9 -9
- package/dist/__tests__/shipyard-skills.test.js.map +1 -1
- package/dist/__tests__/tier0-docs-consistency.test.js +5 -5
- package/dist/__tests__/tier0-docs-consistency.test.js.map +1 -1
- package/dist/__tests__/trusted-publishing-contract.test.js +56 -7
- package/dist/__tests__/trusted-publishing-contract.test.js.map +1 -1
- package/dist/__tests__/visual-verdict-skill.test.js +1 -1
- package/dist/__tests__/visual-verdict-skill.test.js.map +1 -1
- package/dist/cli/__tests__/autoresearch.test.js +3 -2
- package/dist/cli/__tests__/autoresearch.test.js.map +1 -1
- package/dist/cli/autoresearch.d.ts +1 -1
- package/dist/cli/autoresearch.d.ts.map +1 -1
- package/dist/cli/autoresearch.js +2 -1
- package/dist/cli/autoresearch.js.map +1 -1
- package/dist/cli/commands/__tests__/factory-init.test.js +2 -1
- package/dist/cli/commands/__tests__/factory-init.test.js.map +1 -1
- package/dist/cli/commands/__tests__/intake.test.js +26 -4
- package/dist/cli/commands/__tests__/intake.test.js.map +1 -1
- package/dist/cli/commands/doctor-conflicts.d.ts.map +1 -1
- package/dist/cli/commands/doctor-conflicts.js +5 -4
- package/dist/cli/commands/doctor-conflicts.js.map +1 -1
- package/dist/cli/commands/factory.d.ts.map +1 -1
- package/dist/cli/commands/factory.js +4 -3
- package/dist/cli/commands/factory.js.map +1 -1
- package/dist/cli/commands/intake.d.ts.map +1 -1
- package/dist/cli/commands/intake.js +13 -4
- package/dist/cli/commands/intake.js.map +1 -1
- package/dist/cli/commands/release.d.ts.map +1 -1
- package/dist/cli/commands/release.js +11 -2
- package/dist/cli/commands/release.js.map +1 -1
- package/dist/cli/commands/ship.d.ts +1 -1
- package/dist/cli/commands/ship.js +1 -1
- package/dist/copilot-run/job.d.ts.map +1 -1
- package/dist/copilot-run/job.js +4 -1
- package/dist/copilot-run/job.js.map +1 -1
- package/dist/copilot-run/sandbox.d.ts +2 -7
- package/dist/copilot-run/sandbox.d.ts.map +1 -1
- package/dist/copilot-run/sandbox.js +2 -26
- package/dist/copilot-run/sandbox.js.map +1 -1
- package/dist/factory/__tests__/listener.test.js +22 -4
- package/dist/factory/__tests__/listener.test.js.map +1 -1
- package/dist/factory/listener.d.ts +2 -2
- package/dist/factory/listener.d.ts.map +1 -1
- package/dist/factory/listener.js +20 -5
- package/dist/factory/listener.js.map +1 -1
- package/dist/factory/run/__tests__/prepare-gates.test.js +7 -1
- package/dist/factory/run/__tests__/prepare-gates.test.js.map +1 -1
- package/dist/factory/run/engine.d.ts.map +1 -1
- package/dist/factory/run/engine.js +1 -0
- package/dist/factory/run/engine.js.map +1 -1
- package/dist/features/continuation-enforcement.d.ts.map +1 -1
- package/dist/features/continuation-enforcement.js +2 -1
- package/dist/features/continuation-enforcement.js.map +1 -1
- package/dist/features/lookout/__tests__/lookout.test.js +9 -6
- package/dist/features/lookout/__tests__/lookout.test.js.map +1 -1
- package/dist/forge/__tests__/gh-argv-baseline.factory.test.js +7 -1
- package/dist/forge/__tests__/gh-argv-baseline.factory.test.js.map +1 -1
- package/dist/hooks/__tests__/bridge.test.js +10 -2
- package/dist/hooks/__tests__/bridge.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/pipeline.test.js +2 -1
- package/dist/hooks/autopilot/__tests__/pipeline.test.js.map +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.d.ts.map +1 -1
- package/dist/hooks/autopilot/adapters/execution-adapter.js +3 -2
- package/dist/hooks/autopilot/adapters/execution-adapter.js.map +1 -1
- package/dist/hooks/autopilot/adapters/ralplan-adapter.d.ts.map +1 -1
- package/dist/hooks/autopilot/adapters/ralplan-adapter.js +2 -1
- package/dist/hooks/autopilot/adapters/ralplan-adapter.js.map +1 -1
- package/dist/hooks/learner/detector.d.ts.map +1 -1
- package/dist/hooks/learner/detector.js +2 -6
- package/dist/hooks/learner/detector.js.map +1 -1
- package/dist/hooks/mode-registry/index.d.ts.map +1 -1
- package/dist/hooks/mode-registry/index.js +2 -1
- package/dist/hooks/mode-registry/index.js.map +1 -1
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js +7 -0
- package/dist/hooks/persistent-mode/__tests__/team-ralplan-stop.test.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +6 -5
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/persistent-mode/session-isolation.test.js +23 -14
- package/dist/hooks/persistent-mode/session-isolation.test.js.map +1 -1
- package/dist/hooks/ralph/loop.d.ts +1 -1
- package/dist/hooks/ralph/loop.js +1 -1
- package/dist/hooks/ralph/prd.d.ts.map +1 -1
- package/dist/hooks/ralph/prd.js +2 -1
- package/dist/hooks/ralph/prd.js.map +1 -1
- package/dist/hooks/ralph/stale-prd.d.ts +2 -2
- package/dist/hooks/ralph/stale-prd.js +3 -3
- package/dist/hooks/ralph/stale-prd.js.map +1 -1
- package/dist/hooks/ralph/verifier.d.ts +1 -1
- package/dist/hooks/ralph/verifier.d.ts.map +1 -1
- package/dist/hooks/ralph/verifier.js +4 -3
- package/dist/hooks/ralph/verifier.js.map +1 -1
- package/dist/hooks/session-end/__tests__/spawn-next.test.js +31 -4
- package/dist/hooks/session-end/__tests__/spawn-next.test.js.map +1 -1
- package/dist/hooks/session-end/spawn-next.d.ts +6 -3
- package/dist/hooks/session-end/spawn-next.d.ts.map +1 -1
- package/dist/hooks/session-end/spawn-next.js +19 -6
- package/dist/hooks/session-end/spawn-next.js.map +1 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +3 -2
- package/dist/hud/index.js.map +1 -1
- package/dist/installer/__tests__/hook-templates.test.js +3 -1
- package/dist/installer/__tests__/hook-templates.test.js.map +1 -1
- package/dist/installer/__tests__/session-start-template.test.js +16 -8
- package/dist/installer/__tests__/session-start-template.test.js.map +1 -1
- package/dist/installer/hooks.d.ts +1 -1
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +2 -1
- package/dist/installer/hooks.js.map +1 -1
- package/dist/release/__tests__/checks.test.js +39 -1
- package/dist/release/__tests__/checks.test.js.map +1 -1
- package/dist/release/__tests__/engine.test.js +236 -3
- package/dist/release/__tests__/engine.test.js.map +1 -1
- package/dist/release/checks.d.ts +18 -1
- package/dist/release/checks.d.ts.map +1 -1
- package/dist/release/checks.js +40 -1
- package/dist/release/checks.js.map +1 -1
- package/dist/release/engine.d.ts +14 -2
- package/dist/release/engine.d.ts.map +1 -1
- package/dist/release/engine.js +211 -44
- package/dist/release/engine.js.map +1 -1
- package/dist/ship/__tests__/exec-env.test.d.ts +2 -0
- package/dist/ship/__tests__/exec-env.test.d.ts.map +1 -0
- package/dist/ship/__tests__/exec-env.test.js +26 -0
- package/dist/ship/__tests__/exec-env.test.js.map +1 -0
- package/dist/ship/__tests__/exec-plant.test.d.ts +2 -0
- package/dist/ship/__tests__/exec-plant.test.d.ts.map +1 -0
- package/dist/ship/__tests__/exec-plant.test.js +34 -0
- package/dist/ship/__tests__/exec-plant.test.js.map +1 -0
- package/dist/ship/__tests__/gates.test.js +35 -0
- package/dist/ship/__tests__/gates.test.js.map +1 -1
- package/dist/ship/__tests__/workflow-checks.test.js +34 -5
- package/dist/ship/__tests__/workflow-checks.test.js.map +1 -1
- package/dist/ship/config.js +3 -3
- package/dist/ship/config.js.map +1 -1
- package/dist/ship/exec.d.ts.map +1 -1
- package/dist/ship/exec.js +10 -2
- package/dist/ship/exec.js.map +1 -1
- package/dist/ship/gates.d.ts.map +1 -1
- package/dist/ship/gates.js +3 -1
- package/dist/ship/gates.js.map +1 -1
- package/dist/skills/__tests__/mingw-escape.test.js +0 -35
- package/dist/skills/__tests__/mingw-escape.test.js.map +1 -1
- package/dist/skills/__tests__/omc-setup-optout.test.js +4 -3
- package/dist/skills/__tests__/omc-setup-optout.test.js.map +1 -1
- package/dist/smoke/__tests__/copilot-factory-run-scenario.test.js +7 -1
- package/dist/smoke/__tests__/copilot-factory-run-scenario.test.js.map +1 -1
- package/dist/smoke/__tests__/copilot-sdk-driver.test.js +2 -2
- package/dist/smoke/__tests__/copilot-sdk-driver.test.js.map +1 -1
- package/dist/smoke/copilot-sdk-scenarios.d.ts.map +1 -1
- package/dist/smoke/copilot-sdk-scenarios.js +2 -1
- package/dist/smoke/copilot-sdk-scenarios.js.map +1 -1
- package/dist/team/__tests__/git-worktree.test.js +10 -1
- package/dist/team/__tests__/git-worktree.test.js.map +1 -1
- package/dist/team/__tests__/runtime-cli.test.js +4 -4
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +16 -2
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-launch-ack.test.js +14 -0
- package/dist/team/__tests__/worker-launch-ack.test.js.map +1 -1
- package/dist/team/git-worktree.d.ts.map +1 -1
- package/dist/team/git-worktree.js +13 -5
- package/dist/team/git-worktree.js.map +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +8 -6
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/ultragoal/goal-record.d.ts.map +1 -1
- package/dist/ultragoal/goal-record.js +2 -1
- package/dist/ultragoal/goal-record.js.map +1 -1
- package/dist/utils/__tests__/skill-slash.test.d.ts +2 -0
- package/dist/utils/__tests__/skill-slash.test.d.ts.map +1 -0
- package/dist/utils/__tests__/skill-slash.test.js +307 -0
- package/dist/utils/__tests__/skill-slash.test.js.map +1 -0
- package/dist/utils/__tests__/windows-search.test.d.ts +2 -0
- package/dist/utils/__tests__/windows-search.test.d.ts.map +1 -0
- package/dist/utils/__tests__/windows-search.test.js +154 -0
- package/dist/utils/__tests__/windows-search.test.js.map +1 -0
- package/dist/utils/skill-registry.d.ts +51 -0
- package/dist/utils/skill-registry.d.ts.map +1 -0
- package/dist/utils/skill-registry.js +168 -0
- package/dist/utils/skill-registry.js.map +1 -0
- package/dist/utils/skill-slash.d.ts +18 -0
- package/dist/utils/skill-slash.d.ts.map +1 -0
- package/dist/utils/skill-slash.js +20 -0
- package/dist/utils/skill-slash.js.map +1 -0
- package/dist/utils/windows-search.d.ts +42 -0
- package/dist/utils/windows-search.d.ts.map +1 -0
- package/dist/utils/windows-search.js +94 -0
- package/dist/utils/windows-search.js.map +1 -0
- package/docs/ARCHITECTURE.md +29 -29
- package/docs/CLAUDE.md +4 -4
- package/docs/FIELD-TESTING.md +563 -0
- package/docs/GETTING-STARTED.md +11 -11
- package/docs/HOOKS.md +8 -8
- package/docs/MIGRATION.md +100 -100
- package/docs/PERFORMANCE-MONITORING.md +2 -2
- package/docs/REFERENCE.md +131 -131
- package/docs/TOOLS.md +1 -1
- package/docs/cancel-skill-active-state-gap.md +2 -2
- package/docs/copilot-instructions.md +3 -3
- package/docs/design/P2-RUN-LEDGER-AND-INTAKE-PLAN.md +1 -1
- package/docs/design/project-session-manager.md +1 -1
- package/docs/field-testing-first-prompt.md +36 -0
- package/docs/shared/features.md +5 -5
- package/docs/shipyard.md +8 -8
- package/package.json +2 -2
- package/plugin.json +1 -1
- package/scripts/build-workflow-stage-prompts.mjs +15 -6
- package/scripts/ci/duration-sequencer.mjs +69 -0
- package/scripts/ci/durations-reporter.mjs +34 -0
- package/scripts/ci/tree-reuse.mjs +166 -0
- package/scripts/ci/update-test-durations.mjs +62 -0
- package/scripts/copilot/dispatch.cjs +3 -0
- package/scripts/find-node.sh +1 -1
- package/scripts/keyword-detector.mjs +5 -4
- package/scripts/lib/copilot-hook-adapter.cjs +3 -0
- package/scripts/lib/hud-wrapper-template.txt +2 -2
- package/scripts/lib/skill-slash.mjs +11 -0
- package/scripts/lib/windows-search.cjs +40 -0
- package/scripts/lib/windows-search.mjs +7 -0
- package/scripts/lib/workflow-stage-prompts.mjs +6 -2
- package/scripts/persistent-mode.cjs +11 -10
- package/scripts/persistent-mode.mjs +16 -11
- package/scripts/plugin-shipping-surface.mjs +1 -0
- package/scripts/pre-tool-enforcer.mjs +1 -1
- package/scripts/session-start.mjs +3 -3
- package/scripts/setup-claude-md.mjs +3 -0
- package/scripts/setup-config.mjs +420 -0
- package/scripts/setup-progress.mjs +3 -0
- package/scripts/shipyard-audit.mjs +2 -1
- package/scripts/stale-run-reporter.mjs +2 -1
- package/skills/AGENTS.md +4 -4
- package/skills/ai-slop-cleaner/SKILL.md +3 -3
- package/skills/ask/SKILL.md +7 -7
- package/skills/ask-navigator/SKILL.md +11 -11
- package/skills/autopilot/SKILL.md +5 -5
- package/skills/cancel/SKILL.md +5 -5
- package/skills/configure-notifications/SKILL.md +10 -10
- package/skills/critique/SKILL.md +1 -1
- package/skills/discover/SKILL.md +1 -1
- package/skills/drydock/SKILL.md +5 -5
- package/skills/external-context/SKILL.md +4 -4
- package/skills/graph/SKILL.md +2 -2
- package/skills/harbor/SKILL.md +7 -7
- package/skills/hud/SKILL.md +10 -10
- package/skills/intent/SKILL.md +1 -1
- package/skills/launch/SKILL.md +13 -13
- package/skills/loft/SKILL.md +2 -2
- package/skills/map/SKILL.md +1 -1
- package/skills/omc-ado-auto-review/SKILL.md +2 -2
- package/skills/omc-ado-review/SKILL.md +2 -2
- package/skills/omc-ado-setup/SKILL.md +1 -1
- package/skills/omc-ado-sprint/SKILL.md +2 -2
- package/skills/omc-ado-triage/SKILL.md +2 -2
- package/skills/omc-doctor/SKILL.md +1 -1
- package/skills/omc-gh-auto-review/SKILL.md +2 -2
- package/skills/omc-gh-project/SKILL.md +2 -2
- package/skills/omc-gh-review/SKILL.md +2 -2
- package/skills/omc-gh-setup/SKILL.md +2 -2
- package/skills/omc-gh-triage/SKILL.md +3 -3
- package/skills/omc-setup/SKILL.md +16 -14
- package/skills/omc-setup/phases/01-install-claude-md.md +1 -18
- package/skills/omc-setup/phases/02-configure.md +10 -30
- package/skills/omc-setup/phases/03-integrations.md +5 -5
- package/skills/omc-setup/phases/04-welcome.md +7 -7
- package/skills/plan/SKILL.md +1 -1
- package/skills/project-session-manager/SKILL.md +1 -1
- package/skills/ralph/SKILL.md +6 -6
- package/skills/ralph-experiment/SKILL.md +3 -3
- package/skills/ralplan/SKILL.md +4 -4
- package/skills/release/SKILL.md +1 -1
- package/skills/self-improve/SKILL.md +1 -1
- package/skills/skill/SKILL.md +12 -12
- package/skills/team/SKILL.md +8 -8
- package/skills/trace/SKILL.md +1 -1
- package/skills/visual-verdict/SKILL.md +1 -1
- package/templates/hooks/keyword-detector.mjs +4 -4
- package/templates/hooks/lib/workflow-stage-prompts.mjs +6 -2
- package/templates/hooks/persistent-mode.mjs +12 -8
- package/templates/hooks/session-start.mjs +1 -1
- package/bridge/__pycache__/gyoshu_bridge.cpython-314.pyc +0 -0
package/docs/shared/features.md
CHANGED
|
@@ -10,11 +10,11 @@ Compaction-resilient memory system at `.omg/notepad.md` with three tiers:
|
|
|
10
10
|
| **Working Memory** | Timestamped entries, auto-pruned after 7 days | Debugging breadcrumbs, temporary findings |
|
|
11
11
|
| **MANUAL** | Never auto-pruned | Team contacts, deployment info, permanent notes |
|
|
12
12
|
|
|
13
|
-
**User skill:** `/
|
|
14
|
-
- `/
|
|
15
|
-
- `/
|
|
16
|
-
- `/
|
|
17
|
-
- `/
|
|
13
|
+
**User skill:** `/note`
|
|
14
|
+
- `/note <content>` - Add to Working Memory
|
|
15
|
+
- `/note --priority <content>` - Add to Priority Context
|
|
16
|
+
- `/note --manual <content>` - Add to MANUAL section
|
|
17
|
+
- `/note --show` - Display notepad contents
|
|
18
18
|
|
|
19
19
|
**Automatic capture:** `<remember>` tags in Task agent output are automatically captured:
|
|
20
20
|
- `<remember>content</remember>` → Working Memory with timestamp
|
package/docs/shipyard.md
CHANGED
|
@@ -4,7 +4,7 @@ Shipyard is the delivery methodology behind seven opt-in skills: `drydock`, `ask
|
|
|
4
4
|
|
|
5
5
|
> **Everyone ships, and nobody ships randomly** — agents continuously run everything repeatable and acceptable-by-evidence; humans decide what cannot be judged by the system or what fails expensively.
|
|
6
6
|
|
|
7
|
-
This page is the map of the methodology: the boundary principle, the roles, the four pillars, the surface layout, the working metaphor, and how the seven skills compose. The skills themselves (`/
|
|
7
|
+
This page is the map of the methodology: the boundary principle, the roles, the four pillars, the surface layout, the working metaphor, and how the seven skills compose. The skills themselves (`/drydock`, `/ask-navigator`, `/loft`, `/harbor`, `/launch`, `/architecture-survey`, `/minimal-code-discipline`) are the executable form.
|
|
8
8
|
|
|
9
9
|
## The verifiability boundary
|
|
10
10
|
|
|
@@ -33,7 +33,7 @@ The premise sentence is the role model compressed: **everyone ships** is the adm
|
|
|
33
33
|
|
|
34
34
|
## The four pillars → five surfaces
|
|
35
35
|
|
|
36
|
-
A repo that humans and agents both build on carries four pillars across five conceptual surfaces. `/
|
|
36
|
+
A repo that humans and agents both build on carries four pillars across five conceptual surfaces. `/drydock` lays them; every later session inherits them by reading.
|
|
37
37
|
|
|
38
38
|
| Conceptual surface | Concrete paths | Carries / filled by |
|
|
39
39
|
| --- | --- | --- |
|
|
@@ -50,13 +50,13 @@ A repo that humans and agents both build on carries four pillars across five con
|
|
|
50
50
|
| The shipyard | The whole harness | A shared facility; everyone comes here to build |
|
|
51
51
|
| The keel | Shared context + rules surfaces | Lay the skeleton first; the hull grows upward |
|
|
52
52
|
| The fog | An effort whose destination isn't stateable yet | Nobody ships randomly — and nobody ships into fog without a chart |
|
|
53
|
-
| The navigator | `/
|
|
54
|
-
| The loft | `/
|
|
55
|
-
| The harbor | `/
|
|
53
|
+
| The navigator | `/ask-navigator` | Charts the fog as a map of decision tickets; hands off, never builds |
|
|
54
|
+
| The loft | `/loft` | Cut no steel until the shape is fair: a throwaway artifact answers a design question before real work begins |
|
|
55
|
+
| The harbor | `/harbor` | The port's gate: external requests inspected, dispositioned, and turned into work orders — never merges, never decides |
|
|
56
56
|
| The classification society | `docs/standards/` + `design-system/` | A ship must pass class to sail = changes must pass standards to merge |
|
|
57
57
|
| The charts | specs + tickets | Launch's output; build from the chart |
|
|
58
58
|
| The logbook | `docs/adr/` | Decisions, auditable after the fact |
|
|
59
|
-
| The launch | `/
|
|
59
|
+
| The launch | `/launch` | Everyone may launch — and not one class check may be skipped |
|
|
60
60
|
| The lookout | `omg lookout` | The mast watch: before an unattended run, scan the briefing and the workspace for danger — the lookout reports, the captain decides |
|
|
61
61
|
|
|
62
62
|
## The seven skills compose
|
|
@@ -81,7 +81,7 @@ Two levers every checkpoint pulls: **push right** — a checkpoint is deferred a
|
|
|
81
81
|
|
|
82
82
|
Every shipyard skill — the seven compose skills plus the `agent-doc-discipline` companion — sits on one of two axes:
|
|
83
83
|
|
|
84
|
-
- **User-invoked** — reachable only by the human typing the skill (`/
|
|
84
|
+
- **User-invoked** — reachable only by the human typing the skill (`/launch`). Other skills may point the human at them, but never invoke them through the Skill tool. `launch`, `harbor`, `ask-navigator`, and `architecture-survey` are user-invoked entry points, marked `disable-model-invocation: true` in frontmatter where the harness honors it.
|
|
85
85
|
- **Model-invoked** — reachable by the model when the task fits, and callable by other skills ("call the Skill tool with ..."). `drydock`, `loft`, `minimal-code-discipline`, and `agent-doc-discipline` stay model-invoked.
|
|
86
86
|
|
|
87
87
|
The iron rule: a user-invoked skill never invokes another user-invoked skill. The one deliberate exception is `drydock` — it is a human keel-laying entry point *and* the gate chain's callable audit: launch's yard gate and the navigator's charting mechanically call `drydock --check`, so it must remain model-invoked. The shipyard contract test suite pins the assignment in both directions and rejects skill text that invokes a user-invoked skill by name through the Skill tool.
|
|
@@ -125,7 +125,7 @@ The joins, each named as a gate:
|
|
|
125
125
|
|
|
126
126
|
The cross-cutting express surfaces — **diagram** and **show-me** — are callable from any stage of the circuit; they are express lanes, not stages.
|
|
127
127
|
|
|
128
|
-
Shipyard corrects itself through its file-backed paper trail; `/
|
|
128
|
+
Shipyard corrects itself through its file-backed paper trail; `/drydock --check` audits harness drift. These skills do not add a separate findings store, shipped/wontfixed state machine, hidden ledger, or `sy check`/`context-lint` commands.
|
|
129
129
|
|
|
130
130
|
## Shipyard and the factory
|
|
131
131
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-copilot",
|
|
3
|
-
"version": "5.19.
|
|
3
|
+
"version": "5.19.4",
|
|
4
4
|
"description": "Multi-agent orchestration system for Copilot CLI - Inspired by oh-my-opencode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -168,5 +168,5 @@
|
|
|
168
168
|
"publishConfig": {
|
|
169
169
|
"access": "public"
|
|
170
170
|
},
|
|
171
|
-
"gitHead": "
|
|
171
|
+
"gitHead": "a82acd70d0d317077b271596d3f1ee7923f6b63a"
|
|
172
172
|
}
|
package/plugin.json
CHANGED
|
@@ -14,6 +14,12 @@ const taskDisplayToken = '__OMC_NAMED_WORKFLOW_TASK_DISPLAY__';
|
|
|
14
14
|
const analystPromptToken = '__OMC_NAMED_WORKFLOW_ANALYST_PROMPT__';
|
|
15
15
|
const architectPromptToken = '__OMC_NAMED_WORKFLOW_ARCHITECT_PROMPT__';
|
|
16
16
|
|
|
17
|
+
// Skill slashes differ per host (src/utils/skill-slash.ts): render the prompts
|
|
18
|
+
// under the Claude Code form, then turn each slash into a token the hook
|
|
19
|
+
// resolves for its own host.
|
|
20
|
+
for (const key of ['COPILOT_CLI', 'COPILOT_AGENT_SESSION_ID']) delete process.env[key];
|
|
21
|
+
process.env.CLAUDE_CODE_ENTRYPOINT = 'build-workflow-stage-prompts';
|
|
22
|
+
|
|
17
23
|
function serializeTaskContexts(prompt) {
|
|
18
24
|
const serialized = prompt
|
|
19
25
|
.replaceAll(`**Original Idea:** "${taskToken}"`, `**Original Idea:**\n\n ${taskDisplayToken}`)
|
|
@@ -28,7 +34,7 @@ function serializeTaskContexts(prompt) {
|
|
|
28
34
|
if (serialized.includes(taskToken)) {
|
|
29
35
|
throw new Error("Unclassified named workflow task placeholder in stage prompt");
|
|
30
36
|
}
|
|
31
|
-
return serialized;
|
|
37
|
+
return serialized.replace(/\/oh-my-copilot:([a-z][a-z0-9-]*)/g, '__OMC_SKILL_SLASH_$1__');
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
|
|
@@ -49,11 +55,14 @@ const prompts = Object.fromEntries(stages.map((stage) => [
|
|
|
49
55
|
})),
|
|
50
56
|
]));
|
|
51
57
|
|
|
52
|
-
const generated = `// Generated by scripts/build-workflow-stage-prompts.mjs from the canonical TypeScript stage adapters.\n// Do not edit this file directly.\n\nconst TASK_DISPLAY_TOKEN = ${JSON.stringify(taskDisplayToken)};\nconst ANALYST_PROMPT_TOKEN = ${JSON.stringify(analystPromptToken)};\nconst ARCHITECT_PROMPT_TOKEN = ${JSON.stringify(architectPromptToken)};\nconst PROMPTS = Object.freeze(${JSON.stringify(prompts, null, 2)});\n\nfunction analystPrompt(task) {\n return \`REQUIREMENTS ANALYSIS for: \${task}\\n\\nExtract and document:\\n1. Functional requirements (what it must do)\\n2. Non-functional requirements (performance, UX, etc.)\\n3. Implicit requirements (things user didn't say but needs)\\n4. Out of scope items\\n\\nOutput as structured markdown with clear sections.\`;\n}\n\nfunction architectPrompt(task) {\n return \`TECHNICAL SPECIFICATION for: \${task}\\n\\nBased on the requirements analysis above, create:\\n1. Tech stack decisions with rationale\\n2. Architecture overview (patterns, layers)\\n3. File structure (directory tree)\\n4. Dependencies list (packages)\\n5. API/interface definitions\\n\\nOutput as structured markdown.\`;\n}\n\nexport function resolveCanonicalWorkflowStagePrompt(stageId, task) {\n const prompt = PROMPTS[stageId];\n if (typeof prompt !== 'string' || typeof task !== 'string' || task.trim().length === 0) return null;\n const normalizedTask = task.trim();\n const replacements = {\n [TASK_DISPLAY_TOKEN]: JSON.stringify(normalizedTask),\n [ANALYST_PROMPT_TOKEN]: JSON.stringify(analystPrompt(normalizedTask)),\n [ARCHITECT_PROMPT_TOKEN]: JSON.stringify(architectPrompt(normalizedTask)),\n };\n return prompt.replace(/__OMC_NAMED_WORKFLOW_(?:TASK_DISPLAY|ANALYST_PROMPT|ARCHITECT_PROMPT)__/g, (token) => replacements[token]);\n}\n`;
|
|
58
|
+
const generated = `// Generated by scripts/build-workflow-stage-prompts.mjs from the canonical TypeScript stage adapters.\n// Do not edit this file directly.\n\nimport { skillSlash } from './skill-slash.mjs';\n\nconst TASK_DISPLAY_TOKEN = ${JSON.stringify(taskDisplayToken)};\nconst ANALYST_PROMPT_TOKEN = ${JSON.stringify(analystPromptToken)};\nconst ARCHITECT_PROMPT_TOKEN = ${JSON.stringify(architectPromptToken)};\nconst PROMPTS = Object.freeze(${JSON.stringify(prompts, null, 2)});\n\nfunction analystPrompt(task) {\n return \`REQUIREMENTS ANALYSIS for: \${task}\\n\\nExtract and document:\\n1. Functional requirements (what it must do)\\n2. Non-functional requirements (performance, UX, etc.)\\n3. Implicit requirements (things user didn't say but needs)\\n4. Out of scope items\\n\\nOutput as structured markdown with clear sections.\`;\n}\n\nfunction architectPrompt(task) {\n return \`TECHNICAL SPECIFICATION for: \${task}\\n\\nBased on the requirements analysis above, create:\\n1. Tech stack decisions with rationale\\n2. Architecture overview (patterns, layers)\\n3. File structure (directory tree)\\n4. Dependencies list (packages)\\n5. API/interface definitions\\n\\nOutput as structured markdown.\`;\n}\n\nexport function resolveCanonicalWorkflowStagePrompt(stageId, task) {\n const prompt = PROMPTS[stageId];\n if (typeof prompt !== 'string' || typeof task !== 'string' || task.trim().length === 0) return null;\n const normalizedTask = task.trim();\n const replacements = {\n [TASK_DISPLAY_TOKEN]: JSON.stringify(normalizedTask),\n [ANALYST_PROMPT_TOKEN]: JSON.stringify(analystPrompt(normalizedTask)),\n [ARCHITECT_PROMPT_TOKEN]: JSON.stringify(architectPrompt(normalizedTask)),\n };\n return prompt\n .replace(/__OMC_NAMED_WORKFLOW_(?:TASK_DISPLAY|ANALYST_PROMPT|ARCHITECT_PROMPT)__/g, (token) => replacements[token])\n .replace(/__OMC_SKILL_SLASH_([a-z][a-z0-9-]*)__/g, (_token, name) => skillSlash(name));\n}\n`;
|
|
53
59
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
// Standalone hooks run under Copilot CLI with the skills in the user skills
|
|
61
|
+
// directory, so their copy always resolves the bare name.
|
|
62
|
+
const skillSlashImport = "import { skillSlash } from './skill-slash.mjs';\n";
|
|
63
|
+
for (const [relativePath, content] of [
|
|
64
|
+
['scripts/lib/workflow-stage-prompts.mjs', generated],
|
|
65
|
+
['templates/hooks/lib/workflow-stage-prompts.mjs', generated.replace(skillSlashImport, 'const skillSlash = (name) => `/${name}`;\n')],
|
|
57
66
|
]) {
|
|
58
|
-
writeFileSync(join(root, relativePath),
|
|
67
|
+
writeFileSync(join(root, relativePath), content);
|
|
59
68
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest sequencer that balances `--shard=<i>/<n>` by measured file duration
|
|
3
|
+
* instead of vitest's file-count split, which leaves one shard about twice as
|
|
4
|
+
* long when a few files take minutes. Ordering within a shard (`sort`) is
|
|
5
|
+
* vitest's own. Durations come from `.github/ci/test-durations.json` (repo
|
|
6
|
+
* path to median import plus test ms, refreshed with
|
|
7
|
+
* `scripts/ci/update-test-durations.mjs`);
|
|
8
|
+
* a file without a measurement counts as the median. Without the file the
|
|
9
|
+
* split falls back to vitest's. Stale data only affects balance: every file
|
|
10
|
+
* still lands in exactly one shard.
|
|
11
|
+
*/
|
|
12
|
+
import { readFileSync } from 'node:fs';
|
|
13
|
+
import { join, relative } from 'node:path';
|
|
14
|
+
import { BaseSequencer } from 'vitest/node';
|
|
15
|
+
|
|
16
|
+
export const DURATIONS_PATH = '.github/ci/test-durations.json';
|
|
17
|
+
|
|
18
|
+
/** Load the durations map, or null when it is missing or malformed. */
|
|
19
|
+
export function readDurations(root) {
|
|
20
|
+
try {
|
|
21
|
+
const data = JSON.parse(readFileSync(join(root, DURATIONS_PATH), 'utf8'));
|
|
22
|
+
if (!data || typeof data !== 'object' || Array.isArray(data)) return null;
|
|
23
|
+
return data;
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function median(values) {
|
|
30
|
+
if (values.length === 0) return 1;
|
|
31
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
32
|
+
const mid = Math.floor(sorted.length / 2);
|
|
33
|
+
return sorted.length % 2 ? sorted[mid] : (sorted[mid - 1] + sorted[mid]) / 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Longest-processing-time-first bin packing of `paths` (repo-relative, `/`
|
|
38
|
+
* separators) into `count` shards. Deterministic for a given input set:
|
|
39
|
+
* every shard computes the same assignment and keeps its own 1-based `index`.
|
|
40
|
+
*/
|
|
41
|
+
export function assignShards(paths, durations, count) {
|
|
42
|
+
const known = paths.map((p) => durations[p]).filter((ms) => Number.isFinite(ms) && ms >= 0);
|
|
43
|
+
const fallback = median(known);
|
|
44
|
+
const weighted = paths.map((path) => {
|
|
45
|
+
const ms = durations[path];
|
|
46
|
+
return { path, ms: Number.isFinite(ms) && ms >= 0 ? ms : fallback };
|
|
47
|
+
});
|
|
48
|
+
weighted.sort((a, b) => b.ms - a.ms || (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
|
|
49
|
+
const shards = Array.from({ length: count }, () => ({ ms: 0, paths: [] }));
|
|
50
|
+
for (const file of weighted) {
|
|
51
|
+
let target = shards[0];
|
|
52
|
+
for (const shard of shards) if (shard.ms < target.ms) target = shard;
|
|
53
|
+
target.ms += file.ms;
|
|
54
|
+
target.paths.push(file.path);
|
|
55
|
+
}
|
|
56
|
+
return shards;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export default class DurationSequencer extends BaseSequencer {
|
|
60
|
+
async shard(specs) {
|
|
61
|
+
const { root, shard } = this.ctx.config;
|
|
62
|
+
const durations = readDurations(root);
|
|
63
|
+
if (!durations) return super.shard(specs);
|
|
64
|
+
const keyOf = (spec) => relative(root, spec.moduleId).replace(/\\/g, '/');
|
|
65
|
+
const shards = assignShards([...new Set(specs.map(keyOf))], durations, shard.count);
|
|
66
|
+
const mine = new Set(shards[shard.index - 1].paths);
|
|
67
|
+
return specs.filter((spec) => mine.has(keyOf(spec)));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest reporter that writes each test file's cost to the file named by
|
|
3
|
+
* `--outputFile.durations=<path>`: repo-relative path to whole ms of import
|
|
4
|
+
* (collect plus setup files) and test time, the share of a worker the file
|
|
5
|
+
* occupies. CI's Test job runs it over the merged shard reports; feed its
|
|
6
|
+
* output to scripts/ci/update-test-durations.mjs. Without the option it
|
|
7
|
+
* writes nothing.
|
|
8
|
+
*/
|
|
9
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
10
|
+
import { dirname, resolve } from 'node:path';
|
|
11
|
+
|
|
12
|
+
export default class DurationsReporter {
|
|
13
|
+
durations = {};
|
|
14
|
+
|
|
15
|
+
onInit(ctx) {
|
|
16
|
+
this.ctx = ctx;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Per module, not from onTestRunEnd's list: a merged blob from another
|
|
20
|
+
// machine keeps its runner's absolute paths, which that list drops.
|
|
21
|
+
onTestModuleEnd(module) {
|
|
22
|
+
const { collectDuration, setupDuration, duration } = module.diagnostic();
|
|
23
|
+
this.durations[module.relativeModuleId.replace(/\\/g, '/')] = Math.round(collectDuration + setupDuration + duration);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
onTestRunEnd() {
|
|
27
|
+
const { outputFile, root } = this.ctx.config;
|
|
28
|
+
const out = typeof outputFile === 'object' ? outputFile?.durations : undefined;
|
|
29
|
+
if (!out) return;
|
|
30
|
+
const target = resolve(root, out);
|
|
31
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
32
|
+
writeFileSync(target, `${JSON.stringify(this.durations, null, 2)}\n`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Tree-hash evidence lookup: has this exact git tree already passed a full
|
|
4
|
+
* ci.yml run? Read-only (GITHUB_TOKEN with actions: read); nothing is posted.
|
|
5
|
+
*
|
|
6
|
+
* A CI run is evidence for tree T only when all of these hold:
|
|
7
|
+
* - it is a run of .github/workflows/ci.yml in this repository, on a commit
|
|
8
|
+
* whose tree is T and that is HEAD or a same-tree ancestor of HEAD;
|
|
9
|
+
* - its event is push, or pull_request from a branch of this repository
|
|
10
|
+
* (never a fork);
|
|
11
|
+
* - it is under MAX_AGE_DAYS old;
|
|
12
|
+
* - every job of its latest attempt concluded success (NOT_EVIDENCE_JOBS
|
|
13
|
+
* aside), so a run that itself reused evidence never counts;
|
|
14
|
+
* - its CI Gate job log carries `ci-evidence v1 tree=T`, the tree the run
|
|
15
|
+
* checked out (for a pull_request run, the merge commit's tree).
|
|
16
|
+
* Any error or doubt means no reuse: the jobs run.
|
|
17
|
+
*
|
|
18
|
+
* ci.yml runs this file from a trusted tree (a PR's base commit, a pushed
|
|
19
|
+
* dev/main commit, a tag on main), never from the tree under test, which it
|
|
20
|
+
* names with --sha. A commit missing from the local clone (a PR's merge
|
|
21
|
+
* commit) has its tree read from the API.
|
|
22
|
+
*/
|
|
23
|
+
import { execFileSync } from 'node:child_process';
|
|
24
|
+
import { appendFileSync } from 'node:fs';
|
|
25
|
+
import { pathToFileURL } from 'node:url';
|
|
26
|
+
|
|
27
|
+
export const WORKFLOW_PATH = '.github/workflows/ci.yml';
|
|
28
|
+
export const TRUSTED_EVENTS = ['push', 'pull_request'];
|
|
29
|
+
export const MAX_AGE_DAYS = 14;
|
|
30
|
+
/** Jobs whose result says nothing about the tree: advisory, tag-only, and this lookup. */
|
|
31
|
+
export const NOT_EVIDENCE_JOBS = ['No Committed Build Artifacts', 'Create GitHub Release', 'Tree evidence', 'Release tree evidence'];
|
|
32
|
+
/** A run missing any of these did not run the gate (the ruleset checks plus the aggregator). */
|
|
33
|
+
export const REQUIRED_JOBS = ['CI Gate', 'Lint & Type Check', 'Build', 'Test', 'Version Consistency Check'];
|
|
34
|
+
const MAX_COMMITS = 6;
|
|
35
|
+
const MAX_RUNS = 10;
|
|
36
|
+
const SHA = /^[0-9a-f]{40}$/;
|
|
37
|
+
const EVIDENCE_LINE = /^\d{4}-\d\d-\d\dT[\d:.]+Z ci-evidence v1 tree=(\S*)\r?$/gm;
|
|
38
|
+
|
|
39
|
+
/** GitHub REST client; `fetchImpl` is injectable for tests. */
|
|
40
|
+
export function createApi({ repo, token, fetchImpl = fetch, apiUrl = 'https://api.github.com' }) {
|
|
41
|
+
const headers = { accept: 'application/vnd.github+json', authorization: `Bearer ${token}`, 'x-github-api-version': '2022-11-28' };
|
|
42
|
+
return {
|
|
43
|
+
async json(path) {
|
|
44
|
+
const res = await fetchImpl(`${apiUrl}/repos/${repo}/${path}`, { headers });
|
|
45
|
+
if (!res.ok) throw new Error(`GET ${path}: HTTP ${res.status}`);
|
|
46
|
+
return res.json();
|
|
47
|
+
},
|
|
48
|
+
/** Job logs redirect to blob storage; follow by hand so the token never leaves api.github.com. */
|
|
49
|
+
async jobLog(jobId) {
|
|
50
|
+
const res = await fetchImpl(`${apiUrl}/repos/${repo}/actions/jobs/${jobId}/logs`, { headers, redirect: 'manual' });
|
|
51
|
+
const location = res.headers.get('location');
|
|
52
|
+
if (res.status >= 300 && res.status < 400 && location) {
|
|
53
|
+
const blob = await fetchImpl(location);
|
|
54
|
+
if (!blob.ok) throw new Error(`job ${jobId} log: HTTP ${blob.status}`);
|
|
55
|
+
return blob.text();
|
|
56
|
+
}
|
|
57
|
+
if (!res.ok) throw new Error(`job ${jobId} log: HTTP ${res.status}`);
|
|
58
|
+
return res.text();
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** HEAD plus its ancestors with the same tree (merge commits whose content one parent already had). */
|
|
64
|
+
export async function sameTreeCommits(api, sha, tree) {
|
|
65
|
+
const found = [];
|
|
66
|
+
const queue = [sha];
|
|
67
|
+
const seen = new Set();
|
|
68
|
+
while (queue.length > 0 && found.length < MAX_COMMITS) {
|
|
69
|
+
const next = queue.shift();
|
|
70
|
+
if (seen.has(next)) continue;
|
|
71
|
+
seen.add(next);
|
|
72
|
+
const commit = await api.json(`commits/${next}`);
|
|
73
|
+
if (commit?.sha !== next || commit?.commit?.tree?.sha !== tree) continue;
|
|
74
|
+
found.push(next);
|
|
75
|
+
for (const parent of commit.parents ?? []) if (SHA.test(parent?.sha ?? '')) queue.push(parent.sha);
|
|
76
|
+
}
|
|
77
|
+
return found;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Why `run` is not evidence for `tree` at `sha`, or null when it is. */
|
|
81
|
+
export async function rejectRun(api, run, { repo, sha, tree, now, currentRunId }) {
|
|
82
|
+
if (String(run.id) === String(currentRunId)) return 'this run';
|
|
83
|
+
if (run.path !== WORKFLOW_PATH) return `workflow ${run.path}`;
|
|
84
|
+
if (run.head_sha !== sha) return `head ${run.head_sha}`;
|
|
85
|
+
if (!TRUSTED_EVENTS.includes(run.event)) return `event ${run.event}`;
|
|
86
|
+
if (run.repository?.full_name !== repo || run.head_repository?.full_name !== repo) return `head repository ${run.head_repository?.full_name}`;
|
|
87
|
+
const age = now - Date.parse(run.created_at);
|
|
88
|
+
if (!(age >= 0 && age <= MAX_AGE_DAYS * 86_400_000)) return `created ${run.created_at}`;
|
|
89
|
+
const jobs = (await api.json(`actions/runs/${run.id}/jobs?filter=latest&per_page=100`)).jobs ?? [];
|
|
90
|
+
const missing = REQUIRED_JOBS.filter((name) => !jobs.some((j) => j.name === name));
|
|
91
|
+
if (missing.length > 0) return `no job ${missing.join(', ')}`;
|
|
92
|
+
const notGreen = jobs.filter((j) => !NOT_EVIDENCE_JOBS.includes(j.name) && j.conclusion !== 'success');
|
|
93
|
+
if (notGreen.length > 0) return `${notGreen.map((j) => `${j.name}: ${j.conclusion ?? j.status}`).join(', ')}`;
|
|
94
|
+
const gate = jobs.filter((j) => j.name === 'CI Gate');
|
|
95
|
+
if (gate.length !== 1) return `${gate.length} CI Gate jobs`;
|
|
96
|
+
const trees = [...(await api.jobLog(gate[0].id)).matchAll(EVIDENCE_LINE)].map((m) => m[1]);
|
|
97
|
+
if (trees.length !== 1 || trees[0] !== tree) return `CI Gate recorded tree ${trees.join(', ') || 'none'}`;
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** First run that proves `tree`, as { reused, runUrl, sha, considered[] }. */
|
|
102
|
+
export async function findEvidence(api, { repo, sha, tree, now = Date.now(), currentRunId = '' }) {
|
|
103
|
+
const considered = [];
|
|
104
|
+
let examined = 0;
|
|
105
|
+
for (const candidate of await sameTreeCommits(api, sha, tree)) {
|
|
106
|
+
const runs = (await api.json(`actions/workflows/ci.yml/runs?head_sha=${candidate}&per_page=20`)).workflow_runs ?? [];
|
|
107
|
+
for (const run of [...runs].sort((a, b) => b.id - a.id)) {
|
|
108
|
+
if (examined >= MAX_RUNS) return { reused: false, considered };
|
|
109
|
+
if (String(run.id) !== String(currentRunId)) examined += 1;
|
|
110
|
+
const reason = await rejectRun(api, run, { repo, sha: candidate, tree, now, currentRunId });
|
|
111
|
+
if (reason === null) return { reused: true, runUrl: run.html_url, sha: candidate, considered };
|
|
112
|
+
considered.push(`${run.html_url ?? run.id} (${candidate.slice(0, 12)}): ${reason}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return { reused: false, considered };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function out(file, lines) {
|
|
119
|
+
if (file) appendFileSync(file, `${lines.join('\n')}\n`);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export async function cliMain({ env = process.env, argv = process.argv.slice(2), fetchImpl = fetch, log = console.log } = {}) {
|
|
123
|
+
const shaArg = argv[0] === '--sha' ? argv[1] : undefined;
|
|
124
|
+
let tree = '';
|
|
125
|
+
let result = { reused: false, considered: [] };
|
|
126
|
+
let note = '';
|
|
127
|
+
try {
|
|
128
|
+
const git = (args) => execFileSync('git', args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }).trim();
|
|
129
|
+
const sha = shaArg ?? git(['rev-parse', 'HEAD']);
|
|
130
|
+
if (!SHA.test(sha)) throw new Error(`bad commit ${sha}`);
|
|
131
|
+
const repo = env.GITHUB_REPOSITORY;
|
|
132
|
+
const api = createApi({ repo, token: env.GITHUB_TOKEN, fetchImpl, apiUrl: env.GITHUB_API_URL });
|
|
133
|
+
let tested;
|
|
134
|
+
try {
|
|
135
|
+
tested = git(['rev-parse', '--verify', '--quiet', `${sha}^{tree}`]);
|
|
136
|
+
} catch {
|
|
137
|
+
const commit = await api.json(`commits/${sha}`);
|
|
138
|
+
tested = commit?.sha === sha ? commit?.commit?.tree?.sha : undefined;
|
|
139
|
+
}
|
|
140
|
+
if (!SHA.test(tested ?? '')) throw new Error(`bad tree ${tested}`);
|
|
141
|
+
tree = tested;
|
|
142
|
+
log(`tested tree ${tree} (commit ${sha})`);
|
|
143
|
+
if (env.CI_EVIDENCE_REUSE === 'false') {
|
|
144
|
+
note = 'reuse disabled (CI_EVIDENCE_REUSE=false)';
|
|
145
|
+
} else {
|
|
146
|
+
result = await findEvidence(api, { repo, sha, tree, currentRunId: env.GITHUB_RUN_ID });
|
|
147
|
+
}
|
|
148
|
+
} catch (error) {
|
|
149
|
+
note = `lookup failed, running the jobs: ${error instanceof Error ? error.message : String(error)}`;
|
|
150
|
+
result = { reused: false, considered: result.considered };
|
|
151
|
+
}
|
|
152
|
+
for (const line of result.considered) log(` not evidence: ${line}`);
|
|
153
|
+
if (result.reused) {
|
|
154
|
+
log(`::notice title=Tree evidence::tests reused from run ${result.runUrl}: it passed tree ${tree} on ${result.sha}`);
|
|
155
|
+
out(env.GITHUB_STEP_SUMMARY, [`### Tree evidence`, ``, `Tree \`${tree}\` already passed every job in ${result.runUrl} (commit \`${result.sha}\`). The jobs it proves are skipped.`]);
|
|
156
|
+
} else {
|
|
157
|
+
log(`no evidence for tree ${tree || '(unknown)'}${note ? `: ${note}` : ''}; the jobs run`);
|
|
158
|
+
out(env.GITHUB_STEP_SUMMARY, [`### Tree evidence`, ``, `No reusable run for tree \`${tree || 'unknown'}\`${note ? ` (${note})` : ''}. The jobs run.`]);
|
|
159
|
+
}
|
|
160
|
+
out(env.GITHUB_OUTPUT, [`tree=${tree}`, `reused=${result.reused}`, `run_url=${result.reused ? result.runUrl : ''}`]);
|
|
161
|
+
return result;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
165
|
+
await cliMain();
|
|
166
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Refresh .github/ci/test-durations.json from durations reports of FULL runs
|
|
4
|
+
* (`test-durations.json` in the `vitest-report` artifact of CI's Test job,
|
|
5
|
+
* written by scripts/ci/durations-reporter.mjs: repo path to import plus
|
|
6
|
+
* test ms). Each file's value is the median across the given reports, in
|
|
7
|
+
* whole ms; files absent from every report are dropped. Stale data only
|
|
8
|
+
* affects shard balance (scripts/ci/duration-sequencer.mjs), never which
|
|
9
|
+
* tests run.
|
|
10
|
+
*
|
|
11
|
+
* Run: node scripts/ci/update-test-durations.mjs [--root <dir>] [--out <file>] <test-durations.json>...
|
|
12
|
+
*/
|
|
13
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
14
|
+
import { isAbsolute, relative, resolve } from 'node:path';
|
|
15
|
+
import { pathToFileURL } from 'node:url';
|
|
16
|
+
import { DURATIONS_PATH, median } from './duration-sequencer.mjs';
|
|
17
|
+
|
|
18
|
+
const USAGE = 'usage: update-test-durations.mjs [--root <dir>] [--out <file>] <test-durations.json>...';
|
|
19
|
+
|
|
20
|
+
/** Map repo-relative test path to median ms over `reports` (parsed durations reports). */
|
|
21
|
+
export function durationsFromReports(reports) {
|
|
22
|
+
const samples = new Map();
|
|
23
|
+
for (const report of reports) {
|
|
24
|
+
if (!report || typeof report !== 'object' || Array.isArray(report)) {
|
|
25
|
+
throw new Error('not a durations report: expected an object of test path to ms');
|
|
26
|
+
}
|
|
27
|
+
for (const [name, ms] of Object.entries(report)) {
|
|
28
|
+
const path = name.replace(/\\/g, '/');
|
|
29
|
+
if (!Number.isFinite(ms) || ms < 0 || isAbsolute(path) || path.startsWith('../')) continue;
|
|
30
|
+
samples.set(path, [...(samples.get(path) ?? []), ms]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return Object.fromEntries([...samples.keys()].sort().map((path) => [path, Math.round(median(samples.get(path)))]));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function main(argv) {
|
|
37
|
+
let root = process.cwd();
|
|
38
|
+
let out;
|
|
39
|
+
const files = [];
|
|
40
|
+
for (let i = 0; i < argv.length; i++) {
|
|
41
|
+
if (argv[i] === '--root' || argv[i] === '--out') {
|
|
42
|
+
const value = argv[++i];
|
|
43
|
+
if (value === undefined) {
|
|
44
|
+
console.error(USAGE);
|
|
45
|
+
return 2;
|
|
46
|
+
}
|
|
47
|
+
if (argv[i - 1] === '--root') root = resolve(value);
|
|
48
|
+
else out = value;
|
|
49
|
+
} else files.push(argv[i]);
|
|
50
|
+
}
|
|
51
|
+
if (files.length === 0) {
|
|
52
|
+
console.error(USAGE);
|
|
53
|
+
return 2;
|
|
54
|
+
}
|
|
55
|
+
const durations = durationsFromReports(files.map((f) => JSON.parse(readFileSync(f, 'utf8'))));
|
|
56
|
+
const target = resolve(root, out ?? DURATIONS_PATH);
|
|
57
|
+
writeFileSync(target, `${JSON.stringify(durations, null, 2)}\n`);
|
|
58
|
+
console.log(`wrote ${Object.keys(durations).length} file durations to ${relative(root, target).replace(/\\/g, '/')}`);
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) process.exitCode = main(process.argv.slice(2));
|
|
@@ -82,6 +82,9 @@ const { transform, parseHookOutput, writeAllSync } = require('../lib/copilot-hoo
|
|
|
82
82
|
const { normalizeHookPayload } = require('../lib/copilot-payload.cjs');
|
|
83
83
|
const { getCopilotConfigDir } = require('../lib/config-dir.cjs');
|
|
84
84
|
const { isChildSessionPayload } = require('../lib/child-session.cjs');
|
|
85
|
+
const { hardenWindowsExeSearch } = require('../lib/windows-search.cjs');
|
|
86
|
+
|
|
87
|
+
hardenWindowsExeSearch();
|
|
85
88
|
|
|
86
89
|
const SCRIPTS_DIR = path.join(__dirname, '..');
|
|
87
90
|
const RUN_CJS = path.join(SCRIPTS_DIR, 'run.cjs');
|
package/scripts/find-node.sh
CHANGED
|
@@ -145,7 +145,7 @@ fi
|
|
|
145
145
|
# Invoke node with all provided arguments
|
|
146
146
|
# ---------------------------------------------------------------------------
|
|
147
147
|
if [ -z "$NODE_BIN" ]; then
|
|
148
|
-
printf '[OMC] Error: Could not find node binary. Run /oh-my-copilot:omc-setup to fix.\n' >&2
|
|
148
|
+
printf '[OMC] Error: Could not find node binary. Run /omc-setup (Claude Code: /oh-my-copilot:omc-setup) to fix.\n' >&2
|
|
149
149
|
exit 0 # exit 0 so this hook does not block Claude Code
|
|
150
150
|
fi
|
|
151
151
|
|
|
@@ -34,6 +34,7 @@ import { parseWorkflowInvocation, selectWorkflowProfile, createWorkflowState, is
|
|
|
34
34
|
import { isJevShadowOptedIn, recordJevShadow } from './lib/jev-shadow.mjs';
|
|
35
35
|
import { initializeRalphStateForSkill, createPrdScaffold } from './lib/ralph-startup.mjs';
|
|
36
36
|
import { isCopilotHookHost } from './lib/hook-host.mjs';
|
|
37
|
+
import { skillSlash } from './lib/skill-slash.mjs';
|
|
37
38
|
import { isCopilotSubagentKickoffPrompt, isOmcContinuationPrompt } from './lib/copilot-continuation.mjs';
|
|
38
39
|
|
|
39
40
|
// Resolve OMC package root: CLAUDE_PLUGIN_ROOT (plugin system) or derive from this script's location
|
|
@@ -452,7 +453,7 @@ const QUESTION_FOLLOWUP_PATTERNS = [
|
|
|
452
453
|
// recognized block header. They must be stripped only in that context —
|
|
453
454
|
// never standalone — because a user might legitimately start a prompt with
|
|
454
455
|
// "Task: …" or similar (Codex automated review P1/P2 on #2795).
|
|
455
|
-
const ECHO_CONTINUATION = '(?:\\r?\\n[ \\t]*(?:Task:\\s|(?:Claude \\/goal objective|Goal objective|Missing evidence|No OMG goal record yet):\\s|When FULLY complete \\(after Architect verification\\)|run\\s+\\/oh-my-copilot:cancel).*)*';
|
|
456
|
+
const ECHO_CONTINUATION = '(?:\\r?\\n[ \\t]*(?:Task:\\s|(?:Claude \\/goal objective|Goal objective|Missing evidence|No OMG goal record yet):\\s|When FULLY complete \\(after Architect verification\\)|run\\s+\\/(?:oh-my-copilot:)?cancel).*)*';
|
|
456
457
|
|
|
457
458
|
// NOTE: each pattern is a SINGLE LOGICAL BLOCK: the block header line +
|
|
458
459
|
// zero-or-more continuation lines that hooks emit right after it. The whole
|
|
@@ -491,7 +492,7 @@ const SYSTEM_ECHO_BLOCK_PATTERNS = [
|
|
|
491
492
|
// All patterns use `i` because hasActionableKeyword sees a lowercased prompt.
|
|
492
493
|
const SYSTEM_ECHO_SIGNATURES = [
|
|
493
494
|
/\bWhen FULLY complete \(after Architect verification\)\b/i,
|
|
494
|
-
/\brun\s+\/oh-my-copilot:cancel\b/i,
|
|
495
|
+
/\brun\s+\/(?:oh-my-copilot:)?cancel\b/i,
|
|
495
496
|
/\[RALPH LOOP\s*-\s*ITERATION\b/i,
|
|
496
497
|
];
|
|
497
498
|
|
|
@@ -1713,7 +1714,7 @@ Arguments: ${args}` : '';
|
|
|
1713
1714
|
return `[MAGIC KEYWORD: ${skillName.toUpperCase()}]
|
|
1714
1715
|
|
|
1715
1716
|
Skill routing detected: ${skillName}
|
|
1716
|
-
Preferred invocation:
|
|
1717
|
+
Preferred invocation: ${skillSlash(skillName)}${args ? ` ${args}` : ''}
|
|
1717
1718
|
${pathStatus}${argsSection}${ralphLoopNotice ? `
|
|
1718
1719
|
|
|
1719
1720
|
${ralphLoopNotice}` : ''}
|
|
@@ -1740,7 +1741,7 @@ function createMultiSkillInvocation(skills, originalPrompt, directory = '') {
|
|
|
1740
1741
|
? `Read fallback: ${skillPath}`
|
|
1741
1742
|
: `Read fallback: locate skills/${s.name}/SKILL.md in the active oh-my-copilot plugin/install`;
|
|
1742
1743
|
return `### Skill ${i + 1}: ${s.name.toUpperCase()}
|
|
1743
|
-
Preferred invocation:
|
|
1744
|
+
Preferred invocation: ${skillSlash(s.name)}${argsText}
|
|
1744
1745
|
${pathStatus}`;
|
|
1745
1746
|
}).join('\n\n');
|
|
1746
1747
|
// Multi-skill routing (e.g. `/ralph deep-interview`) must carry the same
|
|
@@ -46,6 +46,9 @@
|
|
|
46
46
|
|
|
47
47
|
const fs = require('fs');
|
|
48
48
|
const path = require('path');
|
|
49
|
+
const { hardenWindowsExeSearch } = require('./windows-search.cjs');
|
|
50
|
+
|
|
51
|
+
hardenWindowsExeSearch();
|
|
49
52
|
|
|
50
53
|
const STDERR_TAIL_BYTES = 4096;
|
|
51
54
|
const STOP_EVENTS = new Set(['Stop', 'SubagentStop']);
|
|
@@ -245,9 +245,9 @@ async function main() {
|
|
|
245
245
|
console.log(`[OMC HUD] Plugin HUD load failed${detail}. Run: cd "${pluginCacheDir}" && npm install && npm run build`);
|
|
246
246
|
}
|
|
247
247
|
} else if (existsSync(pluginCacheBase)) {
|
|
248
|
-
console.log(`[OMC HUD] Plugin cache found but no versions installed. Run: /oh-my-copilot:omc-setup`);
|
|
248
|
+
console.log(`[OMC HUD] Plugin cache found but no versions installed. Run: /omc-setup (Claude Code: /oh-my-copilot:omc-setup)`);
|
|
249
249
|
} else {
|
|
250
|
-
console.log("[OMC HUD] Plugin not installed. Run: /oh-my-copilot:omc-setup");
|
|
250
|
+
console.log("[OMC HUD] Plugin not installed. Run: /omc-setup (Claude Code: /oh-my-copilot:omc-setup)");
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook-script twin of src/utils/skill-slash.ts: the slash command the running
|
|
3
|
+
* host resolves for a bundled skill. Copilot CLI registers plugin skills by
|
|
4
|
+
* their bare name (`/cancel`) and rejects `/oh-my-copilot:cancel`; Claude Code
|
|
5
|
+
* registers them as `/oh-my-copilot:<name>`. The host comes from hook-host.mjs.
|
|
6
|
+
*/
|
|
7
|
+
import { isCopilotHookHost } from './hook-host.mjs';
|
|
8
|
+
|
|
9
|
+
export function skillSlash(name, env = process.env) {
|
|
10
|
+
return isCopilotHookHost(env) ? `/${name}` : `/oh-my-copilot:${name}`;
|
|
11
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* Windows executable search hardening (CJS hook/script runtime).
|
|
4
|
+
*
|
|
5
|
+
* Without NoDefaultCurrentDirectoryInExePath, Windows looks up a bare command
|
|
6
|
+
* name (`git`, `npm`) in the current directory before PATH, so an executable
|
|
7
|
+
* planted in the project folder runs. Entry points call
|
|
8
|
+
* hardenWindowsExeSearch() first; explicit child envs go through childEnv().
|
|
9
|
+
* Imports evaluate before the entry's call, so nothing an entry point imports
|
|
10
|
+
* may spawn at module-load time.
|
|
11
|
+
*
|
|
12
|
+
* Multi-surface mirrors (keep in sync):
|
|
13
|
+
* src/utils/windows-search.ts — TypeScript runtime (source of truth)
|
|
14
|
+
* scripts/lib/windows-search.mjs — ESM re-export of this file
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const VARIABLE = 'NoDefaultCurrentDirectoryInExePath';
|
|
18
|
+
|
|
19
|
+
function isVariable(key) {
|
|
20
|
+
return key.toUpperCase() === VARIABLE.toUpperCase();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function hardenWindowsExeSearch() {
|
|
24
|
+
if (process.platform !== 'win32') return;
|
|
25
|
+
for (const key of Object.keys(process.env)) {
|
|
26
|
+
if (isVariable(key)) delete process.env[key];
|
|
27
|
+
}
|
|
28
|
+
process.env[VARIABLE] = '1';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function childEnv(env) {
|
|
32
|
+
const out = {};
|
|
33
|
+
for (const [key, value] of Object.entries(env)) {
|
|
34
|
+
if (process.platform !== 'win32' || !isVariable(key)) out[key] = value;
|
|
35
|
+
}
|
|
36
|
+
if (process.platform === 'win32') out[VARIABLE] = '1';
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = { hardenWindowsExeSearch, childEnv };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windows executable search hardening (ESM runtime): re-exports
|
|
3
|
+
* scripts/lib/windows-search.cjs so both module systems share one copy.
|
|
4
|
+
* Source of truth: src/utils/windows-search.ts.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { hardenWindowsExeSearch, childEnv } from './windows-search.cjs';
|