@cchistory/lite 0.4.2
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/INSTALL.md +13 -0
- package/LICENSE +21 -0
- package/README.md +16 -0
- package/apps/lite-cli/dist/bin.d.ts +3 -0
- package/apps/lite-cli/dist/bin.d.ts.map +1 -0
- package/apps/lite-cli/dist/bin.js +7 -0
- package/apps/lite-cli/dist/bin.js.map +1 -0
- package/apps/lite-cli/dist/index.d.ts +21 -0
- package/apps/lite-cli/dist/index.d.ts.map +1 -0
- package/apps/lite-cli/dist/index.js +1812 -0
- package/apps/lite-cli/dist/index.js.map +1 -0
- package/apps/lite-cli/dist/index.test.d.ts +2 -0
- package/apps/lite-cli/dist/index.test.d.ts.map +1 -0
- package/apps/lite-cli/dist/index.test.js +1290 -0
- package/apps/lite-cli/dist/index.test.js.map +1 -0
- package/apps/lite-cli/dist/json-v2.d.ts +17 -0
- package/apps/lite-cli/dist/json-v2.d.ts.map +1 -0
- package/apps/lite-cli/dist/json-v2.js +352 -0
- package/apps/lite-cli/dist/json-v2.js.map +1 -0
- package/apps/lite-cli/dist/query.d.ts +50 -0
- package/apps/lite-cli/dist/query.d.ts.map +1 -0
- package/apps/lite-cli/dist/query.js +297 -0
- package/apps/lite-cli/dist/query.js.map +1 -0
- package/apps/lite-cli/dist/shell.d.ts +18 -0
- package/apps/lite-cli/dist/shell.d.ts.map +1 -0
- package/apps/lite-cli/dist/shell.js +276 -0
- package/apps/lite-cli/dist/shell.js.map +1 -0
- package/apps/lite-tui/dist/bin.d.ts +3 -0
- package/apps/lite-tui/dist/bin.d.ts.map +1 -0
- package/apps/lite-tui/dist/bin.js +7 -0
- package/apps/lite-tui/dist/bin.js.map +1 -0
- package/apps/lite-tui/dist/colors.d.ts +49 -0
- package/apps/lite-tui/dist/colors.d.ts.map +1 -0
- package/apps/lite-tui/dist/colors.js +70 -0
- package/apps/lite-tui/dist/colors.js.map +1 -0
- package/apps/lite-tui/dist/index.d.ts +23 -0
- package/apps/lite-tui/dist/index.d.ts.map +1 -0
- package/apps/lite-tui/dist/index.js +519 -0
- package/apps/lite-tui/dist/index.js.map +1 -0
- package/apps/lite-tui/dist/index.test.d.ts +2 -0
- package/apps/lite-tui/dist/index.test.d.ts.map +1 -0
- package/apps/lite-tui/dist/index.test.js +487 -0
- package/apps/lite-tui/dist/index.test.js.map +1 -0
- package/apps/lite-tui/dist/input.d.ts +23 -0
- package/apps/lite-tui/dist/input.d.ts.map +1 -0
- package/apps/lite-tui/dist/input.js +98 -0
- package/apps/lite-tui/dist/input.js.map +1 -0
- package/apps/lite-tui/dist/keys.d.ts +32 -0
- package/apps/lite-tui/dist/keys.d.ts.map +1 -0
- package/apps/lite-tui/dist/keys.js +136 -0
- package/apps/lite-tui/dist/keys.js.map +1 -0
- package/apps/lite-tui/dist/keys.test.d.ts +2 -0
- package/apps/lite-tui/dist/keys.test.d.ts.map +1 -0
- package/apps/lite-tui/dist/keys.test.js +67 -0
- package/apps/lite-tui/dist/keys.test.js.map +1 -0
- package/apps/lite-tui/dist/model.d.ts +88 -0
- package/apps/lite-tui/dist/model.d.ts.map +1 -0
- package/apps/lite-tui/dist/model.js +146 -0
- package/apps/lite-tui/dist/model.js.map +1 -0
- package/apps/lite-tui/dist/render.d.ts +46 -0
- package/apps/lite-tui/dist/render.d.ts.map +1 -0
- package/apps/lite-tui/dist/render.js +706 -0
- package/apps/lite-tui/dist/render.js.map +1 -0
- package/apps/lite-tui/dist/render.test.d.ts +2 -0
- package/apps/lite-tui/dist/render.test.d.ts.map +1 -0
- package/apps/lite-tui/dist/render.test.js +594 -0
- package/apps/lite-tui/dist/render.test.js.map +1 -0
- package/apps/lite-tui/dist/state.d.ts +127 -0
- package/apps/lite-tui/dist/state.d.ts.map +1 -0
- package/apps/lite-tui/dist/state.js +391 -0
- package/apps/lite-tui/dist/state.js.map +1 -0
- package/apps/lite-tui/dist/state.test.d.ts +2 -0
- package/apps/lite-tui/dist/state.test.d.ts.map +1 -0
- package/apps/lite-tui/dist/state.test.js +331 -0
- package/apps/lite-tui/dist/state.test.js.map +1 -0
- package/apps/lite-tui/dist/text.d.ts +38 -0
- package/apps/lite-tui/dist/text.d.ts.map +1 -0
- package/apps/lite-tui/dist/text.js +246 -0
- package/apps/lite-tui/dist/text.js.map +1 -0
- package/apps/lite-tui/dist/version.d.ts +10 -0
- package/apps/lite-tui/dist/version.d.ts.map +1 -0
- package/apps/lite-tui/dist/version.js +10 -0
- package/apps/lite-tui/dist/version.js.map +1 -0
- package/apps/lite-tui/dist/view-model.d.ts +26 -0
- package/apps/lite-tui/dist/view-model.d.ts.map +1 -0
- package/apps/lite-tui/dist/view-model.js +87 -0
- package/apps/lite-tui/dist/view-model.js.map +1 -0
- package/bin/cchistory-lite +3 -0
- package/bin/cchistory-lite-tui +3 -0
- package/bin/cchistory-lite-tui.cmd +3 -0
- package/bin/cchistory-lite-tui.mjs +7 -0
- package/bin/cchistory-lite.cmd +3 -0
- package/bin/cchistory-lite.mjs +11 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts +33 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.js +95 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/fallback-projects.d.ts +14 -0
- package/node_modules/@cchistory/canonical/dist/fallback-projects.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/fallback-projects.js +120 -0
- package/node_modules/@cchistory/canonical/dist/fallback-projects.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/index.d.ts +12 -0
- package/node_modules/@cchistory/canonical/dist/index.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/index.js +12 -0
- package/node_modules/@cchistory/canonical/dist/index.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/index.test.d.ts +2 -0
- package/node_modules/@cchistory/canonical/dist/index.test.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/index.test.js +901 -0
- package/node_modules/@cchistory/canonical/dist/index.test.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/project-linker.d.ts +30 -0
- package/node_modules/@cchistory/canonical/dist/project-linker.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/project-linker.js +720 -0
- package/node_modules/@cchistory/canonical/dist/project-linker.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/projection-audit.d.ts +23 -0
- package/node_modules/@cchistory/canonical/dist/projection-audit.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/projection-audit.js +192 -0
- package/node_modules/@cchistory/canonical/dist/projection-audit.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/read-order.d.ts +19 -0
- package/node_modules/@cchistory/canonical/dist/read-order.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/read-order.js +73 -0
- package/node_modules/@cchistory/canonical/dist/read-order.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/related-work.d.ts +4 -0
- package/node_modules/@cchistory/canonical/dist/related-work.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/related-work.js +232 -0
- package/node_modules/@cchistory/canonical/dist/related-work.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/runtime-warning-filter.d.ts +10 -0
- package/node_modules/@cchistory/canonical/dist/runtime-warning-filter.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/runtime-warning-filter.js +34 -0
- package/node_modules/@cchistory/canonical/dist/runtime-warning-filter.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/search.d.ts +69 -0
- package/node_modules/@cchistory/canonical/dist/search.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/search.js +337 -0
- package/node_modules/@cchistory/canonical/dist/search.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-collections.d.ts +8 -0
- package/node_modules/@cchistory/canonical/dist/session-collections.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-collections.js +21 -0
- package/node_modules/@cchistory/canonical/dist/session-collections.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.d.ts +23 -0
- package/node_modules/@cchistory/canonical/dist/session-family.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.js +808 -0
- package/node_modules/@cchistory/canonical/dist/session-family.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.test.d.ts +2 -0
- package/node_modules/@cchistory/canonical/dist/session-family.test.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.test.js +650 -0
- package/node_modules/@cchistory/canonical/dist/session-family.test.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage.d.ts +79 -0
- package/node_modules/@cchistory/canonical/dist/usage.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage.js +232 -0
- package/node_modules/@cchistory/canonical/dist/usage.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/utils.d.ts +5 -0
- package/node_modules/@cchistory/canonical/dist/utils.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/utils.js +18 -0
- package/node_modules/@cchistory/canonical/dist/utils.js.map +1 -0
- package/node_modules/@cchistory/canonical/package.json +14 -0
- package/node_modules/@cchistory/domain/dist/index.d.ts +943 -0
- package/node_modules/@cchistory/domain/dist/index.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/index.js +238 -0
- package/node_modules/@cchistory/domain/dist/index.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/index.test.d.ts +2 -0
- package/node_modules/@cchistory/domain/dist/index.test.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/index.test.js +423 -0
- package/node_modules/@cchistory/domain/dist/index.test.js.map +1 -0
- package/node_modules/@cchistory/domain/package.json +14 -0
- package/node_modules/@cchistory/live-runtime/dist/async-pool.d.ts +3 -0
- package/node_modules/@cchistory/live-runtime/dist/async-pool.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/async-pool.js +19 -0
- package/node_modules/@cchistory/live-runtime/dist/async-pool.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts +3 -0
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.js +22 -0
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts +149 -0
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/index.js +1180 -0
- package/node_modules/@cchistory/live-runtime/dist/index.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/index.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/index.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/index.test.js +1819 -0
- package/node_modules/@cchistory/live-runtime/dist/index.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts +5 -0
- package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/node-memory.js +83 -0
- package/node_modules/@cchistory/live-runtime/dist/node-memory.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/package.json +18 -0
- package/node_modules/@cchistory/source-adapters/dist/core/antigravity-logic.d.ts +8 -0
- package/node_modules/@cchistory/source-adapters/dist/core/antigravity-logic.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/antigravity-logic.js +115 -0
- package/node_modules/@cchistory/source-adapters/dist/core/antigravity-logic.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/ask-user-registry.d.ts +9 -0
- package/node_modules/@cchistory/source-adapters/dist/core/ask-user-registry.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/ask-user-registry.js +223 -0
- package/node_modules/@cchistory/source-adapters/dist/core/ask-user-registry.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/ask-user.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/ask-user.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/ask-user.test.js +318 -0
- package/node_modules/@cchistory/source-adapters/dist/core/ask-user.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/atomizer.d.ts +11 -0
- package/node_modules/@cchistory/source-adapters/dist/core/atomizer.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/atomizer.js +206 -0
- package/node_modules/@cchistory/source-adapters/dist/core/atomizer.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts +62 -0
- package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.js +224 -0
- package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/directory-preview.d.ts +15 -0
- package/node_modules/@cchistory/source-adapters/dist/core/directory-preview.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/directory-preview.js +96 -0
- package/node_modules/@cchistory/source-adapters/dist/core/directory-preview.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/directory-preview.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/directory-preview.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/directory-preview.test.js +97 -0
- package/node_modules/@cchistory/source-adapters/dist/core/directory-preview.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.d.ts +11 -0
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.js +412 -0
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js +552 -0
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts +10 -0
- package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/factories.js +83 -0
- package/node_modules/@cchistory/source-adapters/dist/core/factories.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts +5 -0
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.js +86 -0
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.d.ts +31 -0
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.js +216 -0
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.js +367 -0
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/legacy.d.ts +10 -0
- package/node_modules/@cchistory/source-adapters/dist/core/legacy.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/legacy.js +10 -0
- package/node_modules/@cchistory/source-adapters/dist/core/legacy.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +70 -0
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js +1389 -0
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/path-utils.d.ts +15 -0
- package/node_modules/@cchistory/source-adapters/dist/core/path-utils.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/path-utils.js +76 -0
- package/node_modules/@cchistory/source-adapters/dist/core/path-utils.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/path-utils.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/path-utils.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/path-utils.test.js +33 -0
- package/node_modules/@cchistory/source-adapters/dist/core/path-utils.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts +24 -0
- package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js +1829 -0
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts +39 -0
- package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/projections.js +873 -0
- package/node_modules/@cchistory/source-adapters/dist/core/projections.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js +165 -0
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/registry.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/registry.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js +87 -0
- package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping-worker.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping-worker.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping-worker.js +10 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping-worker.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts +29 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js +455 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js +357 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts +25 -0
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js +144 -0
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts +14 -0
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js +247 -0
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js +323 -0
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts +26 -0
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js +80 -0
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts +226 -0
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/types.js +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/types.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/user-text.d.ts +29 -0
- package/node_modules/@cchistory/source-adapters/dist/core/user-text.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/user-text.js +327 -0
- package/node_modules/@cchistory/source-adapters/dist/core/user-text.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/utils.d.ts +11 -0
- package/node_modules/@cchistory/source-adapters/dist/core/utils.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/utils.js +19 -0
- package/node_modules/@cchistory/source-adapters/dist/core/utils.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/utils.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/utils.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/utils.test.js +289 -0
- package/node_modules/@cchistory/source-adapters/dist/core/utils.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts +43 -0
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js +520 -0
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/index.d.ts +13 -0
- package/node_modules/@cchistory/source-adapters/dist/index.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/index.js +8 -0
- package/node_modules/@cchistory/source-adapters/dist/index.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts +31 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.js +31 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/masks.d.ts +31 -0
- package/node_modules/@cchistory/source-adapters/dist/masks.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/masks.js +342 -0
- package/node_modules/@cchistory/source-adapters/dist/masks.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio/runtime.d.ts +31 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio/runtime.js +161 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.js +107 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js +202 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp/runtime.d.ts +4 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp/runtime.js +85 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.js +10 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js +105 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.d.ts +45 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.js +609 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/runtime.d.ts +16 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/runtime.js +534 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.d.ts +12 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.js +105 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js +820 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude-code/runtime.d.ts +4 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude-code/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude-code/runtime.js +130 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude-code/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude-code.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude-code.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude-code.js +10 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude-code.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js +357 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.d.ts +4 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.js +27 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js +49 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/runtime.d.ts +4 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/runtime.js +555 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.js +15 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js +893 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts +70 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js +786 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.d.ts +4 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.js +14 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js +154 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.d.ts +4 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.js +151 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js +1486 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid/runtime.d.ts +4 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid/runtime.js +229 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.js +10 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js +222 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.d.ts +7 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.js +65 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js +220 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.d.ts +20 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.js +365 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok/runtime.d.ts +17 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok/runtime.js +498 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.d.ts +36 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js +261 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js +565 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi/runtime.d.ts +4 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi/runtime.js +193 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.d.ts +7 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.js +55 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js +163 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.js +10 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js +179 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw/runtime.d.ts +4 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw/runtime.js +44 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.js +60 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js +39 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.js +45 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js +170 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/registry.d.ts +7 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/registry.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js +52 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/runtime-types.d.ts +104 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/runtime-types.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/runtime-types.js +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/runtime-types.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts +38 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/types.js +19 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/types.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts +14 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js +283 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.js +26 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js +411 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/test-helpers.d.ts +85 -0
- package/node_modules/@cchistory/source-adapters/dist/test-helpers.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/test-helpers.js +2106 -0
- package/node_modules/@cchistory/source-adapters/dist/test-helpers.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/package.json +14 -0
- package/package.json +38 -0
- package/schemas/cchistory-lite-canonical-v1.schema.json +13 -0
- package/schemas/cchistory-lite-error-v1.schema.json +30 -0
- package/schemas/cchistory-lite-query-result-v1.schema.json +29 -0
- package/schemas/cchistory-lite-query-result-v2.schema.json +29 -0
- package/schemas/cchistory-lite-query-v1.schema.json +62 -0
- package/schemas/cchistory-lite-query-v2.schema.json +82 -0
- package/schemas/cchistory-lite-v2.schema.json +176 -0
|
@@ -0,0 +1,893 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { appendFile, mkdir, mkdtemp, readFile, rm, utimes, writeFile } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { test } from "node:test";
|
|
6
|
+
import { runSourceProbe } from "../index.js";
|
|
7
|
+
import { createSourceDefinition, getRepoMockDataRoot, seedSupportedSourceFixtures } from "../test-helpers.js";
|
|
8
|
+
test("[codex] delegated child rollouts preserve evidence without projecting replay as UserTurns", async () => {
|
|
9
|
+
const baseDir = path.join(getRepoMockDataRoot(), ".codex", "sessions", "2026", "04", "12");
|
|
10
|
+
const source = createSourceDefinition("src-codex-delegation-fixture", "codex", baseDir);
|
|
11
|
+
const payload = (await runSourceProbe({ source_ids: [source.id] }, [source])).sources[0];
|
|
12
|
+
assert.ok(payload);
|
|
13
|
+
const parent = payload.sessions.find((session) => session.source_session_id === "codex-delegation-parent");
|
|
14
|
+
const child = payload.sessions.find((session) => session.source_session_id === "codex-delegation-child");
|
|
15
|
+
assert.ok(parent && child);
|
|
16
|
+
assert.equal(parent.turn_count, 1);
|
|
17
|
+
assert.equal(child.title, "Atlas");
|
|
18
|
+
assert.equal(child.turn_count, 0);
|
|
19
|
+
assert.equal(child.resume_command, undefined);
|
|
20
|
+
assert.equal(child.resume_working_directory, undefined);
|
|
21
|
+
assert.equal(payload.turns.some((turn) => turn.session_id === child.id), false);
|
|
22
|
+
const relation = payload.fragments.find((fragment) => fragment.session_ref === child.id && fragment.fragment_kind === "session_relation");
|
|
23
|
+
assert.ok(relation);
|
|
24
|
+
assert.equal(relation.payload.parent_uuid, "codex-delegation-parent");
|
|
25
|
+
assert.equal(relation.payload.child_session_id, "codex-delegation-child");
|
|
26
|
+
assert.equal(relation.payload.agent_id, "/root/fixture_audit");
|
|
27
|
+
assert.equal(relation.payload.agent_nickname, "Atlas");
|
|
28
|
+
const delegatedAtoms = payload.atoms.filter((atom) => atom.session_ref === child.id && atom.origin_kind === "delegated_instruction");
|
|
29
|
+
assert.ok(delegatedAtoms.some((atom) => atom.payload.text === "Review the fixture release checklist."));
|
|
30
|
+
assert.ok(delegatedAtoms.some((atom) => atom.payload.text === "Inspect the fixture deployment notes and report findings."));
|
|
31
|
+
assert.ok(delegatedAtoms.some((atom) => atom.payload.text === "Keep this delegated instruction as evidence only."));
|
|
32
|
+
assert.equal(payload.loss_audits.some((audit) => audit.severity === "warning" || audit.severity === "error"), false);
|
|
33
|
+
const targetedParent = (await runSourceProbe({
|
|
34
|
+
source_ids: [source.id],
|
|
35
|
+
target_session_refs: ["codex-delegation-parent"],
|
|
36
|
+
}, [source])).sources[0];
|
|
37
|
+
assert.ok(targetedParent);
|
|
38
|
+
assert.ok(targetedParent.sessions.some((session) => session.id === parent.id));
|
|
39
|
+
assert.ok(targetedParent.fragments.some((fragment) => fragment.fragment_kind === "session_relation" &&
|
|
40
|
+
fragment.payload.parent_uuid === "codex-delegation-parent"));
|
|
41
|
+
});
|
|
42
|
+
test("[codex] guardian auto-review subagents stay delegated instead of becoming history-dump sessions", async () => {
|
|
43
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-guardian-"));
|
|
44
|
+
try {
|
|
45
|
+
const codexDir = path.join(tempRoot, "codex-guardian");
|
|
46
|
+
await mkdir(codexDir, { recursive: true });
|
|
47
|
+
const fixtureRoot = path.join(getRepoMockDataRoot(), "fixtures", "source-shapes", "codex");
|
|
48
|
+
await writeFile(path.join(codexDir, "rollout-2026-08-16T02-30-00-codex-guardian-parent.jsonl"), await readFile(path.join(fixtureRoot, "guardian-auto-review-parent.jsonl")), "utf8");
|
|
49
|
+
await writeFile(path.join(codexDir, "rollout-2026-08-16T02-51-00-codex-guardian-child.jsonl"), await readFile(path.join(fixtureRoot, "guardian-auto-review-child.jsonl")), "utf8");
|
|
50
|
+
const source = createSourceDefinition("src-codex-guardian-fixture", "codex", codexDir);
|
|
51
|
+
const payload = (await runSourceProbe({ source_ids: [source.id] }, [source])).sources[0];
|
|
52
|
+
assert.ok(payload);
|
|
53
|
+
const parent = payload.sessions.find((session) => session.source_session_id === "codex-guardian-parent");
|
|
54
|
+
const child = payload.sessions.find((session) => session.source_session_id === "codex-guardian-child");
|
|
55
|
+
assert.ok(parent && child);
|
|
56
|
+
assert.equal(parent.turn_count, 1);
|
|
57
|
+
assert.equal(payload.turns[0]?.canonical_text, "Review the fixture notes.");
|
|
58
|
+
assert.equal(child.title, "guardian");
|
|
59
|
+
assert.equal(child.turn_count, 0);
|
|
60
|
+
assert.equal(child.resume_command, undefined);
|
|
61
|
+
assert.equal(payload.turns.some((turn) => turn.session_id === child.id), false);
|
|
62
|
+
assert.equal(payload.turns.some((turn) => turn.canonical_text.includes("Codex agent history")), false);
|
|
63
|
+
const relation = payload.fragments.find((fragment) => fragment.session_ref === child.id && fragment.fragment_kind === "session_relation");
|
|
64
|
+
assert.ok(relation);
|
|
65
|
+
assert.equal(relation.payload.parent_uuid, "codex-guardian-parent");
|
|
66
|
+
assert.equal(relation.payload.child_session_id, "codex-guardian-child");
|
|
67
|
+
assert.equal(relation.payload.agent_id, "guardian");
|
|
68
|
+
assert.ok(payload.atoms.some((atom) => atom.session_ref === child.id &&
|
|
69
|
+
atom.origin_kind === "delegated_instruction" &&
|
|
70
|
+
String(atom.payload.text ?? "").includes("Codex agent history added since")));
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
test("[codex] ordinary fork rollouts remain resumable top-level sessions", async () => {
|
|
77
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-ordinary-fork-"));
|
|
78
|
+
try {
|
|
79
|
+
const codexDir = path.join(tempRoot, "codex-ordinary-fork");
|
|
80
|
+
await mkdir(codexDir, { recursive: true });
|
|
81
|
+
const sourceSessionId = "codex-ordinary-fork";
|
|
82
|
+
const fixturePath = path.join(getRepoMockDataRoot(), "fixtures", "source-shapes", "codex", "ordinary-fork.jsonl");
|
|
83
|
+
await writeFile(path.join(codexDir, "rollout-2026-04-12T09-02-00-codex-ordinary-fork.jsonl"), await readFile(fixturePath), "utf8");
|
|
84
|
+
const source = createSourceDefinition("src-codex-ordinary-fork", "codex", codexDir);
|
|
85
|
+
const payload = (await runSourceProbe({ source_ids: [source.id] }, [source])).sources[0];
|
|
86
|
+
const session = payload?.sessions[0];
|
|
87
|
+
assert.ok(payload && session);
|
|
88
|
+
assert.equal(session.turn_count, 1);
|
|
89
|
+
assert.equal(session.resume_command, `cd /workspace/codex-ordinary-fork && codex resume ${sourceSessionId}`);
|
|
90
|
+
assert.equal(payload.turns[0]?.canonical_text, "Continue this ordinary fork.");
|
|
91
|
+
assert.equal(payload.fragments.some((fragment) => fragment.fragment_kind === "session_relation"), false);
|
|
92
|
+
assert.equal(payload.atoms.some((atom) => atom.origin_kind === "delegated_instruction"), false);
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
test("[codex] incremental append restores delegated child state before parsing new records", async () => {
|
|
99
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-delegation-append-"));
|
|
100
|
+
try {
|
|
101
|
+
const codexDir = path.join(tempRoot, "codex-delegation");
|
|
102
|
+
await mkdir(codexDir, { recursive: true });
|
|
103
|
+
const fixturePath = path.join(getRepoMockDataRoot(), ".codex", "sessions", "2026", "04", "12", "rollout-2026-04-12T09-01-00-codex-delegation-child.jsonl");
|
|
104
|
+
const sessionPath = path.join(codexDir, path.basename(fixturePath));
|
|
105
|
+
await writeFile(sessionPath, await readFile(fixturePath), "utf8");
|
|
106
|
+
const source = createSourceDefinition("src-codex-delegation-append", "codex", codexDir);
|
|
107
|
+
const firstPayload = (await runSourceProbe({ source_ids: [source.id] }, [source])).sources[0];
|
|
108
|
+
assert.ok(firstPayload);
|
|
109
|
+
await appendFile(sessionPath, `${JSON.stringify({
|
|
110
|
+
timestamp: "2026-04-12T01:01:07.000Z",
|
|
111
|
+
type: "event_msg",
|
|
112
|
+
payload: {
|
|
113
|
+
type: "user_message",
|
|
114
|
+
message: "An appended delegated instruction must remain evidence.",
|
|
115
|
+
},
|
|
116
|
+
})}\n`, "utf8");
|
|
117
|
+
const advancedMtime = new Date("2030-01-01T00:00:00.000Z");
|
|
118
|
+
await utimes(sessionPath, advancedMtime, advancedMtime);
|
|
119
|
+
const progressStages = [];
|
|
120
|
+
const updatedPayload = (await runSourceProbe({
|
|
121
|
+
source_ids: [source.id],
|
|
122
|
+
changed_since: "1h",
|
|
123
|
+
previous_payloads: { [source.id]: firstPayload },
|
|
124
|
+
on_progress: (event) => progressStages.push(event.stage),
|
|
125
|
+
}, [source])).sources[0];
|
|
126
|
+
assert.ok(updatedPayload);
|
|
127
|
+
assert.ok(progressStages.includes("file_append_done"));
|
|
128
|
+
assert.equal(updatedPayload.sessions[0]?.title, "Atlas");
|
|
129
|
+
assert.equal(updatedPayload.sessions[0]?.turn_count, 0);
|
|
130
|
+
assert.equal(updatedPayload.sessions[0]?.resume_command, undefined);
|
|
131
|
+
assert.equal(updatedPayload.turns.length, 0);
|
|
132
|
+
assert.ok(updatedPayload.fragments.some((fragment) => fragment.fragment_kind === "session_relation"));
|
|
133
|
+
assert.ok(updatedPayload.atoms.some((atom) => atom.origin_kind === "delegated_instruction" &&
|
|
134
|
+
atom.payload.text === "An appended delegated instruction must remain evidence."));
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
test("[codex] turn with only tool calls (no assistant text) gets model from turn_context", async () => {
|
|
141
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-model-fallback-"));
|
|
142
|
+
try {
|
|
143
|
+
const codexDir = path.join(tempRoot, "codex-toolcall-only");
|
|
144
|
+
await mkdir(codexDir, { recursive: true });
|
|
145
|
+
await writeFile(path.join(codexDir, "rollout-2026-03-09T00-00-00-toolcall.jsonl"), [
|
|
146
|
+
{
|
|
147
|
+
timestamp: "2026-03-09T01:00:00.000Z",
|
|
148
|
+
type: "session_meta",
|
|
149
|
+
payload: { id: "codex-toolcall-session", cwd: "/workspace" },
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
timestamp: "2026-03-09T01:00:00.500Z",
|
|
153
|
+
type: "turn_context",
|
|
154
|
+
payload: { cwd: "/workspace", model: "gpt-5.2" },
|
|
155
|
+
},
|
|
156
|
+
// Real user message (Codex uses response_item/message/user for user input)
|
|
157
|
+
{
|
|
158
|
+
timestamp: "2026-03-09T01:00:01.000Z",
|
|
159
|
+
type: "response_item",
|
|
160
|
+
payload: {
|
|
161
|
+
type: "message",
|
|
162
|
+
role: "user",
|
|
163
|
+
content: [{ type: "input_text", text: "Generate AGENTS.md for this project." }],
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
// Assistant does tool calls only — no text response
|
|
167
|
+
{
|
|
168
|
+
timestamp: "2026-03-09T01:00:02.000Z",
|
|
169
|
+
type: "response_item",
|
|
170
|
+
payload: {
|
|
171
|
+
type: "function_call",
|
|
172
|
+
call_id: "call-1",
|
|
173
|
+
name: "read_file",
|
|
174
|
+
arguments: '{"path":"README.md"}',
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
timestamp: "2026-03-09T01:00:03.000Z",
|
|
179
|
+
type: "response_item",
|
|
180
|
+
payload: {
|
|
181
|
+
type: "function_call_output",
|
|
182
|
+
call_id: "call-1",
|
|
183
|
+
output: "# My Project\nA demo project.",
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
timestamp: "2026-03-09T01:00:04.000Z",
|
|
188
|
+
type: "response_item",
|
|
189
|
+
payload: {
|
|
190
|
+
type: "function_call",
|
|
191
|
+
call_id: "call-2",
|
|
192
|
+
name: "write_file",
|
|
193
|
+
arguments: '{"path":"AGENTS.md","content":"# Agents guide"}',
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
timestamp: "2026-03-09T01:00:05.000Z",
|
|
198
|
+
type: "response_item",
|
|
199
|
+
payload: {
|
|
200
|
+
type: "function_call_output",
|
|
201
|
+
call_id: "call-2",
|
|
202
|
+
output: "AGENTS.md written",
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
]
|
|
206
|
+
.map((line) => JSON.stringify(line))
|
|
207
|
+
.join("\n"), "utf8");
|
|
208
|
+
const source = createSourceDefinition("src-codex-toolcall-only", "codex", codexDir);
|
|
209
|
+
const result = await runSourceProbe({ source_ids: [source.id] }, [source]);
|
|
210
|
+
const payload = result.sources[0];
|
|
211
|
+
assert.ok(payload);
|
|
212
|
+
assert.equal(payload.sessions.length, 1);
|
|
213
|
+
assert.equal(payload.turns.length, 1);
|
|
214
|
+
// Model should be populated from turn_context even without assistant text
|
|
215
|
+
assert.equal(payload.turns[0]?.context_summary?.primary_model, "gpt-5.2", "primary_model should fall back to turn_context model when no assistant text reply exists");
|
|
216
|
+
}
|
|
217
|
+
finally {
|
|
218
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
test("[codex] preserves source session UUID and resume command provenance", async () => {
|
|
222
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-resume-"));
|
|
223
|
+
try {
|
|
224
|
+
const codexDir = path.join(tempRoot, "codex-resume");
|
|
225
|
+
await mkdir(codexDir, { recursive: true });
|
|
226
|
+
const sourceSessionId = "7f0fbe2e-0e5e-4eaf-a184-23fe9b0db001";
|
|
227
|
+
await writeFile(path.join(codexDir, "rollout-2026-03-09T00-00-00-resume.jsonl"), [
|
|
228
|
+
{
|
|
229
|
+
timestamp: "2026-03-09T01:00:00.000Z",
|
|
230
|
+
type: "session_meta",
|
|
231
|
+
payload: { id: sourceSessionId, cwd: "/workspace/codex-resume", model: "gpt-5.2" },
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
timestamp: "2026-03-09T01:00:01.000Z",
|
|
235
|
+
type: "response_item",
|
|
236
|
+
payload: {
|
|
237
|
+
type: "message",
|
|
238
|
+
role: "user",
|
|
239
|
+
content: [{ type: "input_text", text: "Recover resume command." }],
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
timestamp: "2026-03-09T01:00:02.000Z",
|
|
244
|
+
type: "response_item",
|
|
245
|
+
payload: {
|
|
246
|
+
type: "message",
|
|
247
|
+
role: "assistant",
|
|
248
|
+
content: [{ type: "output_text", text: "Done." }],
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
]
|
|
252
|
+
.map((line) => JSON.stringify(line))
|
|
253
|
+
.join("\n"), "utf8");
|
|
254
|
+
const source = createSourceDefinition("src-codex-resume", "codex", codexDir);
|
|
255
|
+
const result = await runSourceProbe({ source_ids: [source.id] }, [source]);
|
|
256
|
+
const payload = result.sources[0];
|
|
257
|
+
const session = payload?.sessions[0];
|
|
258
|
+
assert.ok(session);
|
|
259
|
+
assert.equal(session.id, `sess:codex:${sourceSessionId}`);
|
|
260
|
+
assert.equal(session.source_session_id, sourceSessionId);
|
|
261
|
+
assert.equal(session.resume_working_directory, "/workspace/codex-resume");
|
|
262
|
+
assert.equal(session.resume_command, `cd /workspace/codex-resume && codex resume ${sourceSessionId}`);
|
|
263
|
+
assert.equal(session.resume_command_confidence, 1);
|
|
264
|
+
assert.match(payload?.turns[0]?.path_text ?? "", /\/workspace\/codex-resume/u);
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
test("[codex] models encrypted reasoning as opaque evidence without warning", async () => {
|
|
271
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-reasoning-opaque-"));
|
|
272
|
+
try {
|
|
273
|
+
const codexDir = path.join(tempRoot, "codex-reasoning-opaque");
|
|
274
|
+
await mkdir(codexDir, { recursive: true });
|
|
275
|
+
await writeFile(path.join(codexDir, "rollout-2026-03-09T00-00-00-reasoning.jsonl"), [
|
|
276
|
+
{
|
|
277
|
+
timestamp: "2026-03-09T01:00:00.000Z",
|
|
278
|
+
type: "session_meta",
|
|
279
|
+
payload: { id: "codex-reasoning-session", cwd: "/workspace/codex-reasoning", model: "gpt-5.2" },
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
timestamp: "2026-03-09T01:00:01.000Z",
|
|
283
|
+
type: "response_item",
|
|
284
|
+
payload: {
|
|
285
|
+
type: "message",
|
|
286
|
+
role: "user",
|
|
287
|
+
content: [{ type: "input_text", text: "Explain the opaque reasoning evidence." }],
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
timestamp: "2026-03-09T01:00:02.000Z",
|
|
292
|
+
type: "response_item",
|
|
293
|
+
payload: {
|
|
294
|
+
type: "reasoning",
|
|
295
|
+
encrypted_content: "encrypted-reasoning-payload",
|
|
296
|
+
summary: [],
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
timestamp: "2026-03-09T01:00:03.000Z",
|
|
301
|
+
type: "response_item",
|
|
302
|
+
payload: {
|
|
303
|
+
type: "message",
|
|
304
|
+
role: "assistant",
|
|
305
|
+
content: [
|
|
306
|
+
{ type: "reasoning", encrypted_content: "encrypted-message-reasoning" },
|
|
307
|
+
{ type: "output_text", text: "The reasoning payload is present but unreadable." },
|
|
308
|
+
],
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
]
|
|
312
|
+
.map((line) => JSON.stringify(line))
|
|
313
|
+
.join("\n"), "utf8");
|
|
314
|
+
const source = createSourceDefinition("src-codex-reasoning-opaque", "codex", codexDir);
|
|
315
|
+
const result = await runSourceProbe({ source_ids: [source.id] }, [source]);
|
|
316
|
+
const payload = result.sources[0];
|
|
317
|
+
assert.ok(payload);
|
|
318
|
+
const opaqueFragments = payload.fragments.filter((fragment) => fragment.payload.signal_kind === "reasoning_opaque");
|
|
319
|
+
assert.equal(opaqueFragments.length, 2);
|
|
320
|
+
assert.ok(opaqueFragments.every((fragment) => fragment.fragment_kind === "unknown"));
|
|
321
|
+
assert.ok(opaqueFragments.every((fragment) => fragment.payload.opaque_reasoning === true));
|
|
322
|
+
assert.ok(opaqueFragments.every((fragment) => fragment.payload.encrypted_content_present === true));
|
|
323
|
+
assert.equal(payload.loss_audits.some((audit) => audit.diagnostic_code === "codex_unhandled_record_type" ||
|
|
324
|
+
audit.diagnostic_code === "codex_unsupported_content_item"), false);
|
|
325
|
+
assert.equal(payload.turns.length, 1);
|
|
326
|
+
}
|
|
327
|
+
finally {
|
|
328
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
test("[codex] event user, agent, and reasoning messages are classified without false loss audits", async () => {
|
|
332
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-event-messages-"));
|
|
333
|
+
try {
|
|
334
|
+
const codexDir = path.join(tempRoot, "codex-event-messages");
|
|
335
|
+
await mkdir(codexDir, { recursive: true });
|
|
336
|
+
await writeFile(path.join(codexDir, "rollout-2026-03-09T00-00-00-event-messages.jsonl"), [
|
|
337
|
+
{
|
|
338
|
+
timestamp: "2026-03-09T01:00:00.000Z",
|
|
339
|
+
type: "session_meta",
|
|
340
|
+
payload: { id: "codex-event-message-session", cwd: "/workspace/codex-event-messages", model: "gpt-5.2" },
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
timestamp: "2026-03-09T01:00:01.000Z",
|
|
344
|
+
type: "event_msg",
|
|
345
|
+
payload: {
|
|
346
|
+
type: "user_message",
|
|
347
|
+
message: "<environment_context>\n <cwd>/workspace/codex-event-messages</cwd>\n</environment_context>\n\nClassify Codex event messages.",
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
timestamp: "2026-03-09T01:00:02.000Z",
|
|
352
|
+
type: "event_msg",
|
|
353
|
+
payload: {
|
|
354
|
+
type: "agent_message",
|
|
355
|
+
phase: "commentary",
|
|
356
|
+
message: "Classifying event messages.",
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
timestamp: "2026-03-09T01:00:03.000Z",
|
|
361
|
+
type: "event_msg",
|
|
362
|
+
payload: {
|
|
363
|
+
type: "agent_reasoning",
|
|
364
|
+
text: "Reasoning trace exists here.",
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
]
|
|
368
|
+
.map((line) => JSON.stringify(line))
|
|
369
|
+
.join("\n"), "utf8");
|
|
370
|
+
const source = createSourceDefinition("src-codex-event-messages", "codex", codexDir);
|
|
371
|
+
const result = await runSourceProbe({ source_ids: [source.id] }, [source]);
|
|
372
|
+
const payload = result.sources[0];
|
|
373
|
+
assert.ok(payload);
|
|
374
|
+
assert.equal(payload.turns.length, 1);
|
|
375
|
+
const turn = payload.turns[0];
|
|
376
|
+
assert.ok(turn);
|
|
377
|
+
assert.equal(turn.user_messages.length, 2);
|
|
378
|
+
assert.equal(turn.user_messages[0]?.is_injected, true);
|
|
379
|
+
assert.equal(turn.user_messages[1]?.is_injected, false);
|
|
380
|
+
assert.equal(turn.user_messages[1]?.raw_text, "Classify Codex event messages.");
|
|
381
|
+
const context = payload.contexts[0];
|
|
382
|
+
assert.ok(context);
|
|
383
|
+
assert.equal(context.assistant_replies.length, 1);
|
|
384
|
+
assert.equal(context.assistant_replies[0]?.content, "Classifying event messages.");
|
|
385
|
+
assert.equal(payload.fragments.some((fragment) => fragment.payload.signal_kind === "agent_reasoning"), true);
|
|
386
|
+
assert.equal(payload.loss_audits.some((audit) => audit.diagnostic_code === "codex_unhandled_record_type"), false);
|
|
387
|
+
}
|
|
388
|
+
finally {
|
|
389
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
test("[codex] search, tool, mcp, and patch event messages become evidence without unhandled warnings", async () => {
|
|
393
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-event-tools-"));
|
|
394
|
+
try {
|
|
395
|
+
const codexDir = path.join(tempRoot, "codex-event-tools");
|
|
396
|
+
await mkdir(codexDir, { recursive: true });
|
|
397
|
+
await writeFile(path.join(codexDir, "rollout-2026-03-09T00-00-00-event-tools.jsonl"), [
|
|
398
|
+
{
|
|
399
|
+
timestamp: "2026-03-09T01:00:00.000Z",
|
|
400
|
+
type: "session_meta",
|
|
401
|
+
payload: { id: "codex-event-tool-session", cwd: "/workspace/codex-event-tools", model: "gpt-5.2" },
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
timestamp: "2026-03-09T01:00:01.000Z",
|
|
405
|
+
type: "event_msg",
|
|
406
|
+
payload: {
|
|
407
|
+
type: "user_message",
|
|
408
|
+
message: "Preserve Codex event tool evidence.",
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
timestamp: "2026-03-09T01:00:02.000Z",
|
|
413
|
+
type: "event_msg",
|
|
414
|
+
payload: {
|
|
415
|
+
type: "agent_message",
|
|
416
|
+
message: "Inspecting event tool evidence.",
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
timestamp: "2026-03-09T01:00:03.000Z",
|
|
421
|
+
type: "event_msg",
|
|
422
|
+
payload: {
|
|
423
|
+
type: "web_search_call",
|
|
424
|
+
status: "running",
|
|
425
|
+
action: { type: "search", query: "Codex event_msg parser" },
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
timestamp: "2026-03-09T01:00:04.000Z",
|
|
430
|
+
type: "event_msg",
|
|
431
|
+
payload: {
|
|
432
|
+
type: "web_search_end",
|
|
433
|
+
call_id: "web-search-1",
|
|
434
|
+
query: "Codex event_msg parser",
|
|
435
|
+
action: { type: "search" },
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
timestamp: "2026-03-09T01:00:05.000Z",
|
|
440
|
+
type: "event_msg",
|
|
441
|
+
payload: {
|
|
442
|
+
type: "tool_search_call",
|
|
443
|
+
call_id: "tool-search-1",
|
|
444
|
+
execution: "local",
|
|
445
|
+
status: "running",
|
|
446
|
+
arguments: { query: "fragment parser", limit: 3 },
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
timestamp: "2026-03-09T01:00:06.000Z",
|
|
451
|
+
type: "event_msg",
|
|
452
|
+
payload: {
|
|
453
|
+
type: "tool_search_output",
|
|
454
|
+
call_id: "tool-search-1",
|
|
455
|
+
execution: "local",
|
|
456
|
+
status: "success",
|
|
457
|
+
tools: [{ name: "tool_search" }],
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
timestamp: "2026-03-09T01:00:07.000Z",
|
|
462
|
+
type: "event_msg",
|
|
463
|
+
payload: {
|
|
464
|
+
type: "mcp_tool_call_end",
|
|
465
|
+
call_id: "mcp-1",
|
|
466
|
+
invocation: { server: "docs", tool: "read_doc", arguments: { uri: "doc://codex" } },
|
|
467
|
+
duration: { secs: 1, nanos: 500000000 },
|
|
468
|
+
result: { Ok: { content: "ok" } },
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
timestamp: "2026-03-09T01:00:08.000Z",
|
|
473
|
+
type: "event_msg",
|
|
474
|
+
payload: {
|
|
475
|
+
type: "patch_apply_end",
|
|
476
|
+
call_id: "patch-1",
|
|
477
|
+
status: "success",
|
|
478
|
+
success: true,
|
|
479
|
+
turn_id: "turn-1",
|
|
480
|
+
changes: [{ path: "README.md", kind: "update" }],
|
|
481
|
+
stdout: "applied",
|
|
482
|
+
stderr: "",
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
]
|
|
486
|
+
.map((line) => JSON.stringify(line))
|
|
487
|
+
.join("\n"), "utf8");
|
|
488
|
+
const source = createSourceDefinition("src-codex-event-tools", "codex", codexDir);
|
|
489
|
+
const result = await runSourceProbe({ source_ids: [source.id] }, [source]);
|
|
490
|
+
const payload = result.sources[0];
|
|
491
|
+
assert.ok(payload);
|
|
492
|
+
assert.equal(payload.turns.length, 1);
|
|
493
|
+
assert.equal(payload.loss_audits.some((audit) => audit.diagnostic_code === "codex_unhandled_record_type"), false);
|
|
494
|
+
const sourceEventTypes = new Set(payload.fragments.map((fragment) => fragment.payload.source_event_type));
|
|
495
|
+
assert.equal(sourceEventTypes.has("web_search_call"), true);
|
|
496
|
+
assert.equal(sourceEventTypes.has("web_search_end"), true);
|
|
497
|
+
assert.equal(sourceEventTypes.has("tool_search_call"), true);
|
|
498
|
+
assert.equal(sourceEventTypes.has("tool_search_output"), true);
|
|
499
|
+
assert.equal(sourceEventTypes.has("mcp_tool_call_end"), true);
|
|
500
|
+
assert.equal(sourceEventTypes.has("patch_apply_end"), true);
|
|
501
|
+
const toolCallFragments = payload.fragments.filter((fragment) => fragment.fragment_kind === "tool_call");
|
|
502
|
+
const toolResultFragments = payload.fragments.filter((fragment) => fragment.fragment_kind === "tool_result");
|
|
503
|
+
assert.equal(toolCallFragments.length, 4);
|
|
504
|
+
assert.equal(toolResultFragments.length, 4);
|
|
505
|
+
const context = payload.contexts[0];
|
|
506
|
+
assert.ok(context);
|
|
507
|
+
assert.equal(context.tool_calls.length, 4);
|
|
508
|
+
assert.deepEqual(context.tool_calls.map((toolCall) => toolCall.tool_name).sort(), ["apply_patch", "read_doc", "tool_search", "web_search"]);
|
|
509
|
+
assert.ok(context.tool_calls.some((toolCall) => toolCall.tool_name === "tool_search" && toolCall.output?.includes("tool_count")));
|
|
510
|
+
assert.ok(context.tool_calls.some((toolCall) => toolCall.tool_name === "apply_patch" && toolCall.output?.includes("success")));
|
|
511
|
+
}
|
|
512
|
+
finally {
|
|
513
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
test("[codex] top-level response search and tool-search calls become evidence without warnings", async () => {
|
|
517
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-response-search-"));
|
|
518
|
+
try {
|
|
519
|
+
const codexDir = path.join(tempRoot, "codex-response-search");
|
|
520
|
+
await mkdir(codexDir, { recursive: true });
|
|
521
|
+
await writeFile(path.join(codexDir, "rollout-2026-03-09T00-00-00-response-search.jsonl"), [
|
|
522
|
+
{
|
|
523
|
+
timestamp: "2026-03-09T01:00:00.000Z",
|
|
524
|
+
type: "session_meta",
|
|
525
|
+
payload: { id: "codex-response-search-session", cwd: "/workspace/codex-response-search", model: "gpt-5.2" },
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
timestamp: "2026-03-09T01:00:01.000Z",
|
|
529
|
+
type: "response_item",
|
|
530
|
+
payload: {
|
|
531
|
+
type: "message",
|
|
532
|
+
role: "user",
|
|
533
|
+
content: [{ type: "input_text", text: "Search from a top-level response item." }],
|
|
534
|
+
},
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
timestamp: "2026-03-09T01:00:02.000Z",
|
|
538
|
+
type: "response_item",
|
|
539
|
+
payload: {
|
|
540
|
+
type: "web_search_call",
|
|
541
|
+
status: "completed",
|
|
542
|
+
action: { type: "search", query: "Codex response web_search_call" },
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
timestamp: "2026-03-09T01:00:03.000Z",
|
|
547
|
+
type: "response_item",
|
|
548
|
+
payload: {
|
|
549
|
+
type: "tool_search_call",
|
|
550
|
+
call_id: "tool-search-response-1",
|
|
551
|
+
execution: "local",
|
|
552
|
+
status: "running",
|
|
553
|
+
arguments: { query: "Codex response tool_search_call", limit: 3 },
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
timestamp: "2026-03-09T01:00:04.000Z",
|
|
558
|
+
type: "response_item",
|
|
559
|
+
payload: {
|
|
560
|
+
type: "tool_search_output",
|
|
561
|
+
call_id: "tool-search-response-1",
|
|
562
|
+
execution: "local",
|
|
563
|
+
status: "success",
|
|
564
|
+
tools: [{ name: "tool_search" }],
|
|
565
|
+
},
|
|
566
|
+
},
|
|
567
|
+
]
|
|
568
|
+
.map((line) => JSON.stringify(line))
|
|
569
|
+
.join("\n"), "utf8");
|
|
570
|
+
const source = createSourceDefinition("src-codex-response-search", "codex", codexDir);
|
|
571
|
+
const result = await runSourceProbe({ source_ids: [source.id] }, [source]);
|
|
572
|
+
const payload = result.sources[0];
|
|
573
|
+
assert.ok(payload);
|
|
574
|
+
assert.equal(payload.turns.length, 1);
|
|
575
|
+
assert.equal(payload.loss_audits.some((audit) => audit.diagnostic_code === "codex_unhandled_record_type"), false);
|
|
576
|
+
const webSearchFragment = payload.fragments.find((fragment) => fragment.fragment_kind === "tool_call" && fragment.payload.source_event_type === "web_search_call");
|
|
577
|
+
assert.ok(webSearchFragment);
|
|
578
|
+
assert.equal(webSearchFragment.payload.tool_name, "web_search");
|
|
579
|
+
const toolSearchCallFragment = payload.fragments.find((fragment) => fragment.fragment_kind === "tool_call" && fragment.payload.source_event_type === "tool_search_call");
|
|
580
|
+
const toolSearchResultFragment = payload.fragments.find((fragment) => fragment.fragment_kind === "tool_result" && fragment.payload.source_event_type === "tool_search_output");
|
|
581
|
+
assert.ok(toolSearchCallFragment);
|
|
582
|
+
assert.ok(toolSearchResultFragment);
|
|
583
|
+
assert.equal(toolSearchCallFragment.payload.tool_name, "tool_search");
|
|
584
|
+
assert.equal(toolSearchCallFragment.payload.call_id, "tool-search-response-1");
|
|
585
|
+
assert.equal(toolSearchResultFragment.payload.call_id, "tool-search-response-1");
|
|
586
|
+
assert.equal(payload.contexts[0]?.tool_calls.some((toolCall) => toolCall.tool_name === "web_search"), true);
|
|
587
|
+
assert.equal(payload.contexts[0]?.tool_calls.some((toolCall) => toolCall.tool_name === "tool_search"), true);
|
|
588
|
+
}
|
|
589
|
+
finally {
|
|
590
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
test("[codex] lifecycle and replacement-history events stay hidden and do not create turns", async () => {
|
|
594
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-lifecycle-"));
|
|
595
|
+
try {
|
|
596
|
+
const codexDir = path.join(tempRoot, "codex-lifecycle");
|
|
597
|
+
await mkdir(codexDir, { recursive: true });
|
|
598
|
+
await writeFile(path.join(codexDir, "rollout-2026-03-09T00-00-00-lifecycle.jsonl"), [
|
|
599
|
+
{
|
|
600
|
+
timestamp: "2026-03-09T01:00:00.000Z",
|
|
601
|
+
type: "session_meta",
|
|
602
|
+
payload: { id: "codex-lifecycle-session", cwd: "/workspace/codex-lifecycle", model: "gpt-5.2" },
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
timestamp: "2026-03-09T01:00:01.000Z",
|
|
606
|
+
type: "response_item",
|
|
607
|
+
payload: {
|
|
608
|
+
type: "message",
|
|
609
|
+
role: "user",
|
|
610
|
+
content: [{ type: "input_text", text: "Keep lifecycle events out of recall anchors." }],
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
timestamp: "2026-03-09T01:00:02.000Z",
|
|
615
|
+
type: "response_item",
|
|
616
|
+
payload: {
|
|
617
|
+
type: "message",
|
|
618
|
+
role: "assistant",
|
|
619
|
+
content: [{ type: "output_text", text: "Lifecycle events will stay as metadata." }],
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
timestamp: "2026-03-09T01:00:03.000Z",
|
|
624
|
+
type: "compacted",
|
|
625
|
+
payload: {
|
|
626
|
+
type: "context_compacted",
|
|
627
|
+
replacement_history: [
|
|
628
|
+
{ type: "message", role: "user", content: "This replacement-history user text is not a new turn." },
|
|
629
|
+
{ type: "message", role: "assistant", content: "This replacement-history assistant text is metadata." },
|
|
630
|
+
],
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
timestamp: "2026-03-09T01:00:04.000Z",
|
|
635
|
+
type: "event_msg",
|
|
636
|
+
payload: {
|
|
637
|
+
type: "thread_goal_updated",
|
|
638
|
+
turnId: "turn-goal-1",
|
|
639
|
+
status: "active",
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
timestamp: "2026-03-09T01:00:05.000Z",
|
|
644
|
+
type: "event_msg",
|
|
645
|
+
payload: {
|
|
646
|
+
type: "task_started",
|
|
647
|
+
turn_id: "turn-task-1",
|
|
648
|
+
source: { type: "subagent", subagent: { thread_spawn: { parent_thread_id: "parent-thread-1" } } },
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
timestamp: "2026-03-09T01:00:06.000Z",
|
|
653
|
+
type: "event_msg",
|
|
654
|
+
payload: {
|
|
655
|
+
type: "task_complete",
|
|
656
|
+
turn_id: "turn-task-1",
|
|
657
|
+
status: "success",
|
|
658
|
+
},
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
timestamp: "2026-03-09T01:00:07.000Z",
|
|
662
|
+
type: "event_msg",
|
|
663
|
+
payload: {
|
|
664
|
+
type: "turn_aborted",
|
|
665
|
+
reason: "user_cancelled",
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
timestamp: "2026-03-09T01:00:08.000Z",
|
|
670
|
+
type: "event_msg",
|
|
671
|
+
payload: {
|
|
672
|
+
type: "thread_rolled_back",
|
|
673
|
+
num_turns: 1,
|
|
674
|
+
},
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
timestamp: "2026-03-09T01:00:09.000Z",
|
|
678
|
+
type: "event_msg",
|
|
679
|
+
payload: {
|
|
680
|
+
type: "entered_review_mode",
|
|
681
|
+
status: "active",
|
|
682
|
+
},
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
timestamp: "2026-03-09T01:00:10.000Z",
|
|
686
|
+
type: "event_msg",
|
|
687
|
+
payload: {
|
|
688
|
+
type: "exited_review_mode",
|
|
689
|
+
reason: "accepted",
|
|
690
|
+
},
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
timestamp: "2026-03-09T01:00:11.000Z",
|
|
694
|
+
type: "event_msg",
|
|
695
|
+
payload: {
|
|
696
|
+
type: "item_completed",
|
|
697
|
+
status: "done",
|
|
698
|
+
target: { branch: "main" },
|
|
699
|
+
},
|
|
700
|
+
},
|
|
701
|
+
]
|
|
702
|
+
.map((line) => JSON.stringify(line))
|
|
703
|
+
.join("\n"), "utf8");
|
|
704
|
+
const source = createSourceDefinition("src-codex-lifecycle", "codex", codexDir);
|
|
705
|
+
const result = await runSourceProbe({ source_ids: [source.id] }, [source]);
|
|
706
|
+
const payload = result.sources[0];
|
|
707
|
+
assert.ok(payload);
|
|
708
|
+
assert.equal(payload.turns.length, 1);
|
|
709
|
+
assert.equal(payload.turns[0]?.canonical_text, "Keep lifecycle events out of recall anchors.");
|
|
710
|
+
assert.equal(payload.turns.some((turn) => turn.canonical_text.includes("replacement-history user text")), false);
|
|
711
|
+
assert.equal(payload.loss_audits.some((audit) => audit.diagnostic_code === "codex_unhandled_record_type"), false);
|
|
712
|
+
const lifecycleFragments = payload.fragments.filter((fragment) => fragment.payload.source_event_type === "context_compacted" ||
|
|
713
|
+
fragment.payload.source_event_type === "thread_goal_updated" ||
|
|
714
|
+
fragment.payload.source_event_type === "task_started" ||
|
|
715
|
+
fragment.payload.source_event_type === "task_complete" ||
|
|
716
|
+
fragment.payload.source_event_type === "turn_aborted" ||
|
|
717
|
+
fragment.payload.source_event_type === "thread_rolled_back" ||
|
|
718
|
+
fragment.payload.source_event_type === "entered_review_mode" ||
|
|
719
|
+
fragment.payload.source_event_type === "exited_review_mode" ||
|
|
720
|
+
fragment.payload.source_event_type === "item_completed");
|
|
721
|
+
assert.equal(lifecycleFragments.length, 9);
|
|
722
|
+
assert.ok(lifecycleFragments.every((fragment) => fragment.fragment_kind === "unknown"));
|
|
723
|
+
assert.ok(lifecycleFragments.every((fragment) => fragment.payload.replacement_history === undefined));
|
|
724
|
+
assert.equal(lifecycleFragments.some((fragment) => fragment.payload.replacement_history_item_count === 2), true);
|
|
725
|
+
assert.equal(payload.atoms.some((atom) => atom.payload.signal_kind === "context_compacted" && atom.display_policy === "hide"), true);
|
|
726
|
+
assert.equal(payload.atoms.some((atom) => atom.payload.parent_thread_id === "parent-thread-1" && atom.display_policy === "hide"), true);
|
|
727
|
+
assert.equal(payload.atoms.some((atom) => atom.payload.signal_kind === "entered_review_mode" && atom.display_policy === "hide"), true);
|
|
728
|
+
assert.equal(payload.atoms.some((atom) => atom.payload.signal_kind === "exited_review_mode" && atom.display_policy === "hide"), true);
|
|
729
|
+
assert.equal(payload.atoms.some((atom) => atom.payload.signal_kind === "item_completed" && atom.payload.target_branch === "main"), true);
|
|
730
|
+
}
|
|
731
|
+
finally {
|
|
732
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
test("[codex] reuse backfills resume provenance from upgraded previous payloads", async () => {
|
|
736
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-resume-reuse-"));
|
|
737
|
+
try {
|
|
738
|
+
const codexDir = path.join(tempRoot, "codex-resume-reuse");
|
|
739
|
+
await mkdir(codexDir, { recursive: true });
|
|
740
|
+
const sourceSessionId = "3d0e1719-a13b-4d1e-a340-5a11e901bdb1";
|
|
741
|
+
const sessionPath = path.join(codexDir, "rollout-2026-03-09T00-00-00-resume-reuse.jsonl");
|
|
742
|
+
await writeFile(sessionPath, [
|
|
743
|
+
{
|
|
744
|
+
timestamp: "2026-03-09T01:00:00.000Z",
|
|
745
|
+
type: "session_meta",
|
|
746
|
+
payload: { id: sourceSessionId, cwd: "/workspace/codex-resume-reuse", model: "gpt-5.2" },
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
timestamp: "2026-03-09T01:00:01.000Z",
|
|
750
|
+
type: "response_item",
|
|
751
|
+
payload: {
|
|
752
|
+
type: "message",
|
|
753
|
+
role: "user",
|
|
754
|
+
content: [{ type: "input_text", text: "Backfill reused resume command." }],
|
|
755
|
+
},
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
timestamp: "2026-03-09T01:00:02.000Z",
|
|
759
|
+
type: "response_item",
|
|
760
|
+
payload: {
|
|
761
|
+
type: "message",
|
|
762
|
+
role: "assistant",
|
|
763
|
+
content: [{ type: "output_text", text: "Done." }],
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
|
+
]
|
|
767
|
+
.map((line) => JSON.stringify(line))
|
|
768
|
+
.join("\n"), "utf8");
|
|
769
|
+
const oldDate = new Date("2020-01-01T00:00:00.000Z");
|
|
770
|
+
await utimes(sessionPath, oldDate, oldDate);
|
|
771
|
+
const source = createSourceDefinition("src-codex-resume-reuse", "codex", codexDir);
|
|
772
|
+
const firstPayload = (await runSourceProbe({ source_ids: [source.id] }, [source])).sources[0];
|
|
773
|
+
assert.ok(firstPayload);
|
|
774
|
+
const previousPayload = JSON.parse(JSON.stringify(firstPayload));
|
|
775
|
+
const previousSession = previousPayload.sessions[0];
|
|
776
|
+
assert.ok(previousSession);
|
|
777
|
+
delete previousSession.source_session_id;
|
|
778
|
+
delete previousSession.resume_command;
|
|
779
|
+
delete previousSession.resume_working_directory;
|
|
780
|
+
delete previousSession.resume_command_confidence;
|
|
781
|
+
const progressStages = [];
|
|
782
|
+
const reusedPayload = (await runSourceProbe({
|
|
783
|
+
source_ids: [source.id],
|
|
784
|
+
changed_since: "1h",
|
|
785
|
+
previous_payloads: { [source.id]: previousPayload },
|
|
786
|
+
on_progress: (event) => progressStages.push(event.stage),
|
|
787
|
+
}, [source])).sources[0];
|
|
788
|
+
const session = reusedPayload?.sessions[0];
|
|
789
|
+
assert.ok(progressStages.includes("file_skip"), "unchanged old file should be reused");
|
|
790
|
+
assert.ok(session);
|
|
791
|
+
assert.equal(session.source_session_id, sourceSessionId);
|
|
792
|
+
assert.equal(session.resume_working_directory, "/workspace/codex-resume-reuse");
|
|
793
|
+
assert.equal(session.resume_command, `cd /workspace/codex-resume-reuse && codex resume ${sourceSessionId}`);
|
|
794
|
+
assert.equal(session.resume_command_confidence, 1);
|
|
795
|
+
}
|
|
796
|
+
finally {
|
|
797
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
test("[codex] stale previous parser diagnostics are not reused after parser version changes", async () => {
|
|
801
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-codex-parser-version-reuse-"));
|
|
802
|
+
try {
|
|
803
|
+
const codexDir = path.join(tempRoot, "codex-parser-version-reuse");
|
|
804
|
+
await mkdir(codexDir, { recursive: true });
|
|
805
|
+
const sessionPath = path.join(codexDir, "rollout-2026-03-09T00-00-00-event-reparse.jsonl");
|
|
806
|
+
await writeFile(sessionPath, [
|
|
807
|
+
{
|
|
808
|
+
timestamp: "2026-03-09T01:00:00.000Z",
|
|
809
|
+
type: "session_meta",
|
|
810
|
+
payload: { id: "codex-parser-version-session", cwd: "/workspace/codex-parser-version", model: "gpt-5.2" },
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
timestamp: "2026-03-09T01:00:01.000Z",
|
|
814
|
+
type: "event_msg",
|
|
815
|
+
payload: {
|
|
816
|
+
type: "user_message",
|
|
817
|
+
message: "Reparse clean Codex event messages after parser upgrade.",
|
|
818
|
+
},
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
timestamp: "2026-03-09T01:00:02.000Z",
|
|
822
|
+
type: "event_msg",
|
|
823
|
+
payload: {
|
|
824
|
+
type: "agent_message",
|
|
825
|
+
message: "This is now a supported event message.",
|
|
826
|
+
},
|
|
827
|
+
},
|
|
828
|
+
]
|
|
829
|
+
.map((line) => JSON.stringify(line))
|
|
830
|
+
.join("\n"), "utf8");
|
|
831
|
+
const oldDate = new Date("2020-01-01T00:00:00.000Z");
|
|
832
|
+
await utimes(sessionPath, oldDate, oldDate);
|
|
833
|
+
const source = createSourceDefinition("src-codex-parser-version-reuse", "codex", codexDir);
|
|
834
|
+
const firstPayload = (await runSourceProbe({ source_ids: [source.id] }, [source])).sources[0];
|
|
835
|
+
assert.ok(firstPayload);
|
|
836
|
+
assert.equal(firstPayload.loss_audits.some((audit) => audit.diagnostic_code === "codex_unhandled_record_type"), false);
|
|
837
|
+
const stalePayload = JSON.parse(JSON.stringify(firstPayload));
|
|
838
|
+
for (const stageRun of stalePayload.stage_runs) {
|
|
839
|
+
stageRun.parser_version = "codex-parser@2026-03-11.1";
|
|
840
|
+
}
|
|
841
|
+
stalePayload.loss_audits.push({
|
|
842
|
+
id: "loss-audit:stale-codex-unhandled-record-type",
|
|
843
|
+
source_id: source.id,
|
|
844
|
+
stage_run_id: "stage-run:stale-parse-source-fragments",
|
|
845
|
+
stage_kind: "parse_source_fragments",
|
|
846
|
+
diagnostic_code: "codex_unhandled_record_type",
|
|
847
|
+
severity: "warning",
|
|
848
|
+
scope_ref: firstPayload.records[1]?.id ?? firstPayload.records[0]?.id ?? "record:stale",
|
|
849
|
+
session_ref: firstPayload.sessions[0]?.id,
|
|
850
|
+
blob_ref: firstPayload.blobs[0]?.id,
|
|
851
|
+
record_ref: firstPayload.records[1]?.id ?? firstPayload.records[0]?.id,
|
|
852
|
+
source_format_profile_id: "codex:jsonl:v1",
|
|
853
|
+
loss_kind: "unknown_fragment",
|
|
854
|
+
detail: "Stale diagnostic from an older Codex parser.",
|
|
855
|
+
created_at: "2026-03-09T01:00:03.000Z",
|
|
856
|
+
});
|
|
857
|
+
const progressStages = [];
|
|
858
|
+
const reparsedPayload = (await runSourceProbe({
|
|
859
|
+
source_ids: [source.id],
|
|
860
|
+
changed_since: "1h",
|
|
861
|
+
previous_payloads: { [source.id]: stalePayload },
|
|
862
|
+
on_progress: (event) => progressStages.push(event.stage),
|
|
863
|
+
}, [source])).sources[0];
|
|
864
|
+
assert.ok(reparsedPayload);
|
|
865
|
+
assert.equal(progressStages.includes("file_skip"), false, "old parser payload should not reuse unchanged file");
|
|
866
|
+
assert.equal(progressStages.includes("file_parse_done"), true, "old parser payload should be parsed with current semantics");
|
|
867
|
+
assert.equal(reparsedPayload.loss_audits.some((audit) => audit.diagnostic_code === "codex_unhandled_record_type"), false);
|
|
868
|
+
assert.equal(reparsedPayload.turns.length, 1);
|
|
869
|
+
assert.equal(reparsedPayload.contexts[0]?.assistant_replies[0]?.content, "This is now a supported event message.");
|
|
870
|
+
}
|
|
871
|
+
finally {
|
|
872
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
test("[codex] root history jsonl stays out of default capture when scanning the source root", async () => {
|
|
876
|
+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), "cchistory-source-adapters-"));
|
|
877
|
+
try {
|
|
878
|
+
const sources = await seedSupportedSourceFixtures(tempRoot);
|
|
879
|
+
const codexSource = sources.find((source) => source.platform === "codex");
|
|
880
|
+
assert.ok(codexSource);
|
|
881
|
+
const result = await runSourceProbe({ source_ids: [codexSource.id] }, [codexSource]);
|
|
882
|
+
const payload = result.sources[0];
|
|
883
|
+
assert.ok(payload);
|
|
884
|
+
assert.equal(payload.source.sync_status, "healthy");
|
|
885
|
+
assert.equal(payload.blobs.some((blob) => path.basename(blob.origin_path) === "session.jsonl"), false);
|
|
886
|
+
assert.equal(payload.sessions.length, 1);
|
|
887
|
+
assert.equal(payload.turns.length, 1);
|
|
888
|
+
}
|
|
889
|
+
finally {
|
|
890
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
//# sourceMappingURL=codex.test.js.map
|