ultra-builder-pro-cli 0.25.1 → 0.26.1
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/.ultra-template/changes/abandoned/.gitkeep +0 -0
- package/.ultra-template/contexts/TEMPLATE.md +94 -0
- package/.ultra-template/decisions/.gitkeep +1 -0
- package/.ultra-template/evidence/.gitkeep +1 -0
- package/.ultra-template/north-star.md +46 -0
- package/.ultra-template/research/.gitkeep +1 -0
- package/.ultra-template/specs/discovery.md +2 -2
- package/.ultra-template/tasks.json +3 -0
- package/.ultra-template/test-report.json +27 -0
- package/CHANGELOG.md +107 -1
- package/README.md +217 -579
- package/adapters/_shared/delegate-profiles/kimi-read-only.md +15 -0
- package/adapters/_shared/delegate-profiles/kimi-write.md +17 -0
- package/adapters/_shared/file-ops.cjs +76 -2
- package/adapters/_shared/host-profile.cjs +97 -0
- package/adapters/_shared/plugin-core.cjs +204 -0
- package/adapters/_shared/runtime-assets.cjs +31 -96
- package/adapters/claude.js +92 -291
- package/adapters/codex.js +309 -842
- package/adapters/grok.js +143 -1469
- package/adapters/kimi.js +124 -1053
- package/adapters/opencode.js +230 -742
- package/bin/delegate-worker.cjs +328 -0
- package/bin/delegate.cjs +463 -0
- package/bin/install.js +38 -11
- package/docs/ARCHITECTURE.md +125 -216
- package/docs/ARTIFACT-AUTHORITY.md +90 -268
- package/docs/DECISIONS.md +77 -87
- package/docs/PHILOSOPHY.md +208 -0
- package/docs/PLUGIN-ISOLATION-CONTRACT.md +65 -39
- package/docs/RUNTIME-COMPAT-MATRIX.md +140 -155
- package/docs/SKILL-AUTHORING.md +94 -73
- package/docs/WORKFLOW-LIFECYCLE.md +97 -189
- package/hooks/README.md +19 -37
- package/hooks/_common.py +113 -0
- package/hooks/adapters/codex.py +9 -16
- package/hooks/adapters/grok.py +5 -5
- package/hooks/adapters/kimi.py +8 -14
- package/hooks/block_dangerous_commands.py +201 -0
- package/hooks/compact_context.py +65 -0
- package/hooks/mid_workflow_recall.py +25 -0
- package/hooks/post_edit_guard.py +105 -0
- package/hooks/session_context.py +30 -0
- package/package.json +17 -52
- package/skills/ultra-change/SKILL.md +115 -50
- package/skills/ultra-change/references/change-contract.md +68 -3
- package/skills/ultra-delegate/SKILL.md +89 -0
- package/skills/ultra-delegate/references/delegation-contract.md +59 -0
- package/skills/ultra-delegate/scripts/delegate_wait.py +86 -0
- package/skills/ultra-deliver/SKILL.md +98 -42
- package/skills/ultra-deliver/references/baseline-reconciliation.md +39 -20
- package/skills/ultra-dev/SKILL.md +115 -62
- package/skills/ultra-dev/references/debugging.md +22 -0
- package/skills/ultra-domain-modeling/SKILL.md +79 -0
- package/skills/ultra-grilling/SKILL.md +118 -0
- package/skills/ultra-grilling/references/reframing.md +72 -0
- package/skills/ultra-init/SKILL.md +102 -37
- package/skills/ultra-init/references/brownfield-adoption.md +33 -83
- package/skills/ultra-init/scripts/init_project.cjs +84 -0
- package/skills/ultra-plan/SKILL.md +101 -68
- package/skills/ultra-research/SKILL.md +68 -48
- package/skills/ultra-research/references/00-problem-validation.md +5 -5
- package/skills/ultra-research/references/01-opportunity-discovery.md +3 -3
- package/skills/ultra-research/references/02-market-assessment.md +5 -4
- package/skills/ultra-research/references/03-competitive-landscape.md +3 -3
- package/skills/ultra-research/references/04-product-strategy.md +3 -3
- package/skills/ultra-research/references/05-assumptions-validation.md +5 -5
- package/skills/ultra-research/references/10-user-personas.md +3 -2
- package/skills/ultra-research/references/11-user-scenarios.md +3 -3
- package/skills/ultra-research/references/20-user-stories.md +4 -3
- package/skills/ultra-research/references/21-features-scope.md +3 -2
- package/skills/ultra-research/references/22-success-metrics.md +3 -3
- package/skills/ultra-research/references/30-architecture-context.md +3 -3
- package/skills/ultra-research/references/31-solution-strategy.md +3 -3
- package/skills/ultra-research/references/32-building-blocks.md +3 -3
- package/skills/ultra-research/references/40-deployment.md +3 -3
- package/skills/ultra-research/references/41-quality-risks.md +3 -3
- package/skills/ultra-research/references/99-synthesis.md +7 -7
- package/skills/ultra-review/SKILL.md +84 -32
- package/skills/ultra-review/references/code.md +17 -0
- package/skills/ultra-review/references/comments.md +12 -0
- package/skills/ultra-review/references/design.md +12 -0
- package/skills/ultra-review/references/errors.md +13 -0
- package/skills/ultra-review/references/spec.md +13 -0
- package/skills/ultra-review/references/tests.md +12 -0
- package/skills/ultra-review/references/worker-packet.md +40 -0
- package/skills/ultra-review/scripts/review_wait.py +26 -15
- package/skills/ultra-status/SKILL.md +61 -36
- package/skills/ultra-tdd/SKILL.md +81 -0
- package/skills/ultra-tdd/references/templates/README.md +20 -0
- package/skills/ultra-tdd/references/templates/feature-flag-default-audit.sh +79 -0
- package/skills/ultra-tdd/references/templates/persistence-real.ts +78 -0
- package/skills/ultra-tdd/references/templates/testcontainer-postgres.py +78 -0
- package/skills/ultra-tdd/references/templates/testcontainer-postgres.ts +73 -0
- package/skills/ultra-tdd/references/templates/vertical-slice.ts +66 -0
- package/skills/ultra-tdd/references/test-execution.md +18 -0
- package/skills/ultra-test/SKILL.md +75 -30
- package/skills/ultra-test/references/export-syntax.md +18 -0
- package/skills/ultra-test/scripts/worktree_digest.cjs +54 -0
- package/skills/ultra-think/SKILL.md +49 -27
- package/skills/ultra-think/references/autonomy-boundary.md +48 -0
- package/skills/ultra-think/references/interaction-boundary.md +18 -33
- package/.ultra-template/docs/research/README.md +0 -55
- package/.ultra-template/reports/templates/delivery-report.json +0 -17
- package/.ultra-template/reports/templates/test-report.json +0 -18
- package/.ultra-template/tasks/tasks.json +0 -15
- package/.ultra-template/templates/task-context.md +0 -19
- package/adapters/_shared/codex-assets.cjs +0 -725
- package/adapters/_shared/codex-ultra-tools-entry.cjs +0 -11
- package/adapters/_shared/interaction-contract.cjs +0 -129
- package/adapters/_shared/path-rewrite.cjs +0 -79
- package/adapters/_shared/runtime-native.cjs +0 -132
- package/adapters/_shared/settings-merge.cjs +0 -76
- package/agents/code-reviewer.md +0 -42
- package/agents/debugger.md +0 -40
- package/agents/review-code.md +0 -49
- package/agents/review-comments.md +0 -38
- package/agents/review-coordinator.md +0 -56
- package/agents/review-design.md +0 -40
- package/agents/review-errors.md +0 -43
- package/agents/review-spec.md +0 -39
- package/agents/review-tests.md +0 -40
- package/agents/tdd-runner.md +0 -38
- package/bin/orchestrator.js +0 -383
- package/commands/ultra-change.md +0 -10
- package/commands/ultra-deliver.md +0 -10
- package/commands/ultra-dev.md +0 -10
- package/commands/ultra-doctor.md +0 -10
- package/commands/ultra-init.md +0 -10
- package/commands/ultra-plan.md +0 -10
- package/commands/ultra-research.md +0 -10
- package/commands/ultra-review.md +0 -10
- package/commands/ultra-status.md +0 -10
- package/commands/ultra-test.md +0 -10
- package/commands/ultra-think.md +0 -10
- package/docs/AGENT-CONTEXT.md +0 -191
- package/docs/COMMIT-HASH-BACKFILL.md +0 -51
- package/docs/LEGACY-CLI-CROSSWALK.md +0 -175
- package/docs/ROADMAP.md +0 -101
- package/docs/STATE-DB-ACCESS-POLICY.md +0 -161
- package/hooks/active_task_context.py +0 -152
- package/hooks/context_envelope.py +0 -100
- package/hooks/health_check.py +0 -196
- package/hooks/pre_stop_check.py +0 -66
- package/hooks/runtime_paths.py +0 -396
- package/hooks/subagent_tracker.py +0 -88
- package/hooks/workflow_checkpoint.py +0 -76
- package/hooks/workflow_context.py +0 -48
- package/hooks/workflow_resume.py +0 -84
- package/mcp-server/hook-context.cjs +0 -38
- package/mcp-server/hook-event.cjs +0 -34
- package/mcp-server/lib/archive-journal.cjs +0 -1119
- package/mcp-server/lib/archive-mutation-worker.py +0 -365
- package/mcp-server/lib/artifact-registry.cjs +0 -1232
- package/mcp-server/lib/baseline-workflow.cjs +0 -1193
- package/mcp-server/lib/canonical-json.cjs +0 -19
- package/mcp-server/lib/change-authority.cjs +0 -26
- package/mcp-server/lib/change-packet.cjs +0 -790
- package/mcp-server/lib/change-workflow.cjs +0 -65
- package/mcp-server/lib/context-envelope.cjs +0 -581
- package/mcp-server/lib/context-paths.cjs +0 -142
- package/mcp-server/lib/decision-records.cjs +0 -423
- package/mcp-server/lib/delivery-transaction.cjs +0 -471
- package/mcp-server/lib/doctor-backup-worker.cjs +0 -328
- package/mcp-server/lib/doctor.cjs +0 -627
- package/mcp-server/lib/git-bootstrap.cjs +0 -651
- package/mcp-server/lib/init-project.cjs +0 -1021
- package/mcp-server/lib/kernel-change-workflow.cjs +0 -2029
- package/mcp-server/lib/legacy-change-workflow.cjs +0 -3032
- package/mcp-server/lib/managed-file-write.cjs +0 -172
- package/mcp-server/lib/plan-checkpoint.cjs +0 -177
- package/mcp-server/lib/plan-publication-worker.cjs +0 -830
- package/mcp-server/lib/plan-store.cjs +0 -794
- package/mcp-server/lib/prd-parser.cjs +0 -83
- package/mcp-server/lib/pricing.cjs +0 -44
- package/mcp-server/lib/project-context.cjs +0 -178
- package/mcp-server/lib/projector.cjs +0 -386
- package/mcp-server/lib/provider-refs.cjs +0 -42
- package/mcp-server/lib/runtime-paths.cjs +0 -1714
- package/mcp-server/lib/runtime-state.cjs +0 -222
- package/mcp-server/lib/safe-project-file.cjs +0 -385
- package/mcp-server/lib/stage-checkpoints.cjs +0 -463
- package/mcp-server/lib/state-authority.cjs +0 -95
- package/mcp-server/lib/state-db.cjs +0 -1580
- package/mcp-server/lib/state-ops.cjs +0 -1428
- package/mcp-server/lib/task-contract.cjs +0 -404
- package/mcp-server/lib/task-expander.cjs +0 -105
- package/mcp-server/lib/task-ledger.cjs +0 -1964
- package/mcp-server/lib/telemetry.cjs +0 -85
- package/mcp-server/lib/topo.cjs +0 -131
- package/mcp-server/lib/ultra-facade.cjs +0 -2684
- package/mcp-server/lib/worker-packet.cjs +0 -358
- package/mcp-server/server.cjs +0 -437
- package/orchestrator/auto-merge.cjs +0 -128
- package/orchestrator/daemon.cjs +0 -264
- package/orchestrator/dispatch-rules.cjs +0 -78
- package/orchestrator/parallel-orchestrator.cjs +0 -903
- package/orchestrator/planner/plan-builder.cjs +0 -125
- package/orchestrator/recovery.cjs +0 -188
- package/orchestrator/session-close-journal-worker.cjs +0 -5
- package/orchestrator/session-close-journal.cjs +0 -1014
- package/orchestrator/session-runner.cjs +0 -1153
- package/orchestrator/worktree-manager.cjs +0 -282
- package/settings.json +0 -7
- package/skills/cc-collab/SKILL.md +0 -42
- package/skills/code-review-expert/SKILL.md +0 -43
- package/skills/code-review-expert/references/correctness-reliability.md +0 -30
- package/skills/code-review-expert/references/design-boundaries.md +0 -26
- package/skills/code-review-expert/references/removal-plan.md +0 -24
- package/skills/codex-collab/SKILL.md +0 -49
- package/skills/codex-collab/evals/evals.json +0 -35
- package/skills/integration-rules/SKILL.md +0 -32
- package/skills/security-rules/SKILL.md +0 -38
- package/skills/testing-rules/SKILL.md +0 -32
- package/skills/ultra-doctor/SKILL.md +0 -41
- package/skills/ultra-plan/references/semantic-preflight.md +0 -20
- package/skills/ultra-verify/SKILL.md +0 -46
- package/skills/ultra-verify/evals/evals.json +0 -46
- package/skills/ultra-verify/references/cross-verify-modes.md +0 -28
- package/skills/ultra-verify/references/evidence-status.md +0 -21
- package/skills/ultra-verify/scripts/verify_wait.py +0 -94
- package/spec/cli-protocol.md +0 -102
- package/spec/mcp-tools.yaml +0 -312
- package/spec/schemas/baseline-reconciliation.v1.schema.json +0 -73
- package/spec/schemas/change-delta.v1.schema.json +0 -153
- package/spec/schemas/command-manifest.schema.json +0 -29
- package/spec/schemas/context-file.v4.5.schema.json +0 -54
- package/spec/schemas/delivery-report.v1.schema.json +0 -66
- package/spec/schemas/documentation-reconciliation.v1.schema.json +0 -106
- package/spec/schemas/mcp-tools.schema.json +0 -136
- package/spec/schemas/skill-manifest.schema.json +0 -24
- package/spec/schemas/state-db.sql +0 -641
- package/spec/schemas/task-ledger.v2.schema.json +0 -296
- package/spec/schemas/tasks.v4.5.schema.json +0 -96
- package/spec/schemas/test-report.v1.schema.json +0 -225
- package/ultra-tools/cli.cjs +0 -129
- package/ultra-tools/commands/db.cjs +0 -226
- package/ultra-tools/commands/legacy-memory.cjs +0 -159
- package/ultra-tools/commands/migrate.cjs +0 -1386
- package/ultra-tools/commands/session.cjs +0 -213
- package/ultra-tools/commands/status.cjs +0 -559
- package/ultra-tools/commands/system.cjs +0 -498
- package/ultra-tools/commands/task.cjs +0 -105
|
@@ -1,230 +1,138 @@
|
|
|
1
1
|
# Ultra Builder Pro workflow lifecycle
|
|
2
2
|
|
|
3
|
-
Ultra
|
|
4
|
-
|
|
5
|
-
starts that capability. Skills own semantic procedure; the seven-tool MCP kernel owns
|
|
6
|
-
persistence and mechanical safety across Claude Code, Codex, OpenCode, Kimi Code, and
|
|
7
|
-
Grok Build.
|
|
8
|
-
|
|
9
|
-
## Capability graph
|
|
10
|
-
|
|
11
|
-
```mermaid
|
|
12
|
-
flowchart TD
|
|
13
|
-
START["Project"] --> INIT["ultra-init"]
|
|
14
|
-
INIT --> RESEARCH["ultra-research"]
|
|
15
|
-
RESEARCH --> THINK["ultra-think when a material decision remains"]
|
|
16
|
-
THINK --> RESEARCH
|
|
17
|
-
RESEARCH --> CHANGE["ultra-change"]
|
|
18
|
-
CHANGE --> ROUTE{"What does this Change actually need?"}
|
|
19
|
-
ROUTE -->|"Evidence gap"| CR["bounded ultra-research"]
|
|
20
|
-
CR --> ROUTE
|
|
21
|
-
ROUTE -->|"Implementation"| PLAN["ultra-plan"]
|
|
22
|
-
PLAN --> DEV["ultra-dev for one owned Task"]
|
|
23
|
-
DEV --> MORE{"More executable Tasks?"}
|
|
24
|
-
MORE -->|"Yes"| DEV
|
|
25
|
-
MORE -->|"No"| ASSESS{"What evidence is still warranted?"}
|
|
26
|
-
ROUTE -->|"No implementation; current evidence is sufficient"| ASSESS
|
|
27
|
-
ASSESS -->|"Risk-selected verification"| TEST["ultra-test"]
|
|
28
|
-
ASSESS -->|"Independent review"| REVIEW["ultra-review"]
|
|
29
|
-
ASSESS -->|"Caller accepts current packet and explicit omissions"| DELIVER["ultra-deliver"]
|
|
30
|
-
TEST -->|"implementation gap"| DEV
|
|
31
|
-
TEST -->|"review warranted"| REVIEW
|
|
32
|
-
TEST -->|"caller accepts evidence"| DELIVER
|
|
33
|
-
REVIEW -->|"implementation issue"| DEV
|
|
34
|
-
REVIEW -->|"contract issue"| PLAN
|
|
35
|
-
REVIEW -->|"accepted"| DELIVER
|
|
36
|
-
DELIVER --> CHANGE
|
|
37
|
-
STATUS["ultra-status"] -.-> INIT
|
|
38
|
-
STATUS -.-> CHANGE
|
|
39
|
-
DOCTOR["ultra-doctor"] -.-> INIT
|
|
40
|
-
DOCTOR -.-> CHANGE
|
|
41
|
-
```
|
|
3
|
+
Ultra v0.26 has no fixed runtime state machine. Skills define checkable entry and exit
|
|
4
|
+
criteria; repository files record facts; the host model chooses the route.
|
|
42
5
|
|
|
43
|
-
|
|
44
|
-
needed by the actual Change route and records every deliberate omission in the delivery
|
|
45
|
-
handoff. When implementation occurs, its Plan, Task contract, and Context remain
|
|
46
|
-
mandatory execution authority; Research, Test, and Review are used according to the
|
|
47
|
-
actual evidence and risk rather than as universal archive gates. `ultra-status` is
|
|
48
|
-
read-only. `ultra-doctor` repairs mechanical authority only.
|
|
49
|
-
|
|
50
|
-
## Shared command contract
|
|
51
|
-
|
|
52
|
-
Every public Skill follows the same boundary:
|
|
53
|
-
|
|
54
|
-
1. read the current `ultra.context`;
|
|
55
|
-
2. inspect checkout/runtime facts directly;
|
|
56
|
-
3. identify the smallest unresolved semantic choice;
|
|
57
|
-
4. recommend a route and ask only when user intent is not already explicit;
|
|
58
|
-
5. persist normalized facts through typed `ultra.record`;
|
|
59
|
-
6. update the owning semantic/evidence files;
|
|
60
|
-
7. save or accept the stage through `ultra.checkpoint`;
|
|
61
|
-
8. read back current authority;
|
|
62
|
-
9. report diagnostics and recommend, but do not launch, the next Skill.
|
|
63
|
-
|
|
64
|
-
No command records ceremonial steps merely to satisfy SQLite.
|
|
65
|
-
|
|
66
|
-
## Capability ownership
|
|
67
|
-
|
|
68
|
-
| Skill | Semantic owner | Durable output |
|
|
69
|
-
|---|---|---|
|
|
70
|
-
| `ultra-init` | repository classification, scope, Git/runtime bootstrap | initialized local authority and empty/imported team checkpoint |
|
|
71
|
-
| `ultra-research` | adaptive evidence coverage and accepted baseline | baseline specs, research evidence, Decision Records, baseline checkpoint |
|
|
72
|
-
| `ultra-think` | one load-bearing owner decision or bounded diagnosis | normalized Decision Record and applied references |
|
|
73
|
-
| `ultra-change` | feature/fix/refactor/incident contract | active Change intent, classification, delta and decision scope |
|
|
74
|
-
| `ultra-plan` | Task contracts, topology, ownership, acceptance coverage | accepted Plan checkpoint, deterministic plan files, team checkpoint |
|
|
75
|
-
| `ultra-dev` | one owned vertical Task implementation | Worker Packet output, task outcome, implementation evidence checkpoint |
|
|
76
|
-
| `ultra-test` | risk-selected executable validation | test report and accepted test checkpoint |
|
|
77
|
-
| `ultra-review` | independent spec fidelity and engineering quality | specialist artifacts, coordinated summary, accepted review checkpoint |
|
|
78
|
-
| `ultra-deliver` | documentation/spec reconciliation and local archive | delivery evidence, converged baseline, immutable archive, team checkpoint |
|
|
79
|
-
| `ultra-status` | current Context rendering | no state mutation |
|
|
80
|
-
| `ultra-doctor` | mechanical health, migration, backup and repair | diagnostic/repair report; no product decision |
|
|
81
|
-
|
|
82
|
-
## Context and decisions
|
|
83
|
-
|
|
84
|
-
One canonical Context Envelope flows through Skill, Hook, Session, Agent, and compact
|
|
85
|
-
recovery. Accepted Decision Records are always visible, including when no workflow is
|
|
86
|
-
active. A new session therefore resumes from accepted intent rather than reconstructing
|
|
87
|
-
it from conversation.
|
|
88
|
-
|
|
89
|
-
Decision history is append-only through supersession:
|
|
6
|
+
## Capability flow
|
|
90
7
|
|
|
91
8
|
```text
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
9
|
+
ultra-init
|
|
10
|
+
├─ unresolved external claims ─► ultra-research
|
|
11
|
+
└─ bounded requested outcome ──► ultra-change
|
|
95
12
|
|
|
96
|
-
|
|
97
|
-
|
|
13
|
+
ultra-change ─► ultra-plan ─► ultra-dev (per task) ─► ultra-test ─► ultra-deliver
|
|
14
|
+
▲ │ │
|
|
15
|
+
└── replan ◄──────┘ └── findings return to owner/model
|
|
98
16
|
|
|
99
|
-
|
|
17
|
+
ultra-status read-only router at any point
|
|
18
|
+
ultra-delegate orthogonal bounded execution on another CLI
|
|
19
|
+
```
|
|
100
20
|
|
|
101
|
-
|
|
21
|
+
Arrows are recommendations, not automatic invocation. The owner explicitly selects
|
|
22
|
+
each public workflow.
|
|
102
23
|
|
|
103
|
-
|
|
104
|
-
draft revision N
|
|
105
|
-
-> accepted revision N
|
|
106
|
-
-> accepted revision N+1 supersedes N
|
|
107
|
-
```
|
|
24
|
+
## Common entry contract
|
|
108
25
|
|
|
109
|
-
|
|
110
|
-
checkpoint conclusion. A structural, digest, path, publication, or concurrency
|
|
111
|
-
conflict keeps the same draft mutable. Plan export is part of Plan checkpoint
|
|
112
|
-
publication, so changing a Task contract before acceptance cannot invalidate an
|
|
113
|
-
already-recorded “export step.” There is no locked intermediate run to cancel or
|
|
114
|
-
manually repair.
|
|
26
|
+
Every user-invoked Skill reads, in order:
|
|
115
27
|
|
|
116
|
-
|
|
117
|
-
|
|
28
|
+
1. `.ultra/tasks.json`;
|
|
29
|
+
2. the unfinished task's `context_file` and closing `## Resume Note`;
|
|
30
|
+
3. `CONTEXT.md` and relevant `.ultra/decisions/`;
|
|
31
|
+
4. the active Change, specifications, evidence, and Git state relevant to its scope.
|
|
118
32
|
|
|
119
|
-
|
|
33
|
+
Missing files produce a precise recovery or initialization recommendation. They do not
|
|
34
|
+
cause the Skill to invent a state transition.
|
|
120
35
|
|
|
121
|
-
|
|
36
|
+
## Initialization
|
|
122
37
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
```
|
|
38
|
+
`ultra-init` distinguishes owner authorization from claims requiring evidence. It
|
|
39
|
+
creates the file skeleton, preserves unknowns as `[NEEDS CLARIFICATION]`, initializes
|
|
40
|
+
Git when absent, and records only repository-observable brownfield facts. It does not
|
|
41
|
+
perform research or launch another workflow.
|
|
128
42
|
|
|
129
|
-
|
|
130
|
-
states. An active Change may be revised. The Deliver Skill inspects the relevant Task,
|
|
131
|
-
Context, test, review, documentation, and delivery evidence, decides semantic
|
|
132
|
-
sufficiency, and records deliberate omissions. Archive validates the explicit handoff,
|
|
133
|
-
current authority, reconciliation structure, and safe recoverable filesystem/DB
|
|
134
|
-
transaction without enforcing a fixed stage sequence. Archived bytes remain immutable.
|
|
43
|
+
## Research
|
|
135
44
|
|
|
136
|
-
|
|
137
|
-
|
|
45
|
+
`ultra-research` maps unresolved claims to the smallest useful subset of seventeen
|
|
46
|
+
focused references. Reports are written immediately. Three material checkpoints can
|
|
47
|
+
change later scope; the owner resolves those checkpoints. The final distillate records
|
|
48
|
+
Git blob hashes of the specifications it summarizes.
|
|
138
49
|
|
|
139
|
-
##
|
|
50
|
+
## Change reconciliation
|
|
140
51
|
|
|
141
|
-
|
|
52
|
+
`ultra-change` first compares requested behavior with product truth and current code.
|
|
53
|
+
It classifies changes by the resulting commitments:
|
|
142
54
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
-> cancelled
|
|
149
|
-
```
|
|
55
|
+
- expansion and correction may proceed inside accepted intent;
|
|
56
|
+
- a reduction waits for explicit owner authority.
|
|
57
|
+
|
|
58
|
+
The output is one active Change intent with observable outcome, acceptance, seams,
|
|
59
|
+
non-goals, and trace anchors.
|
|
150
60
|
|
|
151
|
-
|
|
152
|
-
commit backfill are checkout-local. They are not published to Git.
|
|
153
|
-
Reopening a completed Task clears the local completion/session fields, preserves the
|
|
154
|
-
prior completion commit in an append-only `task_reopened` event, and requires a new
|
|
155
|
-
durable outcome before it can be completed again.
|
|
61
|
+
## Planning
|
|
156
62
|
|
|
157
|
-
`ultra
|
|
63
|
+
`ultra-plan` confirms the scope posture and public seams, then writes a task graph and
|
|
64
|
+
one context file per task. Feature tasks are tracer bullets. A contract task precedes
|
|
65
|
+
cross-process or cross-top-level-boundary implementations; integration checkpoints
|
|
66
|
+
appear after several slices. Cycles and broken trace paths are repaired before handoff.
|
|
158
67
|
|
|
159
|
-
|
|
160
|
-
2. compiles or reuses the exact Context Envelope;
|
|
161
|
-
3. creates an immutable Worker Packet;
|
|
162
|
-
4. allocates the lease/worktree;
|
|
163
|
-
5. returns packet path/digest and exact execution boundary.
|
|
68
|
+
## Task development
|
|
164
69
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
70
|
+
`ultra-dev` writes the implementation plan into the task context before code. It uses
|
|
71
|
+
`ultra-tdd` on confirmed seams, records six evidence dimensions, and keeps ledger and
|
|
72
|
+
context status synchronized. The closing Resume Note is rewritten even when work stops
|
|
73
|
+
early.
|
|
169
74
|
|
|
170
|
-
|
|
75
|
+
Task review uses six independent lenses. Findings move through stable JSON artifacts,
|
|
76
|
+
not intermediate worker chatter. Refactoring happens after the evidence makes real
|
|
77
|
+
duplication or coupling visible.
|
|
171
78
|
|
|
172
|
-
|
|
173
|
-
portable baseline, Change, Decision summary/reference, accepted Stage Checkpoint, Task
|
|
174
|
-
contract, dependency, and durable outcome records. It excludes local execution state.
|
|
79
|
+
## Whole-system audit
|
|
175
80
|
|
|
176
|
-
`ultra
|
|
81
|
+
`ultra-test` runs once after the ledger is complete. It checks anti-patterns, coverage,
|
|
82
|
+
wiring, E2E behavior, performance, and security. It names the exact Git commit and
|
|
83
|
+
never turns an orphan, failed command, stub, or omission into permission to alter scope.
|
|
177
84
|
|
|
178
|
-
|
|
179
|
-
- `migrate`: exact-byte backup-first legacy conversion;
|
|
180
|
-
- `import`: schema/digest/ancestry/CAS validation and clean fast-forward;
|
|
181
|
-
- `publish`: reconcile incoming Git authority, then publish one new generation.
|
|
85
|
+
## Delivery
|
|
182
86
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
87
|
+
`ultra-deliver` reconciles actual outcome, specifications, documentation, current test
|
|
88
|
+
report, aggregate review, build, version impact, omissions, and rollback. It archives
|
|
89
|
+
the Change with `git mv` after local reconciliation.
|
|
186
90
|
|
|
187
|
-
|
|
188
|
-
|
|
91
|
+
Commit, push, tag, publication, release, and deployment are independent external
|
|
92
|
+
effects. Readiness grants none automatically.
|
|
189
93
|
|
|
190
|
-
##
|
|
94
|
+
## Status routing
|
|
191
95
|
|
|
192
|
-
|
|
96
|
+
`ultra-status` infers the smallest next route from observable files:
|
|
193
97
|
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
-
|
|
98
|
+
- no healthy skeleton → init;
|
|
99
|
+
- unresolved evidence-bearing claim → research;
|
|
100
|
+
- requested outcome without active Change → change;
|
|
101
|
+
- active Change without executable ledger → plan;
|
|
102
|
+
- pending or in-progress task → dev;
|
|
103
|
+
- completed ledger without current report → test;
|
|
104
|
+
- current report and unarchived Change → deliver.
|
|
199
105
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
context injection.
|
|
106
|
+
It also checks installation provenance, stale reports, old in-progress work, and
|
|
107
|
+
unresolved markers. It does not mutate artifacts.
|
|
203
108
|
|
|
204
|
-
##
|
|
109
|
+
## Artifact closure
|
|
205
110
|
|
|
206
|
-
|
|
207
|
-
instead of blocking diagnosis. Use `ultra.sync migrate` for semantic conversion and
|
|
208
|
-
`ultra.doctor { repair: true }` for mechanical backup/recovery.
|
|
111
|
+
Every durable output has a later reader:
|
|
209
112
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
113
|
+
- init's north star and specification skeletons are read by all later workflows;
|
|
114
|
+
- research reports are traced into specifications, Change reconciliation, planning,
|
|
115
|
+
and delivery;
|
|
116
|
+
- Change intent is consumed through planning, development, audit, review, status, and
|
|
117
|
+
delivery;
|
|
118
|
+
- task ledger and contexts are the common resume input, while task evidence feeds
|
|
119
|
+
review, whole-system audit, and delivery;
|
|
120
|
+
- the current test report is consumed by status and delivery;
|
|
121
|
+
- delivery moves with the Change into archive and remains historical evidence.
|
|
213
122
|
|
|
214
|
-
|
|
215
|
-
|
|
123
|
+
`ultra-status` intentionally writes nothing. Review, Hook, compact, and delegation
|
|
124
|
+
files are derived observations with explicit rebuild or rerun paths. No route creates
|
|
125
|
+
an unowned drift log, Change plan, technical-debt report, or second delivery summary.
|
|
216
126
|
|
|
217
|
-
##
|
|
127
|
+
## Interruption and cross-host continuation
|
|
218
128
|
|
|
219
|
-
|
|
129
|
+
Before stopping, the active task context records current facts, exact verification,
|
|
130
|
+
open questions, Completion, and a closing Resume Note. The next session or host repeats
|
|
131
|
+
the common entry contract and compares the working tree with those claims.
|
|
220
132
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
- actual digest, CAS, or lease concurrency conflict;
|
|
224
|
-
- missing/incompatible native runtime;
|
|
225
|
-
- permission failure;
|
|
226
|
-
- archive/publish/deploy or another irreversible external-effect failure.
|
|
133
|
+
This path remains valid when hooks and `ubp` are disabled. A compact snapshot may be
|
|
134
|
+
used as a hint, then checked against canonical files and Git.
|
|
227
135
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
136
|
+
An authenticated Claude-to-Codex continuation using this path passed on 2026-08-03;
|
|
137
|
+
the exact scope, provenance, results, and limitations are recorded in the
|
|
138
|
+
[runtime compatibility matrix](RUNTIME-COMPAT-MATRIX.md#authenticated-cross-host-continuation-evidence).
|
package/hooks/README.md
CHANGED
|
@@ -1,42 +1,24 @@
|
|
|
1
|
-
# Ultra Builder Pro
|
|
1
|
+
# Ultra Builder Pro hooks
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Direct writes to the MCP-owned Git checkpoint and checkout-local projections remain
|
|
6
|
-
blocked; context, compact, stop, and agent lifecycle behavior is recovery-oriented and
|
|
7
|
-
does not turn semantic diagnostics into refusal gates.
|
|
3
|
+
Ultra ships five small file-first hooks. Every hook first looks for a `.ultra/`
|
|
4
|
+
directory and exits silently when the workflow is not active.
|
|
8
5
|
|
|
9
|
-
|
|
|
6
|
+
| Hook | Lifecycle | Purpose |
|
|
10
7
|
|---|---|---|
|
|
11
|
-
| Session start |
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
| After compact/resume | `workflow_resume.py` | Prefer the DB breadcrumb; restore the minimal file checkpoint only when no active change owns recovery |
|
|
17
|
-
| Stop | `pre_stop_check.py` | Report an incomplete workflow boundary and allow stop |
|
|
18
|
-
| Subagent lifecycle | `subagent_tracker.py` | Append minimal start/stop metadata to the authoritative DB event stream |
|
|
8
|
+
| `session_context.py` | Session start | Inject the one-line north star and current acceptance criteria |
|
|
9
|
+
| `mid_workflow_recall.py` | Before source reads or edits | Restate current acceptance only |
|
|
10
|
+
| `compact_context.py` | Before/after compaction | Save and restore a disposable snapshot derived from files and Git |
|
|
11
|
+
| `post_edit_guard.py` | After edits | Record mechanical evidence observations without deciding completion |
|
|
12
|
+
| `block_dangerous_commands.py` | Before shell execution | Advise on additive protected-branch publication; block history rewrites and a narrow destructive set until the exact command is owner-authorized |
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
memory and graph content belongs to separately installed providers.
|
|
14
|
+
`_common.py` is a shared library, not a lifecycle registration. Compact snapshots and
|
|
15
|
+
progress observations live under ignored `.ultra/.runtime/` or `.ultra/progress/`; the
|
|
16
|
+
canonical semantic facts remain the owner-readable files and Git.
|
|
24
17
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
live workflow wins; a newer valid checkpoint may restore a missing or older
|
|
33
|
-
live file; corrupt, non-object, or terminal checkpoints are ignored.
|
|
34
|
-
|
|
35
|
-
Runtime wiring:
|
|
36
|
-
|
|
37
|
-
- Claude Code: native `hooks/hooks.json` with `${CLAUDE_PLUGIN_ROOT}` paths.
|
|
38
|
-
- Codex: native `hooks/hooks.json` through `hooks/adapters/codex.py` for wire normalization.
|
|
39
|
-
- OpenCode: native JavaScript plugin events; the Python hook suite is not copied.
|
|
40
|
-
- Kimi Code: native lifecycle events through its wire adapter.
|
|
41
|
-
- Grok Build: camelCase lifecycle events; ignored stdout channels are used for
|
|
42
|
-
observation only, and every Skill rereads authoritative Context at entry.
|
|
18
|
+
Claude Code runs the hooks directly. Codex, Kimi Code, and Grok Build use the small
|
|
19
|
+
wire adapters under `hooks/adapters/`. OpenCode calls the same scripts from its native
|
|
20
|
+
JavaScript plugin. A hook failure is advisory except for the explicitly classified
|
|
21
|
+
destructive effects in `block_dangerous_commands.py`, whose denial includes a reachable
|
|
22
|
+
SHA-256-scoped authorization path. Additive protected-branch publication stays advisory
|
|
23
|
+
because portable hooks cannot consume every host's trusted owner-approval receipt;
|
|
24
|
+
history rewrites and branch deletion remain guarded.
|
package/hooks/_common.py
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"""Small file-first helpers shared by Ultra hooks."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import os
|
|
7
|
+
import re
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def read_payload() -> dict[str, Any]:
|
|
14
|
+
try:
|
|
15
|
+
value = json.loads(sys.stdin.read() or "{}")
|
|
16
|
+
except json.JSONDecodeError:
|
|
17
|
+
return {}
|
|
18
|
+
return value if isinstance(value, dict) else {}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def project_root(payload: dict[str, Any]) -> Path | None:
|
|
22
|
+
candidate = payload.get("cwd") or payload.get("workspace_root") or os.getcwd()
|
|
23
|
+
path = Path(str(candidate)).resolve()
|
|
24
|
+
if path.is_file():
|
|
25
|
+
path = path.parent
|
|
26
|
+
for current in (path, *path.parents):
|
|
27
|
+
if (current / ".ultra").is_dir():
|
|
28
|
+
return current
|
|
29
|
+
return None
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def markdown_section(text: str, heading: str) -> str:
|
|
33
|
+
pattern = re.compile(
|
|
34
|
+
rf"^##\s+{re.escape(heading)}\s*$\n(?P<body>.*?)(?=^##\s+|\Z)",
|
|
35
|
+
re.MULTILINE | re.DOTALL | re.IGNORECASE,
|
|
36
|
+
)
|
|
37
|
+
match = pattern.search(text)
|
|
38
|
+
return match.group("body").strip() if match else ""
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def read_tasks(root: Path) -> list[dict[str, Any]]:
|
|
42
|
+
try:
|
|
43
|
+
value = json.loads((root / ".ultra" / "tasks.json").read_text(encoding="utf-8"))
|
|
44
|
+
except (OSError, json.JSONDecodeError):
|
|
45
|
+
return []
|
|
46
|
+
tasks = value.get("tasks", []) if isinstance(value, dict) else value
|
|
47
|
+
return [item for item in tasks if isinstance(item, dict)] if isinstance(tasks, list) else []
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def current_task(root: Path) -> dict[str, Any] | None:
|
|
51
|
+
tasks = read_tasks(root)
|
|
52
|
+
for status in ("in_progress", "pending"):
|
|
53
|
+
for task in tasks:
|
|
54
|
+
if task.get("status") == status:
|
|
55
|
+
return task
|
|
56
|
+
return None
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def project_file(root: Path, value: str, *, ultra_default: bool = False) -> Path | None:
|
|
60
|
+
relative = Path(value)
|
|
61
|
+
if relative.is_absolute():
|
|
62
|
+
return None
|
|
63
|
+
ultra_shorthands = {"changes", "contexts", "decisions", "evidence", "progress", "reviews", "specs"}
|
|
64
|
+
first = relative.parts[0] if relative.parts else ""
|
|
65
|
+
if first == ".ultra":
|
|
66
|
+
base = root
|
|
67
|
+
elif ultra_default and first in ultra_shorthands:
|
|
68
|
+
base = root / ".ultra"
|
|
69
|
+
else:
|
|
70
|
+
base = root
|
|
71
|
+
candidate = (base / relative).resolve()
|
|
72
|
+
try:
|
|
73
|
+
candidate.relative_to(root.resolve())
|
|
74
|
+
except ValueError:
|
|
75
|
+
return None
|
|
76
|
+
return candidate
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def context_path(root: Path, task: dict[str, Any]) -> Path | None:
|
|
80
|
+
value = task.get("context_file")
|
|
81
|
+
if not isinstance(value, str) or not value:
|
|
82
|
+
return None
|
|
83
|
+
return project_file(root, value, ultra_default=True)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def task_sections(root: Path, task: dict[str, Any]) -> dict[str, str]:
|
|
87
|
+
file = context_path(root, task)
|
|
88
|
+
try:
|
|
89
|
+
text = file.read_text(encoding="utf-8") if file else ""
|
|
90
|
+
except OSError:
|
|
91
|
+
text = ""
|
|
92
|
+
return {
|
|
93
|
+
"acceptance": markdown_section(text, "Acceptance Criteria"),
|
|
94
|
+
"resume": markdown_section(text, "Resume Note"),
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def emit_context(event: str, text: str) -> None:
|
|
99
|
+
if not text.strip():
|
|
100
|
+
return
|
|
101
|
+
print(json.dumps({
|
|
102
|
+
"hookSpecificOutput": {
|
|
103
|
+
"hookEventName": event,
|
|
104
|
+
"additionalContext": text.strip(),
|
|
105
|
+
}
|
|
106
|
+
}))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def write_json_atomic(file: Path, payload: dict[str, Any]) -> None:
|
|
110
|
+
file.parent.mkdir(parents=True, exist_ok=True)
|
|
111
|
+
temporary = file.with_suffix(f"{file.suffix}.tmp-{os.getpid()}")
|
|
112
|
+
temporary.write_text(f"{json.dumps(payload, indent=2)}\n", encoding="utf-8")
|
|
113
|
+
temporary.replace(file)
|
package/hooks/adapters/codex.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""Codex wire adapter for Ultra Builder Pro hooks.
|
|
2
|
+
"""Codex wire adapter for Ultra Builder Pro's five file-first hooks.
|
|
3
3
|
|
|
4
4
|
Codex and Claude Code share the JSON-on-stdin command-hook shape, but differ
|
|
5
5
|
at three important boundaries:
|
|
6
6
|
|
|
7
7
|
- Codex emits ``apply_patch`` with the patch text in ``tool_input.command``;
|
|
8
|
-
|
|
8
|
+
the post-edit sensor expects one ``Edit`` event per ``file_path``.
|
|
9
9
|
- Codex rejects ``permissionDecision: ask`` in PreToolUse output. Ultra warning
|
|
10
10
|
decisions therefore become advisory ``systemMessage`` values.
|
|
11
11
|
- Each event has a strict output schema. This adapter removes foreign fields
|
|
@@ -30,13 +30,11 @@ from typing import Any
|
|
|
30
30
|
|
|
31
31
|
HOOK_ROOT = Path(__file__).resolve().parent.parent
|
|
32
32
|
ALLOWED_FEATURES = {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"workflow_context.py",
|
|
39
|
-
"workflow_resume.py",
|
|
33
|
+
"block_dangerous_commands.py",
|
|
34
|
+
"compact_context.py",
|
|
35
|
+
"mid_workflow_recall.py",
|
|
36
|
+
"post_edit_guard.py",
|
|
37
|
+
"session_context.py",
|
|
40
38
|
}
|
|
41
39
|
UNIVERSAL_OUTPUT_FIELDS = {"continue", "stopReason", "suppressOutput", "systemMessage"}
|
|
42
40
|
PATCH_FILE_RE = re.compile(r"^\*\*\* (?:Add|Update|Delete) File: (.+?)\s*$", re.MULTILINE)
|
|
@@ -58,7 +56,7 @@ def _patch_paths(tool_input: Any) -> list[str]:
|
|
|
58
56
|
|
|
59
57
|
|
|
60
58
|
def normalize_inputs(payload: dict[str, Any]) -> list[dict[str, Any]]:
|
|
61
|
-
"""Return
|
|
59
|
+
"""Return file-first hook input(s) for one Codex hook payload."""
|
|
62
60
|
normalized = copy.deepcopy(payload)
|
|
63
61
|
if normalized.get("tool_response") is not None and normalized.get("tool_output") is None:
|
|
64
62
|
normalized["tool_output"] = normalized["tool_response"]
|
|
@@ -90,7 +88,7 @@ def _universal(output: dict[str, Any]) -> dict[str, Any]:
|
|
|
90
88
|
|
|
91
89
|
|
|
92
90
|
def adapt_output(output: dict[str, Any], event: str) -> dict[str, Any]:
|
|
93
|
-
"""Convert a
|
|
91
|
+
"""Convert a shared hook result to the strict Codex event output schema."""
|
|
94
92
|
if not isinstance(output, dict):
|
|
95
93
|
return {}
|
|
96
94
|
result = _universal(output)
|
|
@@ -239,11 +237,6 @@ def run_feature(feature: str, payload: dict[str, Any], feature_args: list[str])
|
|
|
239
237
|
return {"systemMessage": f"Ultra hook feature is missing: {feature}"}
|
|
240
238
|
|
|
241
239
|
event = str(payload.get("hook_event_name") or "")
|
|
242
|
-
if feature == "workflow_resume.py" and event == "PostCompact":
|
|
243
|
-
payload = dict(payload)
|
|
244
|
-
payload["hook_event_name"] = "SessionStart"
|
|
245
|
-
payload["source"] = "compact"
|
|
246
|
-
|
|
247
240
|
env = os.environ.copy()
|
|
248
241
|
env["UBP_HOOK_RUNTIME"] = "codex"
|
|
249
242
|
plugin_data = env.get("PLUGIN_DATA") or env.get("CLAUDE_PLUGIN_DATA")
|
package/hooks/adapters/grok.py
CHANGED
|
@@ -14,11 +14,11 @@ from typing import Any
|
|
|
14
14
|
|
|
15
15
|
HOOK_ROOT = Path(__file__).resolve().parent.parent
|
|
16
16
|
ALLOWED_FEATURES = {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
17
|
+
"block_dangerous_commands.py",
|
|
18
|
+
"compact_context.py",
|
|
19
|
+
"mid_workflow_recall.py",
|
|
20
|
+
"post_edit_guard.py",
|
|
21
|
+
"session_context.py",
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
package/hooks/adapters/kimi.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""Kimi Code wire adapter for Ultra Builder Pro
|
|
2
|
+
"""Kimi Code wire adapter for Ultra Builder Pro's five file-first hooks.
|
|
3
3
|
|
|
4
|
-
Kimi
|
|
4
|
+
Kimi uses snake_case JSON input compatible with the shared hooks, but
|
|
5
5
|
its output contract accepts only ``message`` plus an optional structured deny.
|
|
6
6
|
This adapter preserves explicit projection denials and optional Stop decisions, converts foreign context
|
|
7
7
|
fields into Kimi messages, and fails open with diagnostic evidence.
|
|
@@ -20,18 +20,16 @@ from typing import Any
|
|
|
20
20
|
|
|
21
21
|
HOOK_ROOT = Path(__file__).resolve().parent.parent
|
|
22
22
|
ALLOWED_FEATURES = {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"workflow_context.py",
|
|
29
|
-
"workflow_resume.py",
|
|
23
|
+
"block_dangerous_commands.py",
|
|
24
|
+
"compact_context.py",
|
|
25
|
+
"mid_workflow_recall.py",
|
|
26
|
+
"post_edit_guard.py",
|
|
27
|
+
"session_context.py",
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
|
|
33
31
|
def normalize_input(payload: dict[str, Any]) -> dict[str, Any]:
|
|
34
|
-
"""Add only
|
|
32
|
+
"""Add only aliases required by the shared file-first hooks."""
|
|
35
33
|
normalized = copy.deepcopy(payload)
|
|
36
34
|
agent_name = normalized.get("agent_name")
|
|
37
35
|
if isinstance(agent_name, str) and agent_name:
|
|
@@ -101,10 +99,6 @@ def run_feature(feature: str, payload: dict[str, Any], feature_args: list[str])
|
|
|
101
99
|
|
|
102
100
|
event = str(payload.get("hook_event_name") or "")
|
|
103
101
|
normalized = normalize_input(payload)
|
|
104
|
-
if feature == "workflow_resume.py" and event == "PostCompact":
|
|
105
|
-
normalized["hook_event_name"] = "SessionStart"
|
|
106
|
-
normalized["source"] = "compact"
|
|
107
|
-
|
|
108
102
|
env = os.environ.copy()
|
|
109
103
|
env["UBP_HOOK_RUNTIME"] = "kimi"
|
|
110
104
|
plugin_data = env.get("PLUGIN_DATA") or env.get("KIMI_PLUGIN_ROOT")
|