@vela-science/canopus 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +67 -145
  3. package/capsules/erdos1056-k15/bin/linux-arm64/{10428801-10429000 → 10429201-10429400}/verifier +0 -0
  4. package/capsules/erdos1056-k15/bin/linux-x86_64/{10428801-10429000 → 10429201-10429400}/verifier +0 -0
  5. package/compatibility.json +25 -0
  6. package/dist/src/{receipt/map.d.ts → candidate/finalize.d.ts} +2 -9
  7. package/dist/src/candidate/finalize.js +71 -0
  8. package/dist/src/cli.js +89 -195
  9. package/dist/src/contracts/mission.d.ts +1 -13
  10. package/dist/src/contracts/mission.js +4 -42
  11. package/dist/src/contracts/validation.d.ts +1 -25
  12. package/dist/src/contracts/validation.js +1 -95
  13. package/dist/src/engines/codex-tools-native.js +2 -2
  14. package/dist/src/index.d.ts +5 -34
  15. package/dist/src/index.js +4 -34
  16. package/dist/src/mission/prepare.d.ts +10 -1
  17. package/dist/src/mission/prepare.js +29 -30
  18. package/dist/src/product/coverage.d.ts +17 -0
  19. package/dist/src/product/coverage.js +137 -0
  20. package/dist/src/product/doctor.d.ts +1 -2
  21. package/dist/src/product/doctor.js +29 -8
  22. package/dist/src/product/profile.js +8 -2
  23. package/dist/src/product/replay.js +11 -12
  24. package/dist/src/product/run.d.ts +5 -9
  25. package/dist/src/product/run.js +17 -81
  26. package/dist/src/product/submission.d.ts +40 -0
  27. package/dist/src/product/submission.js +217 -0
  28. package/dist/src/product/submit.d.ts +22 -0
  29. package/dist/src/product/submit.js +264 -0
  30. package/dist/src/product/version.d.ts +2 -2
  31. package/dist/src/product/version.js +27 -4
  32. package/dist/src/projection/current-run.d.ts +12 -0
  33. package/dist/src/projection/current-run.js +94 -0
  34. package/dist/src/projection/failure.d.ts +17 -7
  35. package/dist/src/projection/failure.js +43 -12
  36. package/dist/src/projection/retained-mission.d.ts +6 -0
  37. package/dist/src/projection/retained-mission.js +41 -0
  38. package/dist/src/projection/retained-run.d.ts +7 -0
  39. package/dist/src/projection/retained-run.js +50 -0
  40. package/dist/src/run.d.ts +43 -34
  41. package/dist/src/run.js +34 -397
  42. package/dist/src/util/canonical.d.ts +1 -5
  43. package/dist/src/util/canonical.js +1 -53
  44. package/dist/src/vela/cli.d.ts +7 -42
  45. package/dist/src/vela/cli.js +102 -475
  46. package/dist/src/vela/types.d.ts +3 -19
  47. package/dist/src/verifier/run.js +1 -1
  48. package/dist/src/workspace/prepare.d.ts +1 -1
  49. package/dist/src/workspace/prepare.js +15 -15
  50. package/docs/EVALUATION.md +142 -0
  51. package/docs/MISSIONS.md +42 -80
  52. package/docs/RUN_RECORD.md +77 -99
  53. package/docs/adr/0010-nonmutating-runs-and-explicit-submission.md +191 -0
  54. package/missions/erdos1056-k15-next/mission.draft.json +10 -8
  55. package/package.json +18 -15
  56. package/profiles/{erdos1056-k15-10428801-10429000.json → erdos1056-k15-10429201-10429400.json} +10 -10
  57. package/schemas/failure.v1.json +17 -0
  58. package/schemas/mission.v0.json +3 -4
  59. package/schemas/mission.v1.json +7 -28
  60. package/schemas/{run.v1.json → run.v2.json} +58 -116
  61. package/schemas/submission-bundle.v1.json +63 -0
  62. package/toolchain.lock.json +31 -0
  63. package/capsules/formal-erdos-505-test-dim-one/verifier +0 -105
  64. package/capsules/quantum-10-1-4/verifier.py +0 -152
  65. package/capsules/sidon-a24/bin/linux-arm64/verifier +0 -0
  66. package/capsules/sidon-a24/bin/linux-x86_64/verifier +0 -0
  67. package/dist/src/engines/codex-exec.d.ts +0 -17
  68. package/dist/src/engines/codex-exec.js +0 -136
  69. package/dist/src/engines/codex-tool-free.d.ts +0 -26
  70. package/dist/src/engines/codex-tool-free.js +0 -213
  71. package/dist/src/projection/diagnostic.d.ts +0 -12
  72. package/dist/src/projection/diagnostic.js +0 -61
  73. package/dist/src/projection/public-run.d.ts +0 -59
  74. package/dist/src/projection/public-run.js +0 -106
  75. package/dist/src/projection/publication.d.ts +0 -36
  76. package/dist/src/projection/publication.js +0 -47
  77. package/dist/src/projection/run.d.ts +0 -95
  78. package/dist/src/projection/run.js +0 -173
  79. package/dist/src/receipt/map.js +0 -168
  80. package/dist/src/repair/plan.d.ts +0 -2
  81. package/dist/src/repair/plan.js +0 -22
  82. package/dist/src/roles.d.ts +0 -2
  83. package/dist/src/roles.js +0 -9
  84. package/missions/formal-erdos-505-test-dim-one-gpt56/mission.draft.json +0 -40
  85. package/missions/quantum-10-1-4-retry/mission.draft.json +0 -40
  86. package/missions/sidon-a24-at-least-7194-gpt56/mission.draft.json +0 -42
  87. package/missions/sidon-a24-at-least-7194-gpt56-v2/mission.draft.json +0 -42
  88. package/missions/sidon-a24-at-least-7194-gpt56-v3/mission.draft.json +0 -42
  89. package/profiles/formal-erdos-505-test-dim-one-gpt56.json +0 -35
  90. package/profiles/quantum-10-1-4-stabilizer-retry.json +0 -35
  91. package/profiles/sidon-a24-at-least-7194-gpt56-v2.json +0 -35
  92. package/profiles/sidon-a24-at-least-7194-gpt56-v3.json +0 -35
  93. package/profiles/sidon-a24-at-least-7194-gpt56.json +0 -35
  94. package/schemas/canopus.public-run.v1.json +0 -116
