@on-par/factory-core 0.9.24-next.2 → 0.9.24-next.3

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 (71) hide show
  1. package/README.md +6 -6
  2. package/dist/fakes/latency.d.ts.map +1 -0
  3. package/dist/{sim → fakes}/latency.js +1 -1
  4. package/dist/fakes/latency.js.map +1 -0
  5. package/dist/fakes/model.d.ts.map +1 -0
  6. package/dist/{sim → fakes}/model.js +1 -1
  7. package/dist/fakes/model.js.map +1 -0
  8. package/dist/fakes/octokit.d.ts.map +1 -0
  9. package/dist/{sim → fakes}/octokit.js +1 -1
  10. package/dist/fakes/octokit.js.map +1 -0
  11. package/dist/fakes/workspace.d.ts.map +1 -0
  12. package/dist/{sim → fakes}/workspace.js +1 -1
  13. package/dist/fakes/workspace.js.map +1 -0
  14. package/dist/public-api-keys.d.ts.map +1 -1
  15. package/dist/public-api-keys.js +0 -26
  16. package/dist/public-api-keys.js.map +1 -1
  17. package/dist/router/stub.js +1 -1
  18. package/dist/router/stub.js.map +1 -1
  19. package/dist/run/ports.d.ts +1 -1
  20. package/dist/run/ports.d.ts.map +1 -1
  21. package/dist/spec/index.js +1 -1
  22. package/dist/spec/index.js.map +1 -1
  23. package/dist/testing.d.ts +8 -2
  24. package/dist/testing.d.ts.map +1 -1
  25. package/dist/testing.js +4 -1
  26. package/dist/testing.js.map +1 -1
  27. package/package.json +5 -5
  28. package/dist/sim/index.d.ts +0 -22
  29. package/dist/sim/index.d.ts.map +0 -1
  30. package/dist/sim/index.js +0 -12
  31. package/dist/sim/index.js.map +0 -1
  32. package/dist/sim/jitter.d.ts +0 -65
  33. package/dist/sim/jitter.d.ts.map +0 -1
  34. package/dist/sim/jitter.js +0 -152
  35. package/dist/sim/jitter.js.map +0 -1
  36. package/dist/sim/latency.d.ts.map +0 -1
  37. package/dist/sim/latency.js.map +0 -1
  38. package/dist/sim/model.d.ts.map +0 -1
  39. package/dist/sim/model.js.map +0 -1
  40. package/dist/sim/monte-carlo-cli.d.ts +0 -27
  41. package/dist/sim/monte-carlo-cli.d.ts.map +0 -1
  42. package/dist/sim/monte-carlo-cli.js +0 -151
  43. package/dist/sim/monte-carlo-cli.js.map +0 -1
  44. package/dist/sim/monte-carlo.d.ts +0 -63
  45. package/dist/sim/monte-carlo.d.ts.map +0 -1
  46. package/dist/sim/monte-carlo.js +0 -164
  47. package/dist/sim/monte-carlo.js.map +0 -1
  48. package/dist/sim/octokit.d.ts.map +0 -1
  49. package/dist/sim/octokit.js.map +0 -1
  50. package/dist/sim/pipeline.d.ts +0 -89
  51. package/dist/sim/pipeline.d.ts.map +0 -1
  52. package/dist/sim/pipeline.js +0 -290
  53. package/dist/sim/pipeline.js.map +0 -1
  54. package/dist/sim/regressions.d.ts +0 -20
  55. package/dist/sim/regressions.d.ts.map +0 -1
  56. package/dist/sim/regressions.js +0 -106
  57. package/dist/sim/regressions.js.map +0 -1
  58. package/dist/sim/ship-phase-breakdown-cli.d.ts +0 -9
  59. package/dist/sim/ship-phase-breakdown-cli.d.ts.map +0 -1
  60. package/dist/sim/ship-phase-breakdown-cli.js +0 -23
  61. package/dist/sim/ship-phase-breakdown-cli.js.map +0 -1
  62. package/dist/sim/types.d.ts +0 -3
  63. package/dist/sim/types.d.ts.map +0 -1
  64. package/dist/sim/types.js +0 -4
  65. package/dist/sim/types.js.map +0 -1
  66. package/dist/sim/workspace.d.ts.map +0 -1
  67. package/dist/sim/workspace.js.map +0 -1
  68. /package/dist/{sim → fakes}/latency.d.ts +0 -0
  69. /package/dist/{sim → fakes}/model.d.ts +0 -0
  70. /package/dist/{sim → fakes}/octokit.d.ts +0 -0
  71. /package/dist/{sim → fakes}/workspace.d.ts +0 -0
@@ -1,290 +0,0 @@
1
- // packages/core/src/sim/pipeline.ts — headless simulator: drives synthetic issue specs
2
- // through the real PLAN -> BUILD -> CHECK -> SHIP phase functions against fake doubles
3
- // this module owns, inside a throwaway local git workspace. No real model provider or
4
- // GitHub call is reachable through this API by construction.
5
- import { writeFile } from 'node:fs/promises';
6
- import { join } from 'node:path';
7
- import matter from 'gray-matter';
8
- import { buildPhase } from '../phases/build.js';
9
- import { checkPhase } from '../phases/check.js';
10
- import { planPhase } from '../phases/plan.js';
11
- import { shipPhase } from '../phases/ship.js';
12
- import { ModelRouter } from '../router/index.js';
13
- import { branchFor, cleanupWorktree, setupWorktree } from '../utils/index.js';
14
- import { workKeyFromIssue } from '../work/work-key.js';
15
- import { withGitLock } from '../utils/lock.js';
16
- import { deriveSimSeed, SimJitter, SimJitterExecutor, withSimJitter, } from './jitter.js';
17
- import { realSimClock } from './latency.js';
18
- import { SimModelExecutor } from './model.js';
19
- import { asPhaseOctokit, createSimOctokit } from './octokit.js';
20
- import { createSimWorkspace, simCommitAll } from './workspace.js';
21
- const DEFAULT_REPO = 'on-par/software-factory-sim';
22
- export function simModelsConfig() {
23
- return {
24
- version: 1,
25
- models: {
26
- 'stub-model': {
27
- provider: 'custom',
28
- tier: 'boss',
29
- costPerMtokInput: 0,
30
- costPerMtokOutput: 0,
31
- contextWindow: 1000,
32
- capabilities: [],
33
- envKey: null,
34
- },
35
- },
36
- tiers: { boss: ['stub-model'] },
37
- failover: {
38
- triggers: ['rate_limit', 'unavailable', 'auth'],
39
- maxRetries: 2,
40
- cooldownMs: 0,
41
- },
42
- routingRules: {},
43
- };
44
- }
45
- export function simRoutesConfig() {
46
- return {
47
- version: 1,
48
- routes: {
49
- plan: { tier: 'boss', description: 'sim' },
50
- readiness_enrich: { tier: 'boss', description: 'sim' },
51
- build_claude: { tier: 'boss', description: 'sim' },
52
- build_codex: { tier: 'boss', description: 'sim' },
53
- },
54
- };
55
- }
56
- export function simSpecContent(issue, title, route = 'claude') {
57
- const frontmatter = {
58
- route,
59
- design: {
60
- restatedProblem: `Simulated issue #${issue}: ${title}.`,
61
- approach: {
62
- chosen: 'Apply the scripted simulation build step to the throwaway worktree.',
63
- rejected: [{ option: 'Leave the worktree untouched', reason: 'The issue requires a committed change.' }],
64
- },
65
- interfacesTouched: [`feature-${issue}.txt`],
66
- targetTypes: [{ name: `SimFeature${issue}`, file: `feature-${issue}.txt`, kind: 'added' }],
67
- signatures: [
68
- {
69
- symbol: `simFeature${issue}`,
70
- file: `feature-${issue}.txt`,
71
- signature: `export const simFeature${issue}: string`,
72
- },
73
- ],
74
- callGraph: [
75
- { from: 'runSimulation', to: `simFeature${issue}`, note: 'the simulated build step writes this file' },
76
- ],
77
- behaviorContract: [`feature-${issue}.txt exists in the worktree after BUILD`],
78
- verificationPlan: [{ command: 'true', passWhen: 'the checker sequence passes' }],
79
- riskBlastRadius: 'None — confined to a throwaway simulated workspace.',
80
- openQuestions: [],
81
- },
82
- };
83
- const body = `# Spec: ${title} (#${issue})
84
- ## Goal
85
- Exercise the phase pipeline against a throwaway repository.
86
- ## Files / approach
87
- Use the scripted simulation executor to mutate the worktree.
88
- ## Tests
89
- Run the built-in checker sequence.
90
- ## Constitution compliance
91
- N/A — no constitution
92
- ## Non-goals
93
- No network calls.
94
- `;
95
- return matter.stringify(body, frontmatter);
96
- }
97
- export function simDefaultScripts(issue, title) {
98
- const buildStep = {
99
- output: 'built',
100
- effect: async (ctx) => {
101
- await writeSimFeatureFile(ctx.worktree, issue);
102
- await simCommitAll(ctx.worktree, `feat: sim issue ${issue}`);
103
- },
104
- };
105
- return {
106
- plan: [{ output: simSpecContent(issue, title) }],
107
- build_claude: [buildStep],
108
- build_codex: [buildStep],
109
- };
110
- }
111
- async function writeSimFeatureFile(worktree, issue) {
112
- await writeFile(join(worktree, `feature-${issue}.txt`), `simulated build for issue #${issue}\n`);
113
- }
114
- export async function runSimulation(options) {
115
- const owned = !options.workspace;
116
- const workspace = options.workspace ?? (await createSimWorkspace());
117
- const repo = options.repo ?? DEFAULT_REPO;
118
- const outcomes = [];
119
- try {
120
- for (const spec of options.issues) {
121
- // Sequential, on purpose — determinism is the point of this simulator; concurrency
122
- // belongs to the Monte Carlo runner (#566).
123
- outcomes.push(await runSimIssue(spec, workspace, repo, options));
124
- }
125
- }
126
- finally {
127
- if (owned)
128
- await workspace.dispose();
129
- }
130
- const totals = { shipped: 0, parked: 0, escalated: 0 };
131
- let modelCalls = 0;
132
- let githubCalls = 0;
133
- let injectedFailures = 0;
134
- for (const outcome of outcomes) {
135
- totals[outcome.state]++;
136
- modelCalls += outcome.modelCalls.length;
137
- githubCalls += outcome.githubCalls.length;
138
- injectedFailures += outcome.jitterDraws.filter((d) => d.failure !== null).length;
139
- }
140
- return { outcomes, totals, modelCalls, githubCalls, injectedFailures };
141
- }
142
- async function runSimIssue(spec, workspace, repo, options) {
143
- const events = [];
144
- const log = (phase) => (type, msg, extra) => {
145
- const event = {
146
- phase,
147
- type,
148
- msg,
149
- ts: new Date().toISOString(),
150
- ...(extra?.durationMs !== undefined ? { durationMs: extra.durationMs } : {}),
151
- };
152
- events.push(event);
153
- options.onEvent?.(spec.issue, event);
154
- };
155
- const executor = new SimModelExecutor({
156
- scripts: spec.scripts ?? simDefaultScripts(spec.issue, spec.title),
157
- defaultStep: { output: '' },
158
- latency: options.latency,
159
- clock: options.clock,
160
- });
161
- const { octokit, calls: githubCalls } = createSimOctokit({
162
- titles: { [spec.issue]: spec.title },
163
- bodies: spec.body ? { [spec.issue]: spec.body } : {},
164
- endpoints: spec.endpoints,
165
- latency: options.latency,
166
- clock: options.clock,
167
- });
168
- const branch = branchFor(workKeyFromIssue(spec.issue), spec.title);
169
- const specPath = join(workspace.plansDir, `issue-${spec.issue}.md`);
170
- const worktree = `${workspace.repoRoot}-wt-${spec.issue}`;
171
- let phase = 'plan';
172
- const phaseOf = () => phase;
173
- const clock = options.clock ?? realSimClock;
174
- const jitter = options.jitter
175
- ? new SimJitter(options.jitter, deriveSimSeed(options.jitter.seed, spec.issue))
176
- : undefined;
177
- const routedExecutor = jitter ? new SimJitterExecutor(executor, jitter, phaseOf, clock) : executor;
178
- const routedOctokit = jitter ? withSimJitter(octokit, jitter, phaseOf, clock) : octokit;
179
- const policy = {
180
- models: simModelsConfig(),
181
- routes: simRoutesConfig(),
182
- sandbox: {
183
- enabled: false,
184
- runtime: 'auto',
185
- codexFullAccessTasks: [],
186
- network: { allow: [] },
187
- resources: { cpuMs: 300_000, memMb: 4096 },
188
- docker: { rolloutPercent: 0 },
189
- },
190
- budget: {},
191
- effective: { localOnly: false, allowExperimental: false, codexDisabled: false, branchPrefix: 'factory' },
192
- };
193
- const router = new ModelRouter(policy.models, policy.routes, false, routedExecutor);
194
- let route = 'claude';
195
- let reworkRounds = 0;
196
- let designArtifact = null;
197
- // Terminal-state mapping mirrors packages/cli/src/cli/index.ts's LaneParkError /
198
- // ParkReason classification — core cannot import from cli, so this is a deliberate
199
- // mirror, not accidental duplication. Keep it in sync with any change there.
200
- function finish(state, atPhase, reason, prNumber) {
201
- return {
202
- issue: spec.issue,
203
- state,
204
- phase: atPhase,
205
- route,
206
- branch,
207
- ...(prNumber !== undefined ? { prNumber } : {}),
208
- reworkRounds,
209
- ...(reason !== undefined ? { reason } : {}),
210
- modelCalls: executor.calls,
211
- githubCalls,
212
- jitterDraws: jitter?.draws ?? [],
213
- events,
214
- designArtifact,
215
- };
216
- }
217
- try {
218
- const plan = await planPhase({
219
- issue: workKeyFromIssue(spec.issue),
220
- repo,
221
- worktree,
222
- specPath,
223
- router,
224
- constitution: null,
225
- octokit: asPhaseOctokit(routedOctokit),
226
- log: log('plan'),
227
- ...(spec.enforceReadiness !== undefined ? { enforceReadiness: spec.enforceReadiness } : {}),
228
- });
229
- route = plan.route;
230
- designArtifact = plan.designArtifact;
231
- if (!plan.ok)
232
- return finish('escalated', 'plan', plan.escalate ?? 'plan escalated');
233
- phase = 'build';
234
- await withGitLock(workspace.repoRoot, () => setupWorktree(workspace.repoRoot, branch, worktree));
235
- const build = await buildPhase({
236
- issue: workKeyFromIssue(spec.issue),
237
- repo,
238
- worktree,
239
- specPath,
240
- branch,
241
- route: plan.route,
242
- router,
243
- constitution: null,
244
- log: log('build'),
245
- });
246
- if (!build.ok)
247
- return finish('escalated', 'build', build.escalate ?? 'build escalated');
248
- phase = 'check';
249
- const check = await checkPhase({
250
- issue: workKeyFromIssue(spec.issue),
251
- worktree,
252
- specPath,
253
- router,
254
- constitution: null,
255
- log: log('check'),
256
- autoRework: spec.autoRework,
257
- ...(spec.maxReworkRounds !== undefined ? { maxReworkRounds: spec.maxReworkRounds } : {}),
258
- });
259
- reworkRounds = check.reworkRounds;
260
- if (!check.passed) {
261
- const reason = `${check.summary.failures} check failure(s) after ${check.reworkRounds} rework round(s)`;
262
- return finish(check.stuck ? 'escalated' : 'parked', 'check', reason);
263
- }
264
- phase = 'ship';
265
- const ship = await shipPhase({
266
- issue: workKeyFromIssue(spec.issue),
267
- repo,
268
- worktree,
269
- branch,
270
- octokit: asPhaseOctokit(routedOctokit),
271
- watchCI: false,
272
- log: log('ship'),
273
- });
274
- if (!ship.ok)
275
- return finish('parked', 'ship', ship.reason ? `ship phase failed: ${ship.reason}` : 'ship phase failed');
276
- // `shipped` means a PR was opened. shipPhase also returns ok for the alreadyDelivered
277
- // path (branch has no commits ahead of origin/main) — reachable here when an injected
278
- // BUILD failure left the worktree unchanged. That is not a ship.
279
- if (ship.prNumber === undefined)
280
- return finish('parked', 'ship', 'ship phase produced no PR');
281
- return finish('shipped', 'ship', undefined, ship.prNumber);
282
- }
283
- catch (err) {
284
- return finish('parked', phase, err instanceof Error ? err.message : String(err));
285
- }
286
- finally {
287
- await withGitLock(workspace.repoRoot, () => cleanupWorktree(workspace.repoRoot, worktree));
288
- }
289
- }
290
- //# sourceMappingURL=pipeline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/sim/pipeline.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,uFAAuF;AACvF,sFAAsF;AACtF,6DAA6D;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,MAAM,MA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AAE,2BAA2B,CAAC,CAAC;QAE9F,OAAO,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACnF,CAAC;YAAS,CAAC;QACT,MAAM,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7F,CAAC;AACH,CAAC"}
@@ -1,20 +0,0 @@
1
- import { type SimIssueSpec } from './pipeline.js';
2
- export interface SimRegressionFixture {
3
- /** GitHub issue number of the production fault this fixture encodes. */
4
- fault: number;
5
- /** Short slug naming the fault. */
6
- name: string;
7
- /** The historical (pre-fix) behaviour the simulator reproduces for this fixture. */
8
- historicalSignature: string;
9
- /** The simulator input that reproduces it. */
10
- spec: SimIssueSpec;
11
- }
12
- /** #550: otherwise-valid Markdown wrapped in a whole-output code fence. `extractIssueSections`
13
- * swallows every heading inside the fence, so the scorer sees zero sections. */
14
- export declare const SIM_FENCED_ENRICHMENT_OUTPUT: string;
15
- /** #551: the frozen PLAN spec, but with one object-shaped element in `interfacesTouched` —
16
- * the shape a model emits when it mirrors the sibling object lists in the PLAN prompt. */
17
- export declare function simSpecWithObjectInterface(issue: number, title: string): string;
18
- export declare const SIM_REGRESSION_FIXTURES: readonly SimRegressionFixture[];
19
- export declare function simRegressionFixture(fault: number): SimRegressionFixture;
20
- //# sourceMappingURL=regressions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"regressions.d.ts","sourceRoot":"","sources":["../../src/sim/regressions.ts"],"names":[],"mappings":"AAUA,OAAO,EAAqC,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGrF,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,oFAAoF;IACpF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,IAAI,EAAE,YAAY,CAAC;CACpB;AAsBD;iFACiF;AACjF,eAAO,MAAM,4BAA4B,QAAyD,CAAC;AAEnG;2FAC2F;AAC3F,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK/E;AAkBD,eAAO,MAAM,uBAAuB,EAAE,SAAS,oBAAoB,EAiDlE,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,CAIxE"}
@@ -1,106 +0,0 @@
1
- // packages/core/src/sim/regressions.ts — known production faults encoded as simulator
2
- // fixtures (#567). Each fixture reproduces the *historical* signature of a fault that is
3
- // still open; when the fault lands, flip the assertion in regressions.test.ts (and update
4
- // the `historicalSignature` line here) rather than deleting the fixture.
5
- import { writeFile } from 'node:fs/promises';
6
- import { join } from 'node:path';
7
- import { parseSpec, stringifySpec } from '../spec/index.js';
8
- import { simDefaultScripts, simSpecContent } from './pipeline.js';
9
- import { simCommitAll } from './workspace.js';
10
- /** A factory-task body missing four of the five required fields — forces enrichment. */
11
- const INCOMPLETE_FACTORY_TASK_BODY = '## Problem statement\nThe importer stalls on large files.\n';
12
- const COMPLETE_FACTORY_TASK_BODY = [
13
- '## Problem statement',
14
- 'The importer stalls on large files.',
15
- '',
16
- '## In scope',
17
- 'Repair the importer queue.',
18
- '',
19
- '## Out of scope',
20
- 'Changing the queue API.',
21
- '',
22
- '## Acceptance criteria',
23
- '- [ ] Large files import without stalling.',
24
- '',
25
- '## Verification',
26
- 'npm run test',
27
- ].join('\n');
28
- /** #550: otherwise-valid Markdown wrapped in a whole-output code fence. `extractIssueSections`
29
- * swallows every heading inside the fence, so the scorer sees zero sections. */
30
- export const SIM_FENCED_ENRICHMENT_OUTPUT = '```markdown\n' + COMPLETE_FACTORY_TASK_BODY + '\n```';
31
- /** #551: the frozen PLAN spec, but with one object-shaped element in `interfacesTouched` —
32
- * the shape a model emits when it mirrors the sibling object lists in the PLAN prompt. */
33
- export function simSpecWithObjectInterface(issue, title) {
34
- const parsed = parseSpec(simSpecContent(issue, title));
35
- const design = parsed.data.design;
36
- design.interfacesTouched = [`feature-${issue}.txt`, { file: `feature-${issue}.txt`, symbol: `simFeature${issue}` }];
37
- return stringifySpec(parsed.body, parsed.data);
38
- }
39
- const FIXTURE_550_TITLE = 'Sim regression #550: fenced enrichment output';
40
- const FIXTURE_551_TITLE = 'Sim regression #551: object element in interfacesTouched';
41
- const FIXTURE_1222_TITLE = 'Sim regression #1222: uncommitted build output after green check';
42
- /** #1222: BUILD commits its feature file but leaves an extra file uncommitted — the
43
- * factory's own build output after a green CHECK. Drives the real shipPhase against a
44
- * real worktree so commitLeftoverBuildOutput (#1172) must commit it and ship. */
45
- const FIXTURE_1222_BUILD_STEP = {
46
- output: 'built',
47
- effect: async (ctx) => {
48
- await writeFile(join(ctx.worktree, 'feature-9553.txt'), 'simulated build for issue #9553\n');
49
- await simCommitAll(ctx.worktree, 'feat: sim issue 9553');
50
- await writeFile(join(ctx.worktree, 'build-output-9553.txt'), 'uncommitted build output after check\n');
51
- },
52
- };
53
- export const SIM_REGRESSION_FIXTURES = [
54
- {
55
- fault: 550,
56
- name: 'fenced-enrichment-output-park',
57
- historicalSignature: '(fixed by #816) PLAN used to escalate after exactly one readiness_enrich call; it now retries with the missing headings named and the run ships.',
58
- spec: {
59
- issue: 9550,
60
- title: FIXTURE_550_TITLE,
61
- body: INCOMPLETE_FACTORY_TASK_BODY,
62
- enforceReadiness: true,
63
- scripts: {
64
- ...simDefaultScripts(9550, FIXTURE_550_TITLE),
65
- readiness_enrich: [{ output: SIM_FENCED_ENRICHMENT_OUTPUT }, { output: COMPLETE_FACTORY_TASK_BODY }],
66
- },
67
- },
68
- },
69
- {
70
- fault: 551,
71
- name: 'object-element-in-interfaces-touched',
72
- historicalSignature: 'PLAN returns designArtifact === null and logs design_artifact_invalid, yet the lane ships — ' +
73
- 'the whole artifact is discarded silently.',
74
- spec: {
75
- issue: 9551,
76
- title: FIXTURE_551_TITLE,
77
- scripts: {
78
- ...simDefaultScripts(9551, FIXTURE_551_TITLE),
79
- plan: [{ output: simSpecWithObjectInterface(9551, FIXTURE_551_TITLE) }],
80
- },
81
- },
82
- },
83
- {
84
- fault: 1222,
85
- name: 'ship-parks-on-uncommitted-build-output',
86
- historicalSignature: '(fixed by #1172; re-pinned by #1222 after a stale-build ops regression) SHIP used to park the lane ' +
87
- 'with "not recovering <branch>: worktree has uncommitted changes" even though CHECK had just verified ' +
88
- 'that exact working tree; it now commits the leftover build output on the ship-it branch and ships.',
89
- spec: {
90
- issue: 9553,
91
- title: FIXTURE_1222_TITLE,
92
- scripts: {
93
- ...simDefaultScripts(9553, FIXTURE_1222_TITLE),
94
- build_claude: [FIXTURE_1222_BUILD_STEP],
95
- build_codex: [FIXTURE_1222_BUILD_STEP],
96
- },
97
- },
98
- },
99
- ];
100
- export function simRegressionFixture(fault) {
101
- const fixture = SIM_REGRESSION_FIXTURES.find((f) => f.fault === fault);
102
- if (!fixture)
103
- throw new Error(`no simulator regression fixture for fault #${fault}`);
104
- return fixture;
105
- }
106
- //# sourceMappingURL=regressions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"regressions.js","sourceRoot":"","sources":["../../src/sim/regressions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,yFAAyF;AACzF,0FAA0F;AAC1F,yEAAyE;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kB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YACX,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE;gBACP,GAAG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,CAAC;gBAC9C,YAAY,EAAE,CAAC,uBAAuB,CAAC;gBACvC,WAAW,EAAE,CAAC,uBAAuB,CAAC;aACvC;SACF;KACF;CACF,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,MAAM,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACvE,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,KAAK,EAAE,CAAC,CAAC;IACrF,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,9 +0,0 @@
1
- import { type SimulationOptions, type SimulationReport } from './pipeline.js';
2
- export interface ShipPhaseBreakdownCliDeps {
3
- write?: (line: string) => void;
4
- run?: (options: SimulationOptions) => Promise<SimulationReport>;
5
- }
6
- /** Runs one clean sim reproduction and writes its markdown breakdown. Returns 0 when the
7
- * reproduction shipped, 1 otherwise (mirrors the monte-carlo CLI's non-throwing exit contract). */
8
- export declare function runShipPhaseBreakdownReportCli(deps?: ShipPhaseBreakdownCliDeps): Promise<number>;
9
- //# sourceMappingURL=ship-phase-breakdown-cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ship-phase-breakdown-cli.d.ts","sourceRoot":"","sources":["../../src/sim/ship-phase-breakdown-cli.ts"],"names":[],"mappings":"AAOA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE7F,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACjE;AAID;oGACoG;AACpG,wBAAsB,8BAA8B,CAAC,IAAI,GAAE,yBAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,CAa1G"}
@@ -1,23 +0,0 @@
1
- // packages/core/src/sim/ship-phase-breakdown-cli.ts — drives one clean sim reproduction (real
2
- // PLAN -> BUILD -> CHECK -> SHIP phase code, no network) and renders its captured events through
3
- // `renderShipPhaseBreakdown`. Modeled on monte-carlo-cli.ts: every effect (stdout, the runner
4
- // itself) is injected so this is unit testable; scripts/ship-phase-breakdown-report.ts owns
5
- // turning the return value into a process exit code (#1328).
6
- import { renderShipPhaseBreakdown } from '../reports/ship-phase-breakdown.js';
7
- import { runSimulation } from './pipeline.js';
8
- const REPRODUCTION_ISSUE = { issue: 9700, title: 'Ship phase breakdown reproduction (#1328)' };
9
- /** Runs one clean sim reproduction and writes its markdown breakdown. Returns 0 when the
10
- * reproduction shipped, 1 otherwise (mirrors the monte-carlo CLI's non-throwing exit contract). */
11
- export async function runShipPhaseBreakdownReportCli(deps = {}) {
12
- const write = deps.write ?? ((line) => process.stdout.write(line));
13
- const run = deps.run ?? runSimulation;
14
- const report = await run({ issues: [REPRODUCTION_ISSUE] });
15
- const [outcome] = report.outcomes;
16
- if (!outcome) {
17
- write('ship-phase-breakdown-report: the sim reproduction produced no outcome\n');
18
- return 1;
19
- }
20
- write(renderShipPhaseBreakdown(outcome.events));
21
- return outcome.state === 'shipped' ? 0 : 1;
22
- }
23
- //# sourceMappingURL=ship-phase-breakdown-cli.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ship-phase-breakdown-cli.js","sourceRoot":"","sources":["../../src/sim/ship-phase-breakdown-cli.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,iGAAiG;AACjG,8FAA8F;AAC9F,4FAA4F;AAC5F,6DAA6D;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAiD,MAAM,eAAe,CAAC;AAO7F,MAAM,kBAAkB,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,2CAA2C,EAAE,CAAC;AAE/F;oGACoG;AACpG,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAAC,IAAI,GAA8B,EAAE;IACvF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3E,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,aAAa,CAAC;IAEtC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;IAClC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,KAAK,CAAC,yEAAyE,CAAC,CAAC;QACjF,OAAO,CAAC,CAAC;IACX,CAAC;IAED,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,OAAO,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC"}
@@ -1,3 +0,0 @@
1
- export type SimTerminalState = 'shipped' | 'parked' | 'escalated';
2
- export type SimPhaseName = 'plan' | 'build' | 'check' | 'ship';
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sim/types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC"}
package/dist/sim/types.js DELETED
@@ -1,4 +0,0 @@
1
- // packages/core/src/sim/types.ts — shared unions for the sim harness. Extracted from
2
- // pipeline.ts so jitter.ts can key its config by phase without an import cycle.
3
- export {};
4
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sim/types.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,gFAAgF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/sim/workspace.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,YAAY;IAC3B,qGAAqG;IACrG,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9E;AA0CD,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,CAoBhE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/sim/workspace.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,+FAA+F;AAE/F,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAa/C,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAW,EAAE,OAAe;IAC7D,MAAM,OAAO,CAAC,CAAC,KAAK,EAAE,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