@lyupro/codex-bridge 0.6.6 → 0.6.8

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 (55) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +7 -5
  3. package/bin/codex-bridge.mjs +186 -178
  4. package/cli/dispatcher-contract-record.mjs +51 -0
  5. package/cli/dispatcher-contract.mjs +90 -0
  6. package/cli/doctor-hooks.mjs +104 -114
  7. package/cli/doctor-installation.mjs +111 -111
  8. package/cli/doctor-runs.mjs +55 -55
  9. package/cli/doctor.mjs +53 -5
  10. package/cli/handback-witness-check.mjs +31 -0
  11. package/cli/hook-targets.mjs +14 -6
  12. package/cli/hook.mjs +32 -23
  13. package/cli/host-contract.mjs +145 -135
  14. package/cli/install.mjs +23 -17
  15. package/cli/launcher-probe.mjs +38 -0
  16. package/cli/probe-contract.mjs +55 -70
  17. package/cli/probe-rig.mjs +53 -0
  18. package/cli/probe-target.mjs +33 -0
  19. package/cli/run-launcher.mjs +17 -0
  20. package/cli/session-hosts.mjs +51 -0
  21. package/cli/settings-merge.mjs +42 -35
  22. package/cli/uninstall.mjs +16 -3
  23. package/cli/update.mjs +45 -16
  24. package/package.json +4 -4
  25. package/scripts/run-tests.mjs +7 -0
  26. package/src/agents/codex-advisor.md +3 -4
  27. package/src/agents/codex-build.md +5 -5
  28. package/src/agents/codex-review.md +3 -3
  29. package/src/agents/codex-scout.md +3 -4
  30. package/src/home/hooks/dispatcher-gate.mjs +132 -0
  31. package/src/home/hooks/guard-tries.mjs +5 -6
  32. package/src/home/hooks/live-runs.mjs +1 -0
  33. package/src/home/hooks/order-gate.mjs +20 -5
  34. package/src/home/hooks/reply-guard.mjs +95 -10
  35. package/src/home/hooks/reply-verdicts.mjs +5 -0
  36. package/src/home/hooks/worktree-lock.mjs +108 -107
  37. package/src/home/lib/atomic-json.mjs +21 -0
  38. package/src/home/lib/brand-home.mjs +6 -0
  39. package/src/home/lib/dispatcher-command.mjs +79 -0
  40. package/src/home/lib/dispatcher-gate.mjs +95 -0
  41. package/src/home/lib/dispatcher-order.mjs +30 -8
  42. package/src/home/lib/dispatcher-state.mjs +111 -0
  43. package/src/home/lib/dispatcher-stop.mjs +52 -0
  44. package/src/home/lib/handback-witness.mjs +70 -0
  45. package/src/home/lib/hook-definitions.mjs +10 -0
  46. package/src/home/lib/hook-entry.mjs +20 -0
  47. package/src/home/lib/host-observations.mjs +57 -0
  48. package/src/home/lib/host-version.mjs +27 -0
  49. package/src/home/lib/meta/advice-verdict.mjs +37 -21
  50. package/src/home/lib/required-inputs.mjs +1 -1
  51. package/src/home/lib/runner/codex-cmd.mjs +3 -2
  52. package/src/home/lib/runner/git-state.mjs +1 -1
  53. package/src/home/lib/runner/preflight.mjs +6 -3
  54. package/src/home/lib/runner/prompts.mjs +8 -7
  55. package/src/home/lib/runner/schemas.mjs +33 -7
@@ -150,6 +150,30 @@ const REVIEW_SCHEMA = {
150
150
  },
151
151
  };
152
152
 
153
+ // The 2026-09-24_094352_plan62-g1-dispatcher-gate run folded 3-5 citations into one advisor
154
+ // address; like the 2026-07-31 build changes[].file precedent, constrain a single location here.
155
+ export const EVIDENCE_LOCATION = {
156
+ type: 'object',
157
+ additionalProperties: false,
158
+ required: ['file', 'line_start', 'line_end'],
159
+ properties: {
160
+ file: {
161
+ type: 'string',
162
+ minLength: 1,
163
+ pattern: '^[^:;,*?{}\\r\\n]+$',
164
+ description: 'Exactly one repository-root-relative path. Spaces are allowed; lists, globs, drive letters and line suffixes are not — use a separate location object for each place.',
165
+ },
166
+ line_start: { type: 'integer', minimum: 1 },
167
+ line_end: { type: 'integer', minimum: 1 },
168
+ },
169
+ };
170
+
171
+ const EVIDENCE_LIST = (minItems) => ({
172
+ type: 'array',
173
+ ...(minItems === undefined ? {} : { minItems }),
174
+ items: EVIDENCE_LOCATION,
175
+ });
176
+
153
177
  /** Plan_59: execution schemas stay static; schemaFor selects the advisor contract by phase. */
154
178
  export const SCHEMAS = {
155
179
  'codex-scout': SCOUT_SCHEMA,
@@ -220,11 +244,11 @@ export const PHASE_SCHEMAS = {
220
244
  items: {
221
245
  type: 'object',
222
246
  additionalProperties: false,
223
- required: ['claim', 'rating', 'address'],
247
+ required: ['claim', 'rating', 'evidence'],
224
248
  properties: {
225
249
  claim: { type: 'string' },
226
250
  rating: { type: 'string', enum: ['VERIFIED', 'REASONABLE', 'FRAGILE'] },
227
- address: { type: 'string' },
251
+ evidence: EVIDENCE_LIST(),
228
252
  },
229
253
  },
230
254
  },
@@ -233,11 +257,12 @@ export const PHASE_SCHEMAS = {
233
257
  items: {
234
258
  type: 'object',
235
259
  additionalProperties: false,
236
- required: ['risk_id', 'outcome', 'address'],
260
+ required: ['risk_id', 'outcome', 'note', 'evidence'],
237
261
  properties: {
238
262
  risk_id: { type: 'string' },
239
263
  outcome: { type: 'string', enum: ['confirmed', 'refuted'] },
240
- address: { type: 'string' },
264
+ note: { type: 'string' },
265
+ evidence: EVIDENCE_LIST(1),
241
266
  },
242
267
  },
243
268
  },
@@ -254,10 +279,11 @@ export const PHASE_SCHEMAS = {
254
279
  early_check: {
255
280
  type: 'object',
256
281
  additionalProperties: false,
257
- required: ['kind', 'target'],
282
+ required: ['kind', 'target', 'evidence'],
258
283
  properties: {
259
284
  kind: { type: 'string', enum: ['test', 'command', 'inspect'] },
260
285
  target: { type: 'string', minLength: 3 },
286
+ evidence: EVIDENCE_LIST(),
261
287
  },
262
288
  },
263
289
  },
@@ -271,8 +297,8 @@ export const PHASE_SCHEMAS = {
271
297
  items: {
272
298
  type: 'object',
273
299
  additionalProperties: false,
274
- required: ['check', 'address'],
275
- properties: { check: { type: 'string' }, address: { type: 'string' } },
300
+ required: ['check', 'evidence'],
301
+ properties: { check: { type: 'string' }, evidence: EVIDENCE_LIST(1) },
276
302
  },
277
303
  },
278
304
  },