lazycodex-ai 5.0.0-beta.34 → 5.0.0-beta.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +1 -1
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/README.ru.md +1 -1
- package/README.zh-cn.md +1 -1
- package/dist/cli/index.js +48342 -48539
- package/dist/cli-node/index.js +49017 -49214
- package/package.json +2 -4
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -3
- package/packages/omo-codex/plugin/.mcp.json +0 -6
- package/packages/omo-codex/plugin/AGENTS.md +5 -5
- package/packages/omo-codex/plugin/README.md +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +1 -15
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-doctor/SKILL.md +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +0 -1
- package/packages/omo-codex/plugin/components/ultrawork/src/directive-content.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +11 -1
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-codex-validation.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-codex-validation.js +45 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.js +10 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +35 -38
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +278 -193
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.js +7 -51
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.js +39 -22
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.d.ts +13 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.js +64 -8
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-verdicts.js +5 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +37 -18
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-codex-validation.ts +81 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-template.ts +10 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +32 -63
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-aggregate.ts +7 -53
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-artifacts.ts +50 -31
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-fields.ts +67 -14
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-verdicts.ts +6 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +36 -17
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-final.test.ts +26 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-template.test.ts +47 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-aggregate-basics.test.ts +258 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-cap-and-dedupe.test.ts +22 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-poisoning-cascades.test.ts +97 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-single-report.test.ts +241 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -146
- package/packages/omo-codex/plugin/package.json +1 -2
- package/packages/omo-codex/plugin/scripts/AGENTS.md +0 -1
- package/packages/omo-codex/plugin/scripts/auto-update-plan.mjs +0 -1
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +0 -9
- package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +0 -1
- package/packages/omo-codex/plugin/shared/src/config-loader.ts +2 -102
- package/packages/omo-codex/plugin/shared/src/config-migration.ts +0 -1
- package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +41 -130
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +13 -13
- package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +2 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +0 -1
- package/packages/omo-codex/plugin/test/AGENTS.md +2 -2
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +2 -21
- package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -2
- package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +2 -7
- package/packages/omo-codex/plugin/test/auto-update.test.mjs +0 -25
- package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +0 -31
- package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +0 -50
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +0 -1
- package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +1 -3
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +227 -435
- package/packages/prompts-core/prompts/ultrawork/codex.md +2 -2
- package/packages/shared-skills/skills/init-deep/SKILL.md +13 -13
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +0 -1
- package/packages/omo-codex/plugin/components/codegraph/AGENTS.md +0 -58
- package/packages/omo-codex/plugin/components/codegraph/LICENSE +0 -21
- package/packages/omo-codex/plugin/components/codegraph/NODE-RUNTIME-LICENSES.md +0 -2951
- package/packages/omo-codex/plugin/components/codegraph/NOTICE +0 -16
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +0 -12326
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +0 -9908
- package/packages/omo-codex/plugin/components/codegraph/package.json +0 -33
- package/packages/omo-codex/plugin/components/codegraph/src/cache-gc.ts +0 -29
- package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +0 -79
- package/packages/omo-codex/plugin/components/codegraph/src/hook-input.ts +0 -33
- package/packages/omo-codex/plugin/components/codegraph/src/hook-sweep.ts +0 -25
- package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +0 -131
- package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +0 -258
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +0 -310
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +0 -92
- package/packages/omo-codex/plugin/components/codegraph/src/post-tool-use-hook.ts +0 -34
- package/packages/omo-codex/plugin/components/codegraph/src/serve-invocation.ts +0 -29
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +0 -263
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-command.ts +0 -106
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-cooldown.ts +0 -145
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-hook-runtime.ts +0 -22
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-lock.ts +0 -139
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-outcome.ts +0 -15
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-paths.ts +0 -32
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-project.ts +0 -109
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker-result.ts +0 -148
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +0 -175
- package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +0 -81
- package/packages/omo-codex/plugin/components/codegraph/test/cache-gc.test.ts +0 -34
- package/packages/omo-codex/plugin/components/codegraph/test/hook-exclusion.test.ts +0 -112
- package/packages/omo-codex/plugin/components/codegraph/test/hook-registration.test.ts +0 -26
- package/packages/omo-codex/plugin/components/codegraph/test/hook-session-start-guard.test.ts +0 -160
- package/packages/omo-codex/plugin/components/codegraph/test/hook-store-upgrade.test.ts +0 -50
- package/packages/omo-codex/plugin/components/codegraph/test/hook-sweep.test.ts +0 -29
- package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +0 -320
- package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +0 -172
- package/packages/omo-codex/plugin/components/codegraph/test/package-runtime.test.ts +0 -91
- package/packages/omo-codex/plugin/components/codegraph/test/provisioned-node-guard.test.ts +0 -100
- package/packages/omo-codex/plugin/components/codegraph/test/serve-built-wrapper.test.ts +0 -76
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge-lifecycle.test.ts +0 -133
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +0 -245
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-facade.test.ts +0 -69
- package/packages/omo-codex/plugin/components/codegraph/test/serve-node-support.test.ts +0 -43
- package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +0 -147
- package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable-idle.test.ts +0 -47
- package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable.test.ts +0 -175
- package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +0 -385
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +0 -206
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-project.test.ts +0 -58
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-state.test.ts +0 -104
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-trust-boundary.test.ts +0 -65
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-availability.test.ts +0 -106
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-cooldown.test.ts +0 -116
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +0 -258
- package/packages/omo-codex/plugin/components/codegraph/test/sweep-cli.test.ts +0 -56
- package/packages/omo-codex/plugin/components/codegraph/tsconfig.build.json +0 -13
- package/packages/omo-codex/plugin/components/codegraph/tsconfig.json +0 -25
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-aggregate.test.ts +0 -101
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +0 -18
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +0 -17
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/editor.mjs +0 -125
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/jsonc.mjs +0 -43
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/scaffold.mjs +0 -29
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot.mjs +0 -121
- package/packages/omo-codex/plugin/test/component-codegraph-mcp-smoke.test.mjs +0 -76
- package/packages/omo-codex/plugin/test/migrate-omo-sot.test.mjs +0 -179
|
@@ -21,7 +21,17 @@ Every subcommand below is implemented. Pass `--json` where supported for machine
|
|
|
21
21
|
| `omo-agent-toolkit ulw-loop record-evidence` | Record observable evidence for one criterion. |
|
|
22
22
|
| `omo-agent-toolkit ulw-loop record-review-blockers` | Mark a goal as review-blocked and add follow-up work from final-review findings. |
|
|
23
23
|
|
|
24
|
-
The final quality gate parsed by `checkpoint` validates `codeReview`, `manualQa`, `gateReview`, `iteration`, and `criteriaCoverage
|
|
24
|
+
The final quality gate parsed by `checkpoint` validates `codeReview`, `manualQa`, `gateReview`, `iteration`, and `criteriaCoverage`, reporting all defects together in one invocation. `criteriaCoverage` records the original intent, desired outcome, user-facing outcome review, pass counts, and covered adversarial classes. The companion `codex-goal-json` must contain `goal.objective` equal to the plan's `codexObjective` verbatim.
|
|
25
|
+
|
|
26
|
+
A complete passing checkpoint uses both payloads:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{"goal":{"objective":"Ship the requested behavior","status":"complete"}}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{"gateReview":{"by":"lazycodex-gate-reviewer","recommendation":"APPROVE","reportPath":".omo/evidence/gate-review.md","evidence":"Gate review passed.","blockers":[],"notes":[]},"manualQa":{"by":"lazycodex-qa-executor","status":"passed","evidence":"Manual QA passed.","surfaceEvidence":[{"id":"cli","criterionRef":"C1","surface":"cli","invocation":"omo-agent-toolkit ulw-loop checkpoint --json","verdict":"passed","artifactRefs":["cli-artifact"]}],"adversarialCases":[{"id":"malformed","criterionRef":"C2","scenario":"Malformed input","expectedBehavior":"Rejected","verdict":"not_applicable","reason":"Not triggered","artifactRefs":["cli-artifact"]}],"artifactRefs":[{"id":"cli-artifact","kind":"cli-transcript","description":"Passing CLI transcript","path":".omo/evidence/cli.txt"}]},"codeReview":{"by":"lazycodex-code-reviewer","recommendation":"APPROVE","codeQualityStatus":"CLEAR","reportPath":".omo/evidence/code-review.md","evidence":"Code review passed.","blockers":[]},"iteration":{"fullRerun":true,"status":"passed","rerunCommands":["bun test"],"evidence":"Full rerun passed."},"criteriaCoverage":{"totalCriteria":2,"passCount":2,"originalIntent":"Ship the requested behavior","desiredOutcome":"The behavior works for users.","userOutcomeReview":"The result matches the requested outcome.","adversarialClassesCovered":["malformed_input"]}}
|
|
34
|
+
```
|
|
25
35
|
|
|
26
36
|
Validation batches are optional review boundaries declared at plan creation with `--validation-batch-json '[{"batchId":"VB001","memberIds":[...],"finalGoalId":"..."}]'`. The batch-final goal cannot complete until every other member is complete or superseded-resolved, every member criterion is pass, and a quality gate's coverage counts match the recomputed member criteria. Steering split/supersede mutations keep batch membership consistent and record `batch_updated`.
|
|
27
37
|
|
|
@@ -229,8 +229,8 @@ and utility functions to batch commands and reduce output. Keep direct calls
|
|
|
229
229
|
when one result chooses the next action, outputs are already small, semantic
|
|
230
230
|
judgment is required between calls, approval or side effects are involved,
|
|
231
231
|
or native artifacts / citations must be preserved.
|
|
232
|
-
- Architecture / flow / blast radius →
|
|
233
|
-
|
|
232
|
+
- Architecture / flow / blast radius → explore agents plus LSP references
|
|
233
|
+
and impact; do not guess from conventions.
|
|
234
234
|
- **SYMBOLS REQUIRE LSP** — definitions, references, rename impact,
|
|
235
235
|
workspace symbols, and diagnostics use the available `lsp_*` tools, not
|
|
236
236
|
text search. Run diagnostics after edits and treat errors as blocking.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UlwLoopScope } from "./paths.js";
|
|
2
|
+
import type { UlwLoopItem, UlwLoopPlan } from "./types.js";
|
|
3
|
+
import { UlwLoopError } from "./types.js";
|
|
4
|
+
export declare function validateCheckpointCodexGoal(input: {
|
|
5
|
+
readonly repoRoot: string;
|
|
6
|
+
readonly plan: UlwLoopPlan;
|
|
7
|
+
readonly goal: UlwLoopItem;
|
|
8
|
+
readonly raw: string | undefined;
|
|
9
|
+
readonly evidence: string;
|
|
10
|
+
readonly scope?: UlwLoopScope;
|
|
11
|
+
}): Promise<unknown>;
|
|
12
|
+
export declare function combineCheckpointValidationErrors(codexError: UlwLoopError, gateError: UlwLoopError): UlwLoopError;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { canReconcileActiveFinalTaskScopedAggregateSnapshot, canReconcileCompletedTaskScopedAggregateSnapshot, codexSnapshotMismatchError, } from "./checkpoint-reconciliation.js";
|
|
2
|
+
import { readCodexGoalSnapshotInput, reconcileCodexGoalSnapshot } from "./codex-goal-snapshot.js";
|
|
3
|
+
import { codexGoalMode, compatibleCodexObjectives, expectedCodexObjective, isFinalRunCompletionCandidate, } from "./goal-status.js";
|
|
4
|
+
import { UlwLoopError } from "./types.js";
|
|
5
|
+
function normalizeObjective(value) {
|
|
6
|
+
return value.replace(/\s+/g, " ").trim();
|
|
7
|
+
}
|
|
8
|
+
export async function validateCheckpointCodexGoal(input) {
|
|
9
|
+
const aggregate = codexGoalMode(input.plan) === "aggregate";
|
|
10
|
+
const final = isFinalRunCompletionCandidate(input.plan, input.goal);
|
|
11
|
+
const snapshot = await readCodexGoalSnapshotInput(input.raw, input.repoRoot);
|
|
12
|
+
const expectedObjective = expectedCodexObjective(input.plan, input.goal);
|
|
13
|
+
const reconciliation = reconcileCodexGoalSnapshot(snapshot, {
|
|
14
|
+
expectedObjective,
|
|
15
|
+
...(aggregate ? { acceptedObjectives: compatibleCodexObjectives(input.plan) } : {}),
|
|
16
|
+
allowedStatuses: aggregate ? (final ? ["complete"] : ["active"]) : ["complete"],
|
|
17
|
+
requireSnapshot: true,
|
|
18
|
+
requireComplete: !aggregate || final,
|
|
19
|
+
});
|
|
20
|
+
if (reconciliation.ok)
|
|
21
|
+
return reconciliation.snapshot.raw;
|
|
22
|
+
const objective = snapshot?.objective;
|
|
23
|
+
const mismatchedTaskObjective = snapshot?.available === true &&
|
|
24
|
+
objective !== undefined &&
|
|
25
|
+
normalizeObjective(objective) !== normalizeObjective(expectedObjective);
|
|
26
|
+
const completedTaskScoped = mismatchedTaskObjective &&
|
|
27
|
+
snapshot.status === "complete" &&
|
|
28
|
+
(await canReconcileCompletedTaskScopedAggregateSnapshot(input.repoRoot, input.plan, input.goal, objective, input.evidence, input.scope));
|
|
29
|
+
const activeFinalTaskScoped = mismatchedTaskObjective &&
|
|
30
|
+
snapshot.status === "active" &&
|
|
31
|
+
(await canReconcileActiveFinalTaskScopedAggregateSnapshot(input.repoRoot, input.plan, input.goal, objective, input.evidence, input.scope));
|
|
32
|
+
if (completedTaskScoped || activeFinalTaskScoped)
|
|
33
|
+
return reconciliation.snapshot.raw;
|
|
34
|
+
throw codexSnapshotMismatchError({
|
|
35
|
+
reconciliation,
|
|
36
|
+
snapshot,
|
|
37
|
+
expectedObjective,
|
|
38
|
+
taskScopedHint: { goal: input.goal, aggregate, final },
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export function combineCheckpointValidationErrors(codexError, gateError) {
|
|
42
|
+
return new UlwLoopError(`${codexError.message}\n${gateError.message}`, "ULW_LOOP_QUALITY_GATE_INVALID", {
|
|
43
|
+
details: { ...(codexError.details ?? {}), ...(gateError.details ?? {}) },
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -13,6 +13,7 @@ export interface CodexSnapshotMismatchInput {
|
|
|
13
13
|
readonly final: boolean;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
export declare function combineCheckpointValidationErrors(codexError: UlwLoopError, gateError: UlwLoopError): UlwLoopError;
|
|
16
17
|
export declare function codexSnapshotMismatchError(input: CodexSnapshotMismatchInput): UlwLoopError;
|
|
17
18
|
export declare function canReconcileCompletedTaskScopedAggregateSnapshot(repoRoot: string, plan: UlwLoopPlan, goal: UlwLoopItem, snapshotObjective: string, evidence: string, scope?: UlwLoopScope): Promise<boolean>;
|
|
18
19
|
export declare function canReconcileActiveFinalTaskScopedAggregateSnapshot(repoRoot: string, plan: UlwLoopPlan, goal: UlwLoopItem, snapshotObjective: string, evidence: string, scope?: UlwLoopScope): Promise<boolean>;
|
|
@@ -4,6 +4,11 @@ import { codexGoalMismatchRecovery, formatCodexGoalReconciliation } from "./code
|
|
|
4
4
|
import { codexGoalMode, isFinalRunCompletionCandidate } from "./goal-status.js";
|
|
5
5
|
import { ulwLoopBriefPath } from "./paths.js";
|
|
6
6
|
import { ULW_LOOP_DIR, ULW_LOOP_GOALS, ULW_LOOP_LEDGER, UlwLoopError } from "./types.js";
|
|
7
|
+
export function combineCheckpointValidationErrors(codexError, gateError) {
|
|
8
|
+
return new UlwLoopError(`${codexError.message}\n${gateError.message}`, "ULW_LOOP_QUALITY_GATE_INVALID", {
|
|
9
|
+
details: { ...(codexError.details ?? {}), ...(gateError.details ?? {}) },
|
|
10
|
+
});
|
|
11
|
+
}
|
|
7
12
|
export function codexSnapshotMismatchError(input) {
|
|
8
13
|
const { reconciliation, snapshot, taskScopedHint } = input;
|
|
9
14
|
const hint = taskScopedHint?.aggregate === true && snapshot?.status === "complete" && snapshot.objective !== undefined
|
|
@@ -63,6 +63,7 @@ function gateTemplate(surface, base) {
|
|
|
63
63
|
reportPath: artifactPath(base, "gate-review.md"),
|
|
64
64
|
evidence: "<replace:gate review evidence>",
|
|
65
65
|
blockers: [],
|
|
66
|
+
notes: [],
|
|
66
67
|
},
|
|
67
68
|
iteration: {
|
|
68
69
|
fullRerun: true,
|
|
@@ -101,13 +102,19 @@ export async function checkpointTemplate(repoRoot, scope, goalId) {
|
|
|
101
102
|
throw new UlwLoopError(`Unknown ulw-loop id: ${goalId}.`, "ULW_LOOP_GOAL_NOT_FOUND", { details: { goalId } });
|
|
102
103
|
const hasAttempt = plan.evidenceLayoutVersion === 2 && active !== undefined;
|
|
103
104
|
const attemptDir = hasAttempt ? ulwLoopAttemptEvidenceDir(active.id, active.attempt, scope) : ".omo/evidence";
|
|
105
|
+
const guidance = [
|
|
106
|
+
"codex-goal-json requires goal.objective to equal the plan's codexObjective verbatim; do not paraphrase it.",
|
|
107
|
+
"Fill every <replace:...> value with plausible non-empty evidence and use real, non-empty artifact files.",
|
|
108
|
+
'Passing codex-goal-json example: {"goal":{"objective":"<plan codexObjective verbatim>","status":"complete"}}.',
|
|
109
|
+
'Passing quality-gate-json example requires gateReview {"by":"category:deep","recommendation":"APPROVE","evidence":"review passed","reportPath":"<attemptDir>/gate-review.md","blockers":[],"notes":[]}, manualQa.artifactRefs objects, iteration, and criteriaCoverage.',
|
|
110
|
+
...(hasAttempt ? [] : ["This plan is evidence-layout v1; artifacts go under .omo/evidence/."]),
|
|
111
|
+
].join(" ");
|
|
104
112
|
return {
|
|
105
113
|
qualityGateTemplate: gateTemplate(resolveToolkitSurface(), attemptDir),
|
|
106
114
|
codexGoalTemplate: {
|
|
107
115
|
goal: { objective: plan.codexObjective ?? "<replace:codex objective>", status: "complete" },
|
|
108
116
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
: { guidance: "This plan is evidence-layout v1; artifacts go under .omo/evidence/." }),
|
|
117
|
+
guidance,
|
|
118
|
+
...(hasAttempt ? { attemptDir } : {}),
|
|
112
119
|
};
|
|
113
120
|
}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import { existsSync, statSync } from "node:fs";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
|
-
import {
|
|
6
|
-
import { readCodexGoalSnapshotInput, reconcileCodexGoalSnapshot } from "./codex-goal-snapshot.js";
|
|
5
|
+
import { combineCheckpointValidationErrors, validateCheckpointCodexGoal, } from "./checkpoint-codex-validation.js";
|
|
7
6
|
import { requireAllCriteriaPass, requireAllPlanCriteriaPass, requireEssentialCriteriaPass } from "./evidence.js";
|
|
8
|
-
import { codexGoalMode,
|
|
7
|
+
import { codexGoalMode, isFinalRunCompletionCandidate } from "./goal-status.js";
|
|
9
8
|
import { ulwLoopAttemptEvidenceDir } from "./paths.js";
|
|
10
9
|
import { appendLedger, readUlwLoopPlan, withUlwLoopMutationLock, writePlan } from "./plan-io.js";
|
|
11
10
|
import { classifyExternalAuthorizationBlocker, clearGoalBlockerFields, sameBlockerOccurrences, validateQualityGate, } from "./quality-gate.js";
|
|
@@ -16,9 +15,6 @@ const QUALITY_GATE_FS = { existsSync, statSync };
|
|
|
16
15
|
function ulwLoopFail(message, code) {
|
|
17
16
|
throw new UlwLoopError(message, code);
|
|
18
17
|
}
|
|
19
|
-
function normalizeObjective(value) {
|
|
20
|
-
return value.replace(/\s+/g, " ").trim();
|
|
21
|
-
}
|
|
22
18
|
function nonEmptyEvidence(value) {
|
|
23
19
|
const trimmed = value.trim();
|
|
24
20
|
return trimmed || ulwLoopFail("Evidence must be a non-empty string.", "ulw_loop_evidence_required");
|
|
@@ -127,29 +123,21 @@ export async function checkpointUlwLoop(repoRoot, args, scope) {
|
|
|
127
123
|
requireEssentialCriteriaPass(goal);
|
|
128
124
|
else
|
|
129
125
|
requireAllCriteriaPass(goal);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
snapshot.status === "complete" &&
|
|
146
|
-
(await canReconcileCompletedTaskScopedAggregateSnapshot(repoRoot, plan, goal, objective, evidence, scope));
|
|
147
|
-
const activeFinalTaskScoped = mismatchedTaskObjective &&
|
|
148
|
-
snapshot.status === "active" &&
|
|
149
|
-
(await canReconcileActiveFinalTaskScopedAggregateSnapshot(repoRoot, plan, goal, objective, evidence, scope));
|
|
150
|
-
const taskScoped = completedTaskScoped || activeFinalTaskScoped;
|
|
151
|
-
if (!taskScoped)
|
|
152
|
-
throw codexSnapshotMismatchError({ reconciliation, snapshot, expectedObjective: expectedCodexObjective(plan, goal), taskScopedHint: { goal, aggregate, final } });
|
|
126
|
+
let codexValidationError;
|
|
127
|
+
try {
|
|
128
|
+
codexGoal = await validateCheckpointCodexGoal({
|
|
129
|
+
repoRoot,
|
|
130
|
+
plan,
|
|
131
|
+
goal,
|
|
132
|
+
raw: args.codexGoalJson,
|
|
133
|
+
evidence,
|
|
134
|
+
...(scope === undefined ? {} : { scope }),
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
if (!(error instanceof UlwLoopError))
|
|
139
|
+
throw error;
|
|
140
|
+
codexValidationError = error;
|
|
153
141
|
}
|
|
154
142
|
if (closesBatch)
|
|
155
143
|
requireBatchFinalReady(plan, goal);
|
|
@@ -158,16 +146,25 @@ export async function checkpointUlwLoop(repoRoot, args, scope) {
|
|
|
158
146
|
if (final)
|
|
159
147
|
aggregateCompletion = makeAggregateCompletion(now, evidence, codexGoal);
|
|
160
148
|
if (final || aggregateCompletion !== undefined || closesBatch) {
|
|
161
|
-
|
|
162
|
-
repoRoot,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
149
|
+
try {
|
|
150
|
+
qualityGate = validateQualityGate(await readJsonInput(args.qualityGateJson, repoRoot), {
|
|
151
|
+
repoRoot,
|
|
152
|
+
fs: QUALITY_GATE_FS,
|
|
153
|
+
reviewerSurface: resolveToolkitSurface(),
|
|
154
|
+
...(plan.evidenceLayoutVersion === 2
|
|
155
|
+
? { currentAttemptDir: ulwLoopAttemptEvidenceDir(goal.id, goal.attempt, scope) }
|
|
156
|
+
: {}),
|
|
157
|
+
});
|
|
158
|
+
requireBatchGate(plan, goal, qualityGate);
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
if (!(error instanceof UlwLoopError) || codexValidationError === undefined)
|
|
162
|
+
throw error;
|
|
163
|
+
throw combineCheckpointValidationErrors(codexValidationError, error);
|
|
164
|
+
}
|
|
170
165
|
}
|
|
166
|
+
if (codexValidationError !== undefined)
|
|
167
|
+
throw codexValidationError;
|
|
171
168
|
goal.status = "complete";
|
|
172
169
|
goal.completedAt = now;
|
|
173
170
|
goal.evidence = evidence;
|