@@ -0,0 +1,50 @@
1
+ import { exactKeys, gitObjectAt, objectAt, sha256At, } from "../contracts/validation.js";
2
+ import { canonicalJcs, canonicalJson, sha256Bytes } from "../util/canonical.js";
3
+ import { parseCurrentRunRecord } from "./current-run.js";
4
+ export function normalizeRetainedRunRoots(value, at) {
5
+ const roots = objectAt(value, at);
6
+ if (roots.vela_repository !== undefined) {
7
+ exactKeys(roots, ["git_commit", "git_tree", "vela_repository"], [], at);
8
+ return {
9
+ git_commit: gitObjectAt(roots.git_commit, `${at}.git_commit`),
10
+ git_tree: gitObjectAt(roots.git_tree, `${at}.git_tree`),
11
+ vela_repository: sha256At(roots.vela_repository, `${at}.vela_repository`),
12
+ };
13
+ }
14
+ exactKeys(roots, ["git_commit", "git_tree", "vela_event_log", "vela_snapshot"], [], at);
15
+ // Current writers emit vela_repository. Retained Run v2 bytes from the
16
+ // predecessor era instead bind event-log and snapshot roots. Readers verify
17
+ // those immutable roots and normalize only an in-memory copy.
18
+ sha256At(roots.vela_event_log, `${at}.vela_event_log`);
19
+ return {
20
+ git_commit: gitObjectAt(roots.git_commit, `${at}.git_commit`),
21
+ git_tree: gitObjectAt(roots.git_tree, `${at}.git_tree`),
22
+ vela_repository: sha256At(roots.vela_snapshot, `${at}.vela_snapshot`),
23
+ };
24
+ }
25
+ export function parseRetainedRunRecord(value) {
26
+ const raw = objectAt(value, "retained Run");
27
+ const mission = objectAt(raw.mission, "retained Run.mission");
28
+ const reproduction = objectAt(raw.reproduction, "retained Run.reproduction");
29
+ const startingRoots = objectAt(mission.starting_roots, "retained Run.mission.starting_roots");
30
+ const reproductionRoots = objectAt(reproduction.roots, "retained Run.reproduction.roots");
31
+ if (canonicalJcs(startingRoots) !== canonicalJcs(reproductionRoots)) {
32
+ throw new Error("retained Run starting and reproduction roots disagree");
33
+ }
34
+ const normalized = {
35
+ ...raw,
36
+ mission: {
37
+ ...mission,
38
+ starting_roots: normalizeRetainedRunRoots(startingRoots, "retained Run.mission.starting_roots"),
39
+ },
40
+ reproduction: {
41
+ ...reproduction,
42
+ roots: normalizeRetainedRunRoots(reproductionRoots, "retained Run.reproduction.roots"),
43
+ },
44
+ };
45
+ return {
46
+ record: parseCurrentRunRecord(normalized),
47
+ exactRoot: sha256Bytes(canonicalJson(raw)),
48
+ exactStartingRoots: canonicalJcs(startingRoots),
49
+ };
50
+ }
package/dist/src/run.d.ts CHANGED
@@ -1,20 +1,12 @@
1
- import type { Mission, MissionRoots, StrictBaseline } from "./contracts/mission.js";
2
- import type { FrozenArtifact } from "./contracts/candidate.js";
1
+ import type { Mission, MissionRoots } from "./contracts/mission.js";
3
2
  import type { Engine } from "./engines/engine.js";
