codex-orchestrator 2.0.18 → 2.0.19

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +40 -2
  3. package/dist/src/v2/acceptance-proof.d.ts.map +1 -1
  4. package/dist/src/v2/acceptance-proof.js +15 -5
  5. package/dist/src/v2/acceptance-proof.js.map +1 -1
  6. package/dist/src/v2/implementation-reviewer.d.ts +1 -0
  7. package/dist/src/v2/implementation-reviewer.d.ts.map +1 -1
  8. package/dist/src/v2/implementation-reviewer.js +8 -2
  9. package/dist/src/v2/implementation-reviewer.js.map +1 -1
  10. package/dist/src/v2/issue-check-policy.d.ts.map +1 -1
  11. package/dist/src/v2/issue-check-policy.js +25 -9
  12. package/dist/src/v2/issue-check-policy.js.map +1 -1
  13. package/dist/src/v2/run-issue.d.ts +1 -1
  14. package/dist/src/v2/run-issue.d.ts.map +1 -1
  15. package/dist/src/v2/run-issue.js +38 -30
  16. package/dist/src/v2/run-issue.js.map +1 -1
  17. package/dist/src/v2/runtime.js +2 -2
  18. package/dist/src/v2/runtime.js.map +1 -1
  19. package/dist/src/v2/validation-progression.d.ts.map +1 -1
  20. package/dist/src/v2/validation-progression.js +3 -0
  21. package/dist/src/v2/validation-progression.js.map +1 -1
  22. package/internal-workflow/docs/agents/coding-skill-routing.md +4 -0
  23. package/internal-workflow/manifest.json +1 -1
  24. package/internal-workflow/profiles/spec_reviewer.toml +1 -1
  25. package/internal-workflow/profiles/standards_reviewer.toml +1 -1
  26. package/internal-workflow/skills/code-review/SKILL.md +5 -0
  27. package/internal-workflow/skills/implement/SKILL.md +11 -12
  28. package/internal-workflow/skills/implement/evals/evals.json +0 -12
  29. package/internal-workflow/skills/plan/SKILL.md +32 -12
  30. package/internal-workflow/skills/plan/agents/openai.yaml +2 -2
  31. package/internal-workflow/skills/plan/evals/evals.json +27 -0
  32. package/internal-workflow/skills/plan-review/SKILL.md +110 -0
  33. package/internal-workflow/skills/plan-review/agents/openai.yaml +6 -0
  34. package/internal-workflow/skills/plan-review/evals/evals.json +57 -0
  35. package/internal-workflow/skills/tickets-orchestrator/SKILL.md +0 -4
  36. package/internal-workflow/skills/to-spec/SKILL.md +4 -2
  37. package/internal-workflow/skills/to-tickets/SKILL.md +21 -21
  38. package/internal-workflow/skills/to-tickets/evals/evals.json +25 -0
  39. package/package.json +1 -1
@@ -7,11 +7,12 @@ import { adoptActiveAttempt, confirmActiveAttemptCleanup, createActiveAttempt, l
7
7
  import { validateImplementationReport } from './implementation-report.js';
8
8
  import { validateCompletedReport } from './contained-report-operation.js';
9
9
  import { directReviewCandidateTargetFingerprint, projectTerminalDirectReview, } from './direct-delivery.js';
10
+ import { MAX_REVIEW_PATCH_BYTES } from './implementation-reviewer.js';
10
11
  import { CandidateProofInspectionError, ProofLaunchAuthorizationError } from './acceptance-proof.js';
11
12
  import { CheckProcessQuiescenceError, resolveIssueCheckPolicy } from './issue-check-policy.js';
12
13
  import { IssueInitializationUnrecoverableError, WorkflowGenerationUnrecoverableError, } from './run-store.js';
13
14
  import { createPendingEffect } from './run-store.js';
14
- import { blockReviewFeedback, initializeReviewFeedback, projectReviewFeedbackBatch, publishReviewFeedback, respondReviewFeedback, reserveNextReviewFeedbackRound, settleReviewFeedbackResponse, } from './review-feedback.js';
15
+ import { blockReviewFeedback, initializeReviewFeedback, projectReviewFeedbackBatch, publishReviewFeedback, respondReviewFeedback, settleReviewFeedbackResponse, } from './review-feedback.js';
15
16
  import { createIssueDeliveryAuthority } from './delivery-authority.js';
16
17
  import { claimComment, claimRunId, freezeCriteria, historicalClaimCounts, isClaimMarkerComment, isExactClaimMarkerLine, isAdoptableAttempt, observedHistoricalClaimKeys, outcomeEvidenceBytes, publicOutcome, publicIssueSnapshot, refreshClaimedIssueSnapshot, snapshotIssue, sameInspectionIdentity, sameStrings, semanticChangesMatch, } from './run-state-projections.js';
17
18
  import { applyValidationTransition, nextValidationTransition, projectValidationFeedbackActivation, projectValidationProofPassed, projectValidationProofStart, projectValidationRepair, projectValidationReviewApproved, projectValidationReviewNeedsWork, projectValidationReviewReportRepair, projectValidationReviewTransportRetry, } from './validation-progression.js';
@@ -397,15 +398,15 @@ export class RunIssue {
397
398
  if (recaptured.value.bindingId !== candidateBinding.bindingId) {
398
399
  await candidate.releasePin({ binding: recaptured.value, expectedPinnedCommitSha: recaptured.value.candidateCommitSha });
399
400
  }
400
- const released = await this.clearAndReleaseCandidate(active);
401
- if ('status' in released)
402
- return released;
403
- const reopened = await this.persist(released.active, {
404
- lifecycle: 'implementing',
405
- reviewFeedback: reserveNextReviewFeedbackRound(feedback),
406
- reworkFindings: ['The issue worktree changed after proof; rebuild and revalidate the review-feedback candidate.'],
407
- checks: [], checkedChangeSha256: undefined, proofId: undefined, proofReceipt: undefined,
408
- });
401
+ const summary = 'The issue worktree changed after proof; rebuild and revalidate the review-feedback candidate.';
402
+ const reopened = await this.startNextCycleFromCandidate(active, [summary], [{
403
+ provenance: 'proof',
404
+ sourceId: `proof:${active.record.proofId}:candidate-worktree-drift`,
405
+ summary,
406
+ affectedContracts: ['acceptance-proof'],
407
+ }]);
408
+ if ('status' in reopened)
409
+ return reopened;
409
410
  return this.invokedFailure(reopened, 'review-feedback-candidate-worktree-drift', 'The next review-feedback repair round is ready.');
410
411
  }
411
412
  active = await this.persist(active, { pendingEffect: {
@@ -847,6 +848,7 @@ export class RunIssue {
847
848
  activation.changes.checks = structuredClone(ready.record.checks);
848
849
  activation.changes.checkedChangeSha256 = ready.record.checkedChangeSha256;
849
850
  activation.changes.proofId = ready.record.proofId;
851
+ activation.changes.proofExecution = structuredClone(ready.record.proofExecution);
850
852
  activation.changes.proofReceipt = structuredClone(ready.record.proofReceipt);
851
853
  activation.changes.implementationResult = structuredClone(ready.record.implementationResult);
852
854
  activation.changes.terminalNotifications = undefined;
@@ -1370,6 +1372,10 @@ export class RunIssue {
1370
1372
  transportRetries: active.record.transportRetries,
1371
1373
  reportRepairs: 0,
1372
1374
  implementationResult: { summary: report.summary, residualRisks: report.residualRisks },
1375
+ checkedChangeSha256: undefined,
1376
+ proofId: undefined,
1377
+ proofExecution: undefined,
1378
+ proofReceipt: undefined,
1373
1379
  });
1374
1380
  active = await this.clearAttempt(active);
1375
1381
  }
@@ -1398,23 +1404,7 @@ export class RunIssue {
1398
1404
  if (progression.phase !== 'checks' && progression.phase !== 'acceptance-proof') {
1399
1405
  return await this.terminal(active, { status: 'internal-error', code: 'validation-progression-checks-invalid' });
1400
1406
  }
1401
- let checkPolicy;
1402
- try {
1403
- checkPolicy = resolveIssueCheckPolicy(active.record.issueSnapshot.body, config.checks);
1404
- }
1405
- catch (error) {
1406
- const detail = error instanceof Error ? error.message : 'Verification policy is invalid.';
1407
- return await this.terminal(active, {
1408
- status: 'blocked', kind: 'decision-delta', resumable: false,
1409
- blocker: {
1410
- kind: 'decision-delta',
1411
- summary: 'The unchanged issue Verification policy is malformed or unsafe and cannot be executed as authority.',
1412
- attempted: ['Parsed the issue Verification section against the configured command safety policy.'],
1413
- resumable: false,
1414
- reviewerRejectionDetail: detail,
1415
- },
1416
- }, 'issue-verification-invalid');
1417
- }
1407
+ const checkPolicy = resolveIssueCheckPolicy(active.record.issueSnapshot.body, config.checks);
1418
1408
  const finalBinding = active.record.candidateBinding;
1419
1409
  if (!finalBinding)
1420
1410
  return await this.terminal(active, { status: 'blocked', kind: 'safety', resumable: true }, 'candidate-git-v2-required');
@@ -1905,7 +1895,7 @@ export class RunIssue {
1905
1895
  if (Object.hasOwn(changes, 'terminalOutcome') && changes.terminalOutcome === undefined
1906
1896
  && !Object.hasOwn(changes, 'terminalNotifications'))
1907
1897
  delete record.terminalNotifications;
1908
- for (const key of ['checkedChangeSha256', 'proofId', 'proofReceipt', 'terminalOutcome', 'outcomeEvidenceId', 'reviewFeedback', 'changeBindingVersion', 'candidateBinding', 'candidateMaterialization', 'activeAttempt', 'terminalNotifications']) {
1898
+ for (const key of ['checkedChangeSha256', 'proofId', 'proofExecution', 'proofReceipt', 'terminalOutcome', 'outcomeEvidenceId', 'reviewFeedback', 'changeBindingVersion', 'candidateBinding', 'candidateMaterialization', 'activeAttempt', 'terminalNotifications']) {
1909
1899
  if (Object.hasOwn(changes, key) && changes[key] === undefined)
1910
1900
  delete record[key];
1911
1901
  }
@@ -2525,7 +2515,7 @@ export class RunIssue {
2525
2515
  throw new Error('review scope requires candidate identity');
2526
2516
  const completeDiff = await this.dependencies.git.diffTrees(active.record.worktreePath, active.record.baseSha, binding.candidateTreeSha);
2527
2517
  if (completeDiff.changedFiles.length === 0 || completeDiff.patch.trim().length === 0
2528
- || Buffer.byteLength(completeDiff.patch, 'utf8') > 1024 * 1024
2518
+ || Buffer.byteLength(completeDiff.patch, 'utf8') > MAX_REVIEW_PATCH_BYTES
2529
2519
  || containsCredentialEvidence(completeDiff.patch)
2530
2520
  || completeDiff.changedFiles.some((path) => findDeniedPathMatch(path, deniedPaths))) {
2531
2521
  throw new Error('exact complete Review target is unavailable');
@@ -2578,7 +2568,7 @@ export class RunIssue {
2578
2568
  || defect.affectedTargets.some((target) => !directImpact.has(target)));
2579
2569
  const isolated = treeDiff.changedFiles.length > 0 && repairedBlockerIds.length > 0
2580
2570
  && treeDiff.patch.trim().length > 0
2581
- && Buffer.byteLength(treeDiff.patch, 'utf8') <= 1024 * 1024
2571
+ && Buffer.byteLength(treeDiff.patch, 'utf8') <= MAX_REVIEW_PATCH_BYTES
2582
2572
  && !containsCredentialEvidence(treeDiff.patch)
2583
2573
  && !treeDiff.changedFiles.some((path) => findDeniedPathMatch(path, deniedPaths))
2584
2574
  && !retainedOutOfConeDefect;
@@ -2911,6 +2901,24 @@ export class RunIssue {
2911
2901
  return this.terminal(active, { status: 'transport-failed', resumable: proof.resumable });
2912
2902
  if (proof.status === 'cancelled')
2913
2903
  return this.terminal(active, { status: 'cancelled' });
2904
+ if (proof.status === 'internal-error') {
2905
+ try {
2906
+ await this.dependencies.writeEvidence({
2907
+ runId: active.record.runId,
2908
+ code: 'acceptance-proof-diagnostic',
2909
+ summary: canonicalJson({
2910
+ summary: publicBlockedText(proof.receipt.summary, 'Proof failure detail was redacted.', 1024),
2911
+ packageVersion: active.record.packageVersion,
2912
+ workflowGenerationHash: active.record.workflowGeneration.generationHash,
2913
+ workflowManifestSha256: active.record.workflowGeneration.manifestSha256,
2914
+ candidateCommitSha: active.record.candidateBinding?.candidateCommitSha ?? null,
2915
+ }),
2916
+ });
2917
+ }
2918
+ catch {
2919
+ // Diagnostic storage is best-effort; it cannot authorize proof or prevent the safe terminal outcome.
2920
+ }
2921
+ }
2914
2922
  return this.terminal(active, { status: 'internal-error', code: 'acceptance-proof-internal-failure' });
2915
2923
  }
2916
2924
  async revoked(active) {