4
- import { type RunProjection, type RunRecord } from "./projection/run.js";
5
- import { type CommandRunner } from "./util/command.js";
6
- import type { AuthoredReceiptInput, VelaClient, VelaLandCommandObservation } from "./vela/cli.js";
7
- import type { LandResult, VelaCommandResponse, VelaInspection } from "./vela/types.js";
3
+ import type { CommandRunner } from "./util/command.js";
4
+ import type { VelaClient } from "./vela/cli.js";
5
+ import type { VelaCommandResponse, VelaInspection } from "./vela/types.js";
8
6
  import { type WorkspacePaths } from "./workspace/prepare.js";
9
7
  export interface VelaPort {
10
- assertRoots(repoRoot: string, frontier: string, expected: MissionRoots, strictBaseline?: StrictBaseline): Promise<VelaInspection>;
11
- inspect(repoRoot: string, frontier: string, strictBaseline?: StrictBaseline): Promise<VelaInspection>;
8
+ assertRoots(repoRoot: string, frontier: string, expected: MissionRoots): Promise<VelaInspection>;
12
9
  next(mission: Mission, repoRoot: string): Promise<VelaCommandResponse>;
13
- work(mission: Mission, repoRoot: string, target: string, expected: MissionRoots): Promise<VelaCommandResponse>;
14
- landAuthoredCommand(mission: Mission, repoRoot: string, input: AuthoredReceiptInput, expected: MissionRoots): Promise<VelaLandCommandObservation>;
15
- parseLandCommand(observation: VelaLandCommandObservation): Record<string, unknown>;
16
- validateLandResult(mission: Mission, raw: Record<string, unknown>): LandResult;
17
- verifyReceiptBinding(mission: Mission, repoRoot: string, landing: LandResult, input: AuthoredReceiptInput, artifacts: readonly FrozenArtifact[]): Promise<void>;
18
10
  }
19
11
  export interface CanopusRunOptions {
20
12
  mission: Mission;
@@ -25,21 +17,40 @@ export interface CanopusRunOptions {
25
17
  bundleRoot?: string;
26
18
  dockerBinary?: string;
27
19
  verifierRunner?: CommandRunner;
28
- noLand?: false;
29
20
  }
30
- export interface CanopusNoLandOptions extends Omit<CanopusRunOptions, "noLand"> {
31
- noLand: true;
21
+ export interface VerifierRun {
22
+ status: "passed" | "failed" | "error";
23
+ sandbox: "macos_sandbox" | "container_network_denied";
24
+ record: {
25
+ argv: string[];
26
+ executable_digest: string;
27
+ exit_code: number;
28
+ stdout_digest: string;
29
+ stderr_digest: string;
30
+ duration_ms: number;
31
+ };
32
32
  }
33
- export interface CanopusRunResult {
34
- record: RunRecord;
35
- projection: RunProjection;
36
- paths: WorkspacePaths;
33
+ export interface ReproductionResult {
34
+ matched: boolean;
35
+ roots: MissionRoots;
36
+ verifier_status: "passed" | "failed" | "error";
37
+ stdout_digest: string;
38
+ stderr_digest: string;
39
+ }
40
+ export interface RunBudget {
41
+ research_elapsed_ms: number;
42
+ research_processes: number;
43
+ research_output_bytes: number;
44
+ prompt_bytes: number;
45
+ artifact_bytes: number;
46
+ attempts: number;
47
+ observed_tokens: number;
37
48
  }
38
- export interface DiagnosticRunRecord {
39
- schema: "canopus.diagnostic-run.v1";
49
+ export interface CurrentRunRecord {
50
+ schema: "canopus.run.v2";
40
51
  run_id: string;
41
52
  status: "completed";
42
- mode: "no_land";
53
+ effect: "none";
43
54
  authority: "non_authoritative";
44
55
  external_gate_credit: false;
45
56
  mission: {
@@ -60,21 +71,21 @@ export interface DiagnosticRunRecord {
60
71
  }>;
61
72
  caveats: string[];
62
73
  };
63
- verifier: RunRecord["verifier"];
64
- landing: null;
65
- reproduction: RunRecord["reproduction"];
66
- budget: RunRecord["budget"];
74
+ verifier: VerifierRun;
75
+ submission: null;
76
+ reproduction: ReproductionResult;
77
+ budget: RunBudget;
67
78
  }
68
- export interface CanopusDiagnosticRunResult {
69
- record: DiagnosticRunRecord;
79
+ export interface CanopusCurrentRunResult {
80
+ record: CurrentRunRecord;
70
81
  projection: {
71
- schema: "canopus.diagnostic-projection.v1";
82
+ schema: "canopus.run-projection.v2";
72
83
  authority: "read_only_projection";
73
84
  run_id: string;
74
85
  target: string;
75
86
  candidate_digest: string;
76
87
  verifier_status: "passed" | "failed" | "error";
77
- landed: false;
88
+ submitted: false;
78
89
  clean_clone_reproduced: boolean;
79
90
  };
80
91
  paths: WorkspacePaths;
@@ -83,6 +94,4 @@ export declare function validateTargetOffer(target: string, response: VelaComman
83
94
  index: number;
84
95
  id: string;
85
96
  };
86
- export declare function isPrivateWorkSessionStatus(entry: string): boolean;
87
- export declare function runCanopus(options: CanopusNoLandOptions): Promise<CanopusDiagnosticRunResult>;
88
- export declare function runCanopus(options: CanopusRunOptions): Promise<CanopusRunResult>;
97
+ export declare function runCanopus(options: CanopusRunOptions): Promise<CanopusCurrentRunResult>;