@smthrs/gateway 1.0.0-rc.3 → 1.0.0-rc.4
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/README.md +1 -1
- package/dist/cjs/EngineTrace.d.ts.map +1 -1
- package/dist/cjs/EngineTrace.js +10 -2
- package/dist/cjs/EngineTrace.js.map +2 -2
- package/dist/cjs/GatewayProjection.d.ts.map +1 -1
- package/dist/cjs/GatewayProjection.js +10 -1
- package/dist/cjs/GatewayProjection.js.map +2 -2
- package/dist/cjs/HostBranchPresence.d.ts +7 -0
- package/dist/cjs/HostBranchPresence.d.ts.map +1 -1
- package/dist/cjs/HostBranchPresence.js.map +2 -2
- package/dist/cjs/RunTrace.d.ts.map +1 -1
- package/dist/cjs/RunTrace.js +3 -1
- package/dist/cjs/RunTrace.js.map +2 -2
- package/dist/cjs/internal/actionRenderings.d.ts +10 -0
- package/dist/cjs/internal/actionRenderings.d.ts.map +1 -1
- package/dist/cjs/internal/actionRenderings.js.map +2 -2
- package/dist/cjs/internal/inspectLabels.d.ts +5 -0
- package/dist/cjs/internal/inspectLabels.d.ts.map +1 -1
- package/dist/cjs/internal/inspectLabels.js.map +2 -2
- package/dist/esm/EngineTrace.d.ts.map +1 -1
- package/dist/esm/EngineTrace.js +19 -10
- package/dist/esm/EngineTrace.js.map +1 -1
- package/dist/esm/GatewayProjection.d.ts.map +1 -1
- package/dist/esm/GatewayProjection.js +7 -0
- package/dist/esm/GatewayProjection.js.map +1 -1
- package/dist/esm/HostBranchPresence.d.ts +7 -0
- package/dist/esm/HostBranchPresence.d.ts.map +1 -1
- package/dist/esm/HostBranchPresence.js +4 -1
- package/dist/esm/HostBranchPresence.js.map +1 -1
- package/dist/esm/RunTrace.d.ts.map +1 -1
- package/dist/esm/RunTrace.js +4 -3
- package/dist/esm/RunTrace.js.map +1 -1
- package/dist/esm/internal/actionRenderings.d.ts +10 -0
- package/dist/esm/internal/actionRenderings.d.ts.map +1 -1
- package/dist/esm/internal/actionRenderings.js +10 -0
- package/dist/esm/internal/actionRenderings.js.map +1 -1
- package/dist/esm/internal/inspectLabels.d.ts +5 -0
- package/dist/esm/internal/inspectLabels.d.ts.map +1 -1
- package/dist/esm/internal/inspectLabels.js +5 -0
- package/dist/esm/internal/inspectLabels.js.map +1 -1
- package/package.json +13 -13
- package/src/EngineTrace.ts +34 -12
- package/src/GatewayProjection.ts +17 -6
- package/src/HostBranchPresence.ts +5 -1
- package/src/RunTrace.ts +9 -6
- package/src/internal/actionRenderings.ts +11 -0
- package/src/internal/inspectLabels.ts +6 -1
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The deterministic Inspect label of each kept action in .specs/product/actions.md
|
|
3
|
+
* Appendix C, keyed by action id; null marks an action whose Inspect shows no label.
|
|
4
|
+
*
|
|
5
|
+
* @since 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
1
11
|
export declare const ACTION_RENDERINGS: Readonly<Record<string, string | null>>;
|
|
2
12
|
//# sourceMappingURL=actionRenderings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionRenderings.d.ts","sourceRoot":"","sources":["../../../src/internal/actionRenderings.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAuMrE,CAAA"}
|
|
1
|
+
{"version":3,"file":"actionRenderings.d.ts","sourceRoot":"","sources":["../../../src/internal/actionRenderings.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAuMrE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/internal/actionRenderings.ts"],
|
|
4
|
-
"sourcesContent": ["// Generated by scripts/catalog-mvp.ts from Appendix C; do not edit.\nexport const ACTION_RENDERINGS: Readonly<Record<string, string | null>> = {\n \"<boundary:name>\": null,\n \"<park>/parked\": null,\n \"<quota-park>/<session>\": null,\n \"<seal-step>\": null,\n \"<structured-output-count>/<name>\": null,\n \"agent/capacity/<seat>/cool/<n>\": \"Waiting for a model\",\n \"agent/opening-instructions\": \"Read the instructions\",\n \"agent/opening-memory\": \"Loaded context\",\n \"agent/route-seat\": \"Chose a model\",\n \"agent/run\": \"Worked a turn\",\n \"agent/send (stamp)\": null,\n \"agent/trace/checkpoint\": null,\n \"apply_patch\": \"An attributed edit in the File and Diff cards\",\n \"ask\": \"Needs you\",\n \"bash\": \"Terminal card (agent session). Missing: no terminal today\",\n \"checks/lint\": \"Linted the change\",\n \"checks/review\": \"Reviewed the change\",\n \"checks/security\": \"Reviewed security\",\n \"checks/wiki\": \"Checked the wiki\",\n \"coding/AdmitVibe\": \"Opened the change for landing\",\n \"coding/ApplyNative\": \"Applied the changes\",\n \"coding/CleanVibeHistory\": \"Tidied the history\",\n \"coding/CommandCheck\": \"Ran checks\",\n \"coding/CoordinateRequest\": \"Worked the TODO\",\n \"coding/CorrectPlan\": \"Fixed review findings\",\n \"coding/CorrectionRound\": \"Fixed review findings\",\n \"coding/DescribeFinalAtom\": \"Wrote the commit message\",\n \"coding/Dispatch\": \"Ran an agent turn\",\n \"coding/FlowLoad\": \"Validated the flows\",\n \"coding/ImplementAtom\": \"Implemented one step\",\n \"coding/ImplementAtoms\": \"Implemented the plan\",\n \"coding/ImplementPlan\": \"Implemented the plan\",\n \"coding/JevCheck\": \"Checked rules\",\n \"coding/LandVibe\": \"Landed the change\",\n \"coding/ObservePlan\": \"Tracked progress\",\n \"coding/Poc\": \"Drafted a prototype\",\n \"coding/PreparePlan\": \"Planned the change\",\n \"coding/PrepareRequest\": \"Prepared the request\",\n \"coding/ProposeFinalHistory\": \"Reviewed the history\",\n \"coding/Prototype\": \"Drafted a prototype\",\n \"coding/PublishVibeSource\": \"Published the change\",\n \"coding/ReadNative\": \"Read the changes\",\n \"coding/RecheckCorrected\": \"Re-checked the fix\",\n \"coding/RecheckFinalHistory\": \"Re-checked the history\",\n \"coding/RefreshWiki\": \"Refreshed wiki pages\",\n \"coding/RepairPass\": \"Repaired the change\",\n \"coding/ReviewCapturedChange\": \"Reviewed the change\",\n \"coding/ReviewCapturedWiki\": \"Checked the wiki\",\n \"coding/ReviewCheck\": \"Reviewed the change\",\n \"coding/RewriteFinalHistory\": \"Tidied the history\",\n \"coding/SecurityAudit\": \"Audited security\",\n \"coding/SecurityReviewCheck\": \"Reviewed security\",\n \"coding/VerifyVibe\": \"Verified before landing\",\n \"coding/Wiki\": \"Refreshed the wiki\",\n \"coding/WikiCheck\": \"Checked the wiki\",\n \"coding/admit-retained-source\": \"Opened the source\",\n \"coding/admit-verify-source\": \"Opened the candidate\",\n \"coding/assess\": \"Assessed the change\",\n \"coding/audit-security\": \"Audited security\",\n \"coding/begin-correction\": \"Started a fix round\",\n \"coding/capture-poc-source\": \"Captured the source\",\n \"coding/capture-review-check\": \"Captured the change\",\n \"coding/capture-wiki-check\": \"Captured the wiki\",\n \"coding/check\": \"Ran checks\",\n \"coding/check-command\": \"Ran checks\",\n \"coding/check-jev-rules\": \"Checked rules\",\n \"coding/configure-planning-wiki\": \"Chose wiki pages\",\n \"coding/confirm-final-description\": \"Confirmed the commit message\",\n \"coding/create-stack-base\": \"Created the stack base\",\n \"coding/create-vibe-landing\": \"Added to the stack\",\n \"coding/decline-request\": \"Declined the request\",\n \"coding/dispatch-turn\": \"Worked a turn\",\n \"coding/draft-plan\": \"Drafted the plan\",\n \"coding/draft-poc\": \"Drafted a prototype\",\n \"coding/edit-atom\": \"Edited the files\",\n \"coding/fast-forward-vibe\": \"Moved the branch forward\",\n \"coding/fast-gate\": \"Ran quick checks\",\n \"coding/fence-vibe-source\": \"Pinned the change\",\n \"coding/finalize-plan\": \"Finalized the plan\",\n \"coding/find-planning-wiki-review\": \"Found wiki notes\",\n \"coding/finish-correction\": \"Finished the fix round\",\n \"coding/finish-final-history\": \"Finished the history\",\n \"coding/finish-review-check\": \"Collected review findings\",\n \"coding/finish-wiki-check\": \"Checked the wiki\",\n \"coding/gather-planning-context\": \"Gathered context\",\n \"coding/implement-change\": \"Implemented the change\",\n \"coding/import-dependency-docs\": \"Imported dependency docs\",\n \"coding/install-dependency-pages\": \"Added dependency pages\",\n \"coding/load-flows\": \"Validated the flows\",\n \"coding/materialize-poc\": \"Applied the prototype\",\n \"coding/merge-request-feedback\": \"Took in your steer\",\n \"coding/merge-vibe-local-pull\": \"Merged the change\",\n \"coding/observe-atom\": \"Saved the edit\",\n \"coding/observe-dispatch\": \"Saved the turn\",\n \"coding/observe-vibe-append\": \"Added to the stack\",\n \"coding/observe-vibe-pull-checks\": \"Watched PR checks\",\n \"coding/open-vibe-local-pull\": \"Opened the pull request\",\n \"coding/open-vibe-pull\": \"Opened the pull request\",\n \"coding/prepare-atom\": \"Opened the working copy\",\n \"coding/prepare-atom-mutation\": \"Prepared to edit\",\n \"coding/prepare-final-description\": \"Drafted the commit message\",\n \"coding/prepare-owner-repair\": \"Prepared the repair\",\n \"coding/prepare-repair-context\": \"Gathered repair context\",\n \"coding/prepare-return-mythical-tip\": \"Returned to the stack tip\",\n \"coding/prepare-stack-base\": \"Prepared the stack\",\n \"coding/prepare-vibe-append\": \"Prepared to add to the stack\",\n \"coding/prepare-vibe-candidate\": \"Prepared the change\",\n \"coding/publish-vibe-source\": \"Published the change\",\n \"coding/queue-vibe-append\": \"Queued for the stack\",\n \"coding/read-correction-history\": \"Read earlier fixes\",\n \"coding/read-feedback-cancellation\": \"Read your steer\",\n \"coding/read-published-wiki\": \"Read the wiki\",\n \"coding/read-vibe-delivery\": \"Read delivery status\",\n \"coding/read-vibe-lander\": \"Read landing state\",\n \"coding/read-vibe-request\": \"Read the request\",\n \"coding/read-vibe-stack\": \"Read the stack\",\n \"coding/receive-request-feedback\": \"Waited for your steer\",\n \"coding/record-fast-gated-progress\": \"Recorded progress\",\n \"coding/record-learning\": \"Saved a lesson\",\n \"coding/record-slow-feedback\": \"Recorded feedback\",\n \"coding/refresh-final-history\": \"Refreshed the history\",\n \"coding/refresh-planning-wiki\": \"Refreshed wiki pages\",\n \"coding/refresh-restacked-evidence\": \"Refreshed evidence\",\n \"coding/refuse-plan-approval\": \"Refused a plan approval\",\n \"coding/repair-final-history\": \"Corrected the history\",\n \"coding/retain-poc\": \"Saved the prototype\",\n \"coding/review-final-history\": \"Reviewed the history\",\n \"coding/review-lens\": \"Reviewed through one lens\",\n \"coding/review-poc\": \"Reviewed the prototype\",\n \"coding/review-request\": \"Reviewed the request\",\n \"coding/review-security\": \"Reviewed security\",\n \"coding/run-correction-round\": \"Fixed review findings\",\n \"coding/select-owner-repair\": \"Chose what to fix\",\n \"coding/submit-vibe-lane\": \"Queued the change\",\n \"coding/todo-boundary\": null,\n \"coding/todo-delivery\": \"Prepared the delivery\",\n \"coding/todo-pause-requested\": null,\n \"coding/todo-resume\": null,\n \"coding/todo-review\": null,\n \"coding/todo-review-input\": null,\n \"coding/validate-final-history\": \"Checked the history\",\n \"coding/validate-plan\": \"Checked the plan\",\n \"coding/verify-planning-context\": \"Checked the context\",\n \"coding/verify-vibe-landed\": \"Confirmed it landed\",\n \"create-flow\": \"Created a flow\",\n \"create-flow/clarify\": \"Asked what the flow should do\",\n \"create-flow/design\": \"Designed the flow\",\n \"create-flow/document\": \"Documented the flow\",\n \"create-flow/fix\": \"Fixed the flow\",\n \"create-flow/provision\": \"Set up the flow\",\n \"create-flow/scaffold\": \"Wrote the flow\",\n \"edit\": \"An attributed edit in the File and Diff cards\",\n \"factory/Todo\": \"Routed the TODO\",\n \"factory/route-todo\": \"Chose how to start\",\n \"factory/stamp-route\": \"Declined the TODO\",\n \"glob\": \"A \\\"read\\\" line in branch activity, opening the File card\",\n \"grep\": \"A \\\"read\\\" line in branch activity, opening the File card\",\n \"jev\": \"Inspect only: \\\"Decided <question>\\\"\",\n \"ls\": \"A \\\"read\\\" line in branch activity, opening the File card\",\n \"memory\": \"The \\\"Context\\\" line and the preflight cell in Inspect\",\n \"memory/mine\": \"Saved lessons\",\n \"memory/mine/run\": \"Saved lessons\",\n \"read\": \"A \\\"read\\\" line in branch activity, opening the File card\",\n \"recall\": \"The \\\"Context\\\" line and the preflight cell in Inspect\",\n \"recall (namespaced)\": \"The \\\"Context\\\" line and the preflight cell in Inspect\",\n \"remember\": \"Learning receipt\",\n \"review\": \"Reviewed the change\",\n \"smithers-review/ApplyVerdicts\": \"Settled findings\",\n \"smithers-review/FinalizeReview\": \"Finished the review\",\n \"smithers-review/MergeFileBatch\": \"Collected findings\",\n \"smithers-review/NarrateChanges\": \"Wrote the walkthrough\",\n \"smithers-review/NarrateReview\": \"Wrote the walkthrough\",\n \"smithers-review/PrepareReview\": \"Prepared the review\",\n \"smithers-review/RenderWalkthrough\": \"Rendered the walkthrough\",\n \"smithers-review/ReviewFile\": \"Reviewed one file\",\n \"smithers-review/ReviewFiles\": \"Reviewed the files\",\n \"smithers-review/VerifyFindings\": \"Verified findings\",\n \"smithers-review/VerifyReview\": \"Verified findings\",\n \"smithers/IncrementalWiki\": \"Refreshed the wiki\",\n \"smithers/Wiki\": \"Refreshed the wiki\",\n \"stack.candidate\": \"Saved the candidate\",\n \"stack.propose\": \"Proposed the candidate\",\n \"system/human-task\": \"Waited for your answer\",\n \"system/sleep\": null,\n \"system/wait-for\": null,\n \"test\": \"Terminal card plus checks. Missing: needs SMITHERS_TEST_COMMAND\",\n \"wait\": \"Waited\",\n \"wiki/assess-review\": \"Assessed a wiki page\",\n \"wiki/bind-review-provenance\": \"Linked a review to its source\",\n \"wiki/check-citations\": \"Checked citations\",\n \"wiki/collect-page\": \"Collected sources for a page\",\n \"wiki/load-recorded-reviews\": \"Found earlier reviews\",\n \"wiki/publish-recorded-reviews\": \"Saved wiki pages\",\n \"wiki/review-page\": \"Reviewed a wiki page\",\n \"wiki/select-recorded-review\": \"Reused a review\",\n \"wiki/validate-review\": \"Checked a wiki page\",\n \"wiki/write-snapshot\": \"Saved wiki pages\",\n \"write\": \"An attributed edit in the File and Diff cards\"\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["// Generated by scripts/catalog-mvp.ts from Appendix C; do not edit.\n/**\n * The deterministic Inspect label of each kept action in .specs/product/actions.md\n * Appendix C, keyed by action id; null marks an action whose Inspect shows no label.\n *\n * @since 1.0.0\n */\n\n/**\n * @since 1.0.0\n * @private\n */\nexport const ACTION_RENDERINGS: Readonly<Record<string, string | null>> = {\n \"<boundary:name>\": null,\n \"<park>/parked\": null,\n \"<quota-park>/<session>\": null,\n \"<seal-step>\": null,\n \"<structured-output-count>/<name>\": null,\n \"agent/capacity/<seat>/cool/<n>\": \"Waiting for a model\",\n \"agent/opening-instructions\": \"Read the instructions\",\n \"agent/opening-memory\": \"Loaded context\",\n \"agent/route-seat\": \"Chose a model\",\n \"agent/run\": \"Worked a turn\",\n \"agent/send (stamp)\": null,\n \"agent/trace/checkpoint\": null,\n \"apply_patch\": \"An attributed edit in the File and Diff cards\",\n \"ask\": \"Needs you\",\n \"bash\": \"Terminal card (agent session). Missing: no terminal today\",\n \"checks/lint\": \"Linted the change\",\n \"checks/review\": \"Reviewed the change\",\n \"checks/security\": \"Reviewed security\",\n \"checks/wiki\": \"Checked the wiki\",\n \"coding/AdmitVibe\": \"Opened the change for landing\",\n \"coding/ApplyNative\": \"Applied the changes\",\n \"coding/CleanVibeHistory\": \"Tidied the history\",\n \"coding/CommandCheck\": \"Ran checks\",\n \"coding/CoordinateRequest\": \"Worked the TODO\",\n \"coding/CorrectPlan\": \"Fixed review findings\",\n \"coding/CorrectionRound\": \"Fixed review findings\",\n \"coding/DescribeFinalAtom\": \"Wrote the commit message\",\n \"coding/Dispatch\": \"Ran an agent turn\",\n \"coding/FlowLoad\": \"Validated the flows\",\n \"coding/ImplementAtom\": \"Implemented one step\",\n \"coding/ImplementAtoms\": \"Implemented the plan\",\n \"coding/ImplementPlan\": \"Implemented the plan\",\n \"coding/JevCheck\": \"Checked rules\",\n \"coding/LandVibe\": \"Landed the change\",\n \"coding/ObservePlan\": \"Tracked progress\",\n \"coding/Poc\": \"Drafted a prototype\",\n \"coding/PreparePlan\": \"Planned the change\",\n \"coding/PrepareRequest\": \"Prepared the request\",\n \"coding/ProposeFinalHistory\": \"Reviewed the history\",\n \"coding/Prototype\": \"Drafted a prototype\",\n \"coding/PublishVibeSource\": \"Published the change\",\n \"coding/ReadNative\": \"Read the changes\",\n \"coding/RecheckCorrected\": \"Re-checked the fix\",\n \"coding/RecheckFinalHistory\": \"Re-checked the history\",\n \"coding/RefreshWiki\": \"Refreshed wiki pages\",\n \"coding/RepairPass\": \"Repaired the change\",\n \"coding/ReviewCapturedChange\": \"Reviewed the change\",\n \"coding/ReviewCapturedWiki\": \"Checked the wiki\",\n \"coding/ReviewCheck\": \"Reviewed the change\",\n \"coding/RewriteFinalHistory\": \"Tidied the history\",\n \"coding/SecurityAudit\": \"Audited security\",\n \"coding/SecurityReviewCheck\": \"Reviewed security\",\n \"coding/VerifyVibe\": \"Verified before landing\",\n \"coding/Wiki\": \"Refreshed the wiki\",\n \"coding/WikiCheck\": \"Checked the wiki\",\n \"coding/admit-retained-source\": \"Opened the source\",\n \"coding/admit-verify-source\": \"Opened the candidate\",\n \"coding/assess\": \"Assessed the change\",\n \"coding/audit-security\": \"Audited security\",\n \"coding/begin-correction\": \"Started a fix round\",\n \"coding/capture-poc-source\": \"Captured the source\",\n \"coding/capture-review-check\": \"Captured the change\",\n \"coding/capture-wiki-check\": \"Captured the wiki\",\n \"coding/check\": \"Ran checks\",\n \"coding/check-command\": \"Ran checks\",\n \"coding/check-jev-rules\": \"Checked rules\",\n \"coding/configure-planning-wiki\": \"Chose wiki pages\",\n \"coding/confirm-final-description\": \"Confirmed the commit message\",\n \"coding/create-stack-base\": \"Created the stack base\",\n \"coding/create-vibe-landing\": \"Added to the stack\",\n \"coding/decline-request\": \"Declined the request\",\n \"coding/dispatch-turn\": \"Worked a turn\",\n \"coding/draft-plan\": \"Drafted the plan\",\n \"coding/draft-poc\": \"Drafted a prototype\",\n \"coding/edit-atom\": \"Edited the files\",\n \"coding/fast-forward-vibe\": \"Moved the branch forward\",\n \"coding/fast-gate\": \"Ran quick checks\",\n \"coding/fence-vibe-source\": \"Pinned the change\",\n \"coding/finalize-plan\": \"Finalized the plan\",\n \"coding/find-planning-wiki-review\": \"Found wiki notes\",\n \"coding/finish-correction\": \"Finished the fix round\",\n \"coding/finish-final-history\": \"Finished the history\",\n \"coding/finish-review-check\": \"Collected review findings\",\n \"coding/finish-wiki-check\": \"Checked the wiki\",\n \"coding/gather-planning-context\": \"Gathered context\",\n \"coding/implement-change\": \"Implemented the change\",\n \"coding/import-dependency-docs\": \"Imported dependency docs\",\n \"coding/install-dependency-pages\": \"Added dependency pages\",\n \"coding/load-flows\": \"Validated the flows\",\n \"coding/materialize-poc\": \"Applied the prototype\",\n \"coding/merge-request-feedback\": \"Took in your steer\",\n \"coding/merge-vibe-local-pull\": \"Merged the change\",\n \"coding/observe-atom\": \"Saved the edit\",\n \"coding/observe-dispatch\": \"Saved the turn\",\n \"coding/observe-vibe-append\": \"Added to the stack\",\n \"coding/observe-vibe-pull-checks\": \"Watched PR checks\",\n \"coding/open-vibe-local-pull\": \"Opened the pull request\",\n \"coding/open-vibe-pull\": \"Opened the pull request\",\n \"coding/prepare-atom\": \"Opened the working copy\",\n \"coding/prepare-atom-mutation\": \"Prepared to edit\",\n \"coding/prepare-final-description\": \"Drafted the commit message\",\n \"coding/prepare-owner-repair\": \"Prepared the repair\",\n \"coding/prepare-repair-context\": \"Gathered repair context\",\n \"coding/prepare-return-mythical-tip\": \"Returned to the stack tip\",\n \"coding/prepare-stack-base\": \"Prepared the stack\",\n \"coding/prepare-vibe-append\": \"Prepared to add to the stack\",\n \"coding/prepare-vibe-candidate\": \"Prepared the change\",\n \"coding/publish-vibe-source\": \"Published the change\",\n \"coding/queue-vibe-append\": \"Queued for the stack\",\n \"coding/read-correction-history\": \"Read earlier fixes\",\n \"coding/read-feedback-cancellation\": \"Read your steer\",\n \"coding/read-published-wiki\": \"Read the wiki\",\n \"coding/read-vibe-delivery\": \"Read delivery status\",\n \"coding/read-vibe-lander\": \"Read landing state\",\n \"coding/read-vibe-request\": \"Read the request\",\n \"coding/read-vibe-stack\": \"Read the stack\",\n \"coding/receive-request-feedback\": \"Waited for your steer\",\n \"coding/record-fast-gated-progress\": \"Recorded progress\",\n \"coding/record-learning\": \"Saved a lesson\",\n \"coding/record-slow-feedback\": \"Recorded feedback\",\n \"coding/refresh-final-history\": \"Refreshed the history\",\n \"coding/refresh-planning-wiki\": \"Refreshed wiki pages\",\n \"coding/refresh-restacked-evidence\": \"Refreshed evidence\",\n \"coding/refuse-plan-approval\": \"Refused a plan approval\",\n \"coding/repair-final-history\": \"Corrected the history\",\n \"coding/retain-poc\": \"Saved the prototype\",\n \"coding/review-final-history\": \"Reviewed the history\",\n \"coding/review-lens\": \"Reviewed through one lens\",\n \"coding/review-poc\": \"Reviewed the prototype\",\n \"coding/review-request\": \"Reviewed the request\",\n \"coding/review-security\": \"Reviewed security\",\n \"coding/run-correction-round\": \"Fixed review findings\",\n \"coding/select-owner-repair\": \"Chose what to fix\",\n \"coding/submit-vibe-lane\": \"Queued the change\",\n \"coding/todo-boundary\": null,\n \"coding/todo-delivery\": \"Prepared the delivery\",\n \"coding/todo-pause-requested\": null,\n \"coding/todo-resume\": null,\n \"coding/todo-review\": null,\n \"coding/todo-review-input\": null,\n \"coding/validate-final-history\": \"Checked the history\",\n \"coding/validate-plan\": \"Checked the plan\",\n \"coding/verify-planning-context\": \"Checked the context\",\n \"coding/verify-vibe-landed\": \"Confirmed it landed\",\n \"create-flow\": \"Created a flow\",\n \"create-flow/clarify\": \"Asked what the flow should do\",\n \"create-flow/design\": \"Designed the flow\",\n \"create-flow/document\": \"Documented the flow\",\n \"create-flow/fix\": \"Fixed the flow\",\n \"create-flow/provision\": \"Set up the flow\",\n \"create-flow/scaffold\": \"Wrote the flow\",\n \"edit\": \"An attributed edit in the File and Diff cards\",\n \"factory/Todo\": \"Routed the TODO\",\n \"factory/route-todo\": \"Chose how to start\",\n \"factory/stamp-route\": \"Declined the TODO\",\n \"glob\": \"A \\\"read\\\" line in branch activity, opening the File card\",\n \"grep\": \"A \\\"read\\\" line in branch activity, opening the File card\",\n \"jev\": \"Inspect only: \\\"Decided <question>\\\"\",\n \"ls\": \"A \\\"read\\\" line in branch activity, opening the File card\",\n \"memory\": \"The \\\"Context\\\" line and the preflight cell in Inspect\",\n \"memory/mine\": \"Saved lessons\",\n \"memory/mine/run\": \"Saved lessons\",\n \"read\": \"A \\\"read\\\" line in branch activity, opening the File card\",\n \"recall\": \"The \\\"Context\\\" line and the preflight cell in Inspect\",\n \"recall (namespaced)\": \"The \\\"Context\\\" line and the preflight cell in Inspect\",\n \"remember\": \"Learning receipt\",\n \"review\": \"Reviewed the change\",\n \"smithers-review/ApplyVerdicts\": \"Settled findings\",\n \"smithers-review/FinalizeReview\": \"Finished the review\",\n \"smithers-review/MergeFileBatch\": \"Collected findings\",\n \"smithers-review/NarrateChanges\": \"Wrote the walkthrough\",\n \"smithers-review/NarrateReview\": \"Wrote the walkthrough\",\n \"smithers-review/PrepareReview\": \"Prepared the review\",\n \"smithers-review/RenderWalkthrough\": \"Rendered the walkthrough\",\n \"smithers-review/ReviewFile\": \"Reviewed one file\",\n \"smithers-review/ReviewFiles\": \"Reviewed the files\",\n \"smithers-review/VerifyFindings\": \"Verified findings\",\n \"smithers-review/VerifyReview\": \"Verified findings\",\n \"smithers/IncrementalWiki\": \"Refreshed the wiki\",\n \"smithers/Wiki\": \"Refreshed the wiki\",\n \"stack.candidate\": \"Saved the candidate\",\n \"stack.propose\": \"Proposed the candidate\",\n \"system/human-task\": \"Waited for your answer\",\n \"system/sleep\": null,\n \"system/wait-for\": null,\n \"test\": \"Terminal card plus checks. Missing: needs SMITHERS_TEST_COMMAND\",\n \"wait\": \"Waited\",\n \"wiki/assess-review\": \"Assessed a wiki page\",\n \"wiki/bind-review-provenance\": \"Linked a review to its source\",\n \"wiki/check-citations\": \"Checked citations\",\n \"wiki/collect-page\": \"Collected sources for a page\",\n \"wiki/load-recorded-reviews\": \"Found earlier reviews\",\n \"wiki/publish-recorded-reviews\": \"Saved wiki pages\",\n \"wiki/review-page\": \"Reviewed a wiki page\",\n \"wiki/select-recorded-review\": \"Reused a review\",\n \"wiki/validate-review\": \"Checked a wiki page\",\n \"wiki/write-snapshot\": \"Saved wiki pages\",\n \"write\": \"An attributed edit in the File and Diff cards\"\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,MAAM,oBAA6D;AAAA,EACxE,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,0BAA0B;AAAA,EAC1B,eAAe;AAAA,EACf,oCAAoC;AAAA,EACpC,kCAAkC;AAAA,EAClC,8BAA8B;AAAA,EAC9B,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAC3B,uBAAuB;AAAA,EACvB,4BAA4B;AAAA,EAC5B,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB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yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU;AAAA,EACV,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,iCAAiC;AAAA,EACjC,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,iCAAiC;AAAA,EACjC,iCAAiC;AAAA,EACjC,qCAAqC;AAAA,EACrC,8BAA8B;AAAA,EAC9B,+BAA+B;AAAA,EAC/B,kCAAkC;AAAA,EAClC,gCAAgC;AAAA,EAChC,4BAA4B;AAAA,EAC5B,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,sBAAsB;AAAA,EACtB,+BAA+B;AAAA,EAC/B,wBAAwB;AAAA,EACxB,qBAAqB;AAAA,EACrB,8BAA8B;AAAA,EAC9B,iCAAiC;AAAA,EACjC,oBAAoB;AAAA,EACpB,+BAA+B;AAAA,EAC/B,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,SAAS;AACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspect labels for recorded actions, read from the generated Appendix C table.
|
|
3
|
+
*
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
*/
|
|
1
6
|
/**
|
|
2
7
|
* The recorded action's Appendix C label, with unknown historical tags retained.
|
|
3
8
|
* Dynamic cell-call wrappers name the tool they recorded, never a new action.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspectLabels.d.ts","sourceRoot":"","sources":["../../../src/internal/inspectLabels.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inspectLabels.d.ts","sourceRoot":"","sources":["../../../src/internal/inspectLabels.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MAG1C,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/internal/inspectLabels.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/**\n * Inspect labels for recorded actions, read from the generated Appendix C table.\n *\n * @since 1.0.0\n */\n\nimport { ACTION_RENDERINGS } from \"./actionRenderings.ts\"\n\n/**\n * The recorded action's Appendix C label, with unknown historical tags retained.\n * Dynamic cell-call wrappers name the tool they recorded, never a new action.\n * @category utilities\n * @since 1.0.0\n */\nexport const inspectLabel = (tag: string): string => {\n const tool = /^<cell-call:(.+)>$/.exec(tag)?.[1] ?? tag\n return ACTION_RENDERINGS[tool] ?? tool\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,8BAAkC;AAQ3B,MAAM,eAAe,CAAC,QAAwB;AACnD,QAAM,OAAO,qBAAqB,KAAK,GAAG,IAAI,CAAC,KAAK;AACpD,SAAO,0CAAkB,IAAI,KAAK;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EngineTrace.d.ts","sourceRoot":"","sources":["../../src/EngineTrace.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KA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AAM,uBAAuB,GAClC,SAAS,aAAa,CAAC,aAAa,CAAC,KACpC,aAAa,CAAC,uBAAuB,CAAwC,CAAA;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,aAAa,CAAC,aAAa,CAAC,EAAE,QAAQ,MAAM,EAAE,YAAY,MAAM;;;yBAiB7E,uBAAuB,uBAAqB,OAAO;CAkBhF,CAAA"}
|
package/dist/esm/EngineTrace.js
CHANGED
|
@@ -199,11 +199,12 @@ const foldEngineJournal = (records) => {
|
|
|
199
199
|
}
|
|
200
200
|
return current;
|
|
201
201
|
};
|
|
202
|
-
if (envelope.eventType === EngineEvent.nodeEventTypes.planRecorded ||
|
|
202
|
+
if (envelope.eventType === EngineEvent.nodeEventTypes.planRecorded ||
|
|
203
|
+
envelope.eventType === EngineEvent.nodeEventTypes.subgraphAppended) {
|
|
203
204
|
const payload = envelope.payload;
|
|
204
205
|
const graph = decodeGraph(payload?.graph);
|
|
205
206
|
if (Option.isSome(graph)) {
|
|
206
|
-
const nodes = new Map(execution.graph?.nodes.map(node => [node.id, node]));
|
|
207
|
+
const nodes = new Map(execution.graph?.nodes.map((node) => [node.id, node]));
|
|
207
208
|
for (const node of graph.value.nodes)
|
|
208
209
|
nodes.set(node.id, node);
|
|
209
210
|
execution.graph = { ...graph.value, nodes: [...nodes.values()] };
|
|
@@ -211,18 +212,21 @@ const foldEngineJournal = (records) => {
|
|
|
211
212
|
generic();
|
|
212
213
|
continue;
|
|
213
214
|
}
|
|
214
|
-
if (envelope.eventType === EngineEvent.nodeEventTypes.nodeScheduled ||
|
|
215
|
+
if (envelope.eventType === EngineEvent.nodeEventTypes.nodeScheduled ||
|
|
216
|
+
envelope.eventType === EngineEvent.nodeEventTypes.nodeSettled) {
|
|
215
217
|
const scheduled = envelope.eventType === EngineEvent.nodeEventTypes.nodeScheduled
|
|
216
|
-
? decodeScheduled(envelope.payload) :
|
|
218
|
+
? decodeScheduled(envelope.payload) :
|
|
219
|
+
Option.none();
|
|
217
220
|
const settled = envelope.eventType === EngineEvent.nodeEventTypes.nodeSettled
|
|
218
|
-
? decodeSettled(envelope.payload) :
|
|
221
|
+
? decodeSettled(envelope.payload) :
|
|
222
|
+
Option.none();
|
|
219
223
|
const recorded = Option.isSome(scheduled) ? scheduled.value : Option.isSome(settled) ? settled.value : undefined;
|
|
220
224
|
if (recorded === undefined) {
|
|
221
225
|
generic();
|
|
222
226
|
continue;
|
|
223
227
|
}
|
|
224
228
|
const nodeKey = identity(key, recorded.nodeId);
|
|
225
|
-
const action = recorded.action ?? execution.graph?.nodes.find(node => node.id === recorded.nodeId)?.action;
|
|
229
|
+
const action = recorded.action ?? execution.graph?.nodes.find((node) => node.id === recorded.nodeId)?.action;
|
|
226
230
|
let node = nodes.get(nodeKey);
|
|
227
231
|
if (node === undefined || Option.isSome(scheduled)) {
|
|
228
232
|
const instance = (instances.get(nodeKey) ?? 0) + 1;
|
|
@@ -239,9 +243,13 @@ const foldEngineJournal = (records) => {
|
|
|
239
243
|
}
|
|
240
244
|
else {
|
|
241
245
|
const value = Option.getOrThrow(settled);
|
|
242
|
-
node.status = value.outcome === "failed" ?
|
|
243
|
-
|
|
244
|
-
|
|
246
|
+
node.status = value.outcome === "failed" ?
|
|
247
|
+
"failed"
|
|
248
|
+
: value.outcome === "deferred" ?
|
|
249
|
+
"waiting"
|
|
250
|
+
: value.outcome === "skipped"
|
|
251
|
+
? "skipped"
|
|
252
|
+
: "completed";
|
|
245
253
|
if (value.outcome !== "deferred")
|
|
246
254
|
node.endedAt = envelope.emittedAtMs;
|
|
247
255
|
// The redacted preview is evidence, including when truncated. Never
|
|
@@ -317,8 +325,9 @@ const foldEngineJournal = (records) => {
|
|
|
317
325
|
existing.kind = kind;
|
|
318
326
|
};
|
|
319
327
|
if (recorded.value.event._tag === "Execution" && recorded.value.event.lifecycle.state !== "completed") {
|
|
320
|
-
for (const wait of recorded.value.event.lifecycle.waits)
|
|
328
|
+
for (const wait of recorded.value.event.lifecycle.waits) {
|
|
321
329
|
registerWait(wait.waitId, wait._tag === "Clock" ? "sleep" : "signal");
|
|
330
|
+
}
|
|
322
331
|
}
|
|
323
332
|
if (recorded.value.event._tag === "ClockScheduled") {
|
|
324
333
|
registerWait(recorded.value.event.waitId, "sleep");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EngineTrace.js","sourceRoot":"","sources":["../../src/EngineTrace.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAA;AAC1D,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAG1D,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1B,WAAW,EAAE,YAAY,CAAC,KAAK;IAC/B,UAAU,EAAE,YAAY,CAAC,mBAAmB;IAC5C,QAAQ,EAAE,YAAY,CAAC,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,QAAQ,EAAE,YAAY,CAAC,QAAQ;IAC/B,cAAc,EAAE,YAAY,CAAC,SAAS;IACtC,WAAW,EAAE,YAAY,CAAC,WAAW;IACrC,SAAS,EAAE,MAAM,CAAC,cAAc;IAChC,OAAO,EAAE,MAAM,CAAC,IAAI;IACpB,IAAI,EAAE,MAAM,CAAC,IAAI;CAClB,CAAC,CAAA;AAGF,MAAM,cAAc,GAAG,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAA;AAC3D,MAAM,WAAW,GAAG,MAAM,CAAC,mBAAmB,CAAC,WA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AC,CAAC,CAAE,CAAA;QACzB,CAAC;IACH,CAAC,CAAA;IACD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACtE,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,WAAW,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAA;IAC/F,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;AAClD,CAAC,CAAA","sourcesContent":["/**\n * Recorded native evidence, decoded through the contracts that wrote it.\n *\n * @since 1.0.0\n */\n\nimport { RunState } from \"@smthrs/engine-store/RunState\"\nimport { ResultEncoded } from \"@smthrs/flow/Flow\"\nimport * as EngineEvent from \"@smthrs/journal/EngineEvent\"\nimport * as JournalEvent from \"@smthrs/journal/JournalEvent\"\nimport { Option, Schema } from \"effect\"\nimport { inspectLabel } from \"./internal/inspectLabels.ts\"\nimport type { JournalRecord, SpanDetail, TraceBuilder } from \"./RunTrace.ts\"\n\n// This is the private control bridge's envelope, not another engine contract.\nconst Envelope = Schema.Struct({\n version: Schema.Literal(1),\n executionId: JournalEvent.RunId,\n generation: JournalEvent.NonNegativeQuantity,\n sequence: JournalEvent.Seq,\n eventId: Schema.String,\n sourceId: JournalEvent.SourceId,\n sourceSequence: JournalEvent.SourceSeq,\n emittedAtMs: JournalEvent.TimestampMs,\n eventType: Schema.NonEmptyString,\n payload: Schema.Json,\n meta: Schema.Json\n})\ntype Envelope = typeof Envelope.Type\n\nconst decodeEnvelope = Schema.decodeUnknownOption(Envelope)\nconst decodeGraph = Schema.decodeUnknownOption(EngineEvent.NodeGraph)\nconst decodeScheduled = Schema.decodeUnknownOption(EngineEvent.NodeScheduledPayload)\nconst decodeSettled = Schema.decodeUnknownOption(EngineEvent.NodeSettledPayload)\nconst decodeAttempt = Schema.decodeUnknownOption(EngineEvent.AttemptPayload, { onExcessProperty: \"error\" })\nconst decodeState = Schema.decodeUnknownOption(EngineEvent.StatePayload, { onExcessProperty: \"error\" })\nconst decodeMarker = Schema.decodeUnknownOption(EngineEvent.CurrentAttempt)\nconst stateDecisions = [\n \"created\",\n \"resumed\",\n \"transitioned\",\n \"handed-off\",\n \"lineage-exhausted\",\n \"round-invalid\",\n \"quarantined\",\n \"interrupt-released\"\n] as const\nconst decodeDecision = Schema.decodeUnknownOption(Schema.Struct({\n decision: Schema.Literals(stateDecisions),\n status: Schema.optionalKey(Schema.Literals([\"pending\", \"running\", \"suspended\", \"completed\", \"failed\", \"cancelled\"])),\n state: RunState\n}))\n// RunDriver's durable cancellation record has no run-decision counterpart.\nconst decodeCancellation = Schema.decodeUnknownOption(Schema.Struct({\n outcome: Schema.Literal(\"cancelled\"),\n interruptedAtMs: JournalEvent.TimestampMs,\n owner: Schema.String,\n cascadedTo: Schema.optionalKey(Schema.Array(JournalEvent.RunId))\n}))\nconst decodeResult = Schema.decodeUnknownOption(ResultEncoded, { onExcessProperty: \"error\" })\n\nconst json = (value: unknown): string => typeof value === \"string\" ? value : JSON.stringify(value)\nconst identity = (...parts: ReadonlyArray<string | number>) =>\n parts.map((part) => encodeURIComponent(String(part))).join(\":\")\nconst span = (id: string, kind: TraceBuilder[\"kind\"], label: string, at: number, detail: SpanDetail): TraceBuilder => ({\n id,\n kind,\n label,\n status: \"recorded\",\n startedAt: at,\n children: [],\n detail\n})\nconst detail = (row: JournalRecord, envelope: Envelope): SpanDetail => ({\n sequence: row.sequence,\n event: envelope.eventType,\n fields: { ...envelope }\n})\ninterface Execution {\n readonly envelope: Envelope\n readonly span: TraceBuilder\n parentId?: string | undefined\n parentExecutionId?: string | undefined\n parentKnown?: boolean | undefined\n flowName?: string | undefined\n coherent: boolean\n waits?: Map<string, { id: string; kind: \"sleep\" | \"signal\"; since: number; settledAt?: number }>\n graph?: EngineEvent.NodeGraph | undefined\n result?: { readonly value: unknown; readonly sequence: number } | undefined\n failure?: EngineExecutionEvidence[\"failure\"] | undefined\n}\n\n/**\n * A render-only view of the same decoded execution facts; never persisted.\n *\n * @category models\n * @since 1.0.0\n */\nexport interface EngineExecutionEvidence {\n readonly executionId: string\n readonly generation: number\n readonly spanId: string\n readonly parentExecutionId?: string | undefined\n readonly parentKnown: boolean\n readonly flowName?: string | undefined\n readonly input?: unknown | undefined\n readonly coherent: boolean\n /** Declared nodes, including work not reached at this journal cursor. */\n readonly graph?: EngineEvent.NodeGraph | undefined\n readonly status: string\n /** Recorded clock and deferred registrations and their explicit settlements. */\n readonly waits: ReadonlyArray<{ readonly id: string; readonly kind: \"sleep\" | \"signal\"; readonly since: number; readonly settledAt?: number }>\n readonly result?: { readonly value: unknown; readonly sequence: number } | undefined\n /** Original classified failure bytes, never parsed from rendered detail. */\n readonly failure?: {\n readonly kind: \"cause\" | \"error\" | \"defect\" | \"interrupted\" | \"encoding\"\n readonly value: unknown\n readonly sequence: number\n } | undefined\n}\nconst decodeProjection = Schema.decodeUnknownOption(Schema.Struct({\n version: Schema.Literal(1),\n executionId: JournalEvent.RunId,\n generation: JournalEvent.NonNegativeQuantity\n}))\n\n/**\n * Observation completion is separate from the control run's terminal verdict.\n *\n * @category utilities\n * @since 1.0.0\n */\nexport const engineProjectionPending = (records: ReadonlyArray<JournalRecord> = []): boolean => {\n const states = new Map<string, { generation: number; pending: boolean }>()\n for (const row of [...records].sort((left, right) => (left.sequence ?? 0) - (right.sequence ?? 0))) {\n if (row.kind === \"control.engine.projection-gap\") {\n // The gap is rendered as missing evidence. Stop polling rather than\n // disguising an observation failure as an indefinitely running task.\n for (const state of states.values()) state.pending = false\n continue\n }\n if (row.kind !== \"control.engine.projection-started\" && row.kind !== \"control.engine.projection-settled\") continue\n const decoded = decodeProjection(row.payload)\n if (Option.isNone(decoded)) continue\n const { executionId, generation } = decoded.value\n const current = states.get(executionId)\n if (row.kind === \"control.engine.projection-started\") {\n if (current === undefined || generation > current.generation) {\n states.set(executionId, { generation, pending: true })\n }\n } else if (current?.generation === generation) current.pending = false\n }\n return [...states.values()].some((state) => state.pending)\n}\n\n/**\n * Generations never share attempt identity. Native timestamps describe native\n * work; the outer control sequence still determines the historical UI cursor.\n * Only recorded parent IDs can nest executions. Ambiguous parent generations\n * remain beside the root instead of guessing which historical parent owned them.\n */\nconst foldEngineJournal = (records: ReadonlyArray<JournalRecord>) => {\n const executions = new Map<string, Execution>()\n const attempts = new Map<string, TraceBuilder>()\n const notices: Array<TraceBuilder> = []\n const nodes = new Map<string, TraceBuilder>()\n const instances = new Map<string, number>()\n const seen = new Map<string, string>()\n for (const row of records) {\n if (row.kind === \"control.engine.projection-gap\") {\n const notice = span(\n `engine-gap:${row.sequence ?? notices.length}`,\n \"event\",\n \"Engine evidence gap\",\n row.occurredAt ?? 0,\n {\n sequence: row.sequence,\n event: row.kind,\n fields: { evidence: row.payload }\n }\n )\n notice.status = \"unknown\"\n notice.endedAt = notice.startedAt\n notices.push(notice)\n continue\n }\n if (row.kind !== \"control.engine.event\") continue\n const decoded = decodeEnvelope(row.payload)\n if (Option.isNone(decoded)) {\n const notice = span(\n `engine-invalid:${row.sequence ?? notices.length}`,\n \"event\",\n \"Unreadable engine evidence\",\n row.occurredAt ?? 0,\n {\n sequence: row.sequence,\n event: row.kind,\n fields: { evidence: row.payload }\n }\n )\n notice.status = \"unknown\"\n notice.endedAt = notice.startedAt\n notices.push(notice)\n continue\n }\n const envelope = decoded.value\n const key = identity(envelope.executionId, envelope.generation)\n const eventKey = identity(key, envelope.sequence)\n const previous = seen.get(eventKey)\n if (previous !== undefined) {\n if (previous !== JSON.stringify(envelope)) {\n const conflict = executions.get(key)\n conflict!.coherent = false\n }\n continue\n }\n seen.set(eventKey, JSON.stringify(envelope))\n let execution = executions.get(key)\n if (execution === undefined) {\n execution = {\n envelope,\n coherent: true,\n span: span(`engine:${key}`, \"execution\", envelope.executionId, envelope.emittedAtMs, detail(row, envelope))\n }\n executions.set(key, execution)\n }\n const parent = (parentId: string | undefined) => {\n if (execution.parentKnown && execution.parentExecutionId !== parentId) execution.coherent = false\n execution.parentKnown = true\n execution.parentExecutionId = parentId\n execution.parentId = parentId\n }\n const result = (value: unknown) => {\n if (Number.isSafeInteger(row.sequence) && row.sequence! >= 0) {\n execution.result = { value, sequence: row.sequence! }\n }\n }\n const failure = (kind: NonNullable<EngineExecutionEvidence[\"failure\"]>[\"kind\"], value: unknown) => {\n if (Number.isSafeInteger(row.sequence) && row.sequence! >= 0) {\n execution.failure = { kind, value, sequence: row.sequence! }\n }\n }\n const generic = () => {\n const event = span(\n `engine-event:${eventKey}`,\n \"event\",\n envelope.eventType,\n envelope.emittedAtMs,\n detail(row, envelope)\n )\n event.endedAt = event.startedAt\n execution.span.children.push(event)\n }\n const attempt = (step: string, number: number) => {\n const attemptKey = identity(key, step, number)\n let current = attempts.get(attemptKey)\n if (current === undefined) {\n current = span(\n `engine-attempt:${attemptKey}`,\n \"attempt\",\n `attempt ${number} · ${step.slice(0, 12)}`,\n envelope.emittedAtMs,\n detail(row, envelope)\n )\n attempts.set(attemptKey, current)\n execution.span.children.push(current)\n }\n return current\n }\n if (envelope.eventType === EngineEvent.nodeEventTypes.planRecorded || envelope.eventType === EngineEvent.nodeEventTypes.subgraphAppended) {\n const payload = envelope.payload as { graph?: unknown }\n const graph = decodeGraph(payload?.graph)\n if (Option.isSome(graph)) {\n const nodes = new Map(execution.graph?.nodes.map(node => [node.id, node]))\n for (const node of graph.value.nodes) nodes.set(node.id, node)\n execution.graph = { ...graph.value, nodes: [...nodes.values()] }\n }\n generic()\n continue\n }\n if (envelope.eventType === EngineEvent.nodeEventTypes.nodeScheduled || envelope.eventType === EngineEvent.nodeEventTypes.nodeSettled) {\n const scheduled = envelope.eventType === EngineEvent.nodeEventTypes.nodeScheduled\n ? decodeScheduled(envelope.payload) : Option.none()\n const settled = envelope.eventType === EngineEvent.nodeEventTypes.nodeSettled\n ? decodeSettled(envelope.payload) : Option.none()\n const recorded = Option.isSome(scheduled) ? scheduled.value : Option.isSome(settled) ? settled.value : undefined\n if (recorded === undefined) {\n generic()\n continue\n }\n const nodeKey = identity(key, recorded.nodeId)\n const action = recorded.action ?? execution.graph?.nodes.find(node => node.id === recorded.nodeId)?.action\n let node = nodes.get(nodeKey)\n if (node === undefined || Option.isSome(scheduled)) {\n const instance = (instances.get(nodeKey) ?? 0) + 1\n instances.set(nodeKey, instance)\n node = span(`engine-node:${nodeKey}#${instance}`, \"call\", inspectLabel(action ?? recorded.nodeId), envelope.emittedAtMs, detail(row, envelope))\n nodes.set(nodeKey, node)\n execution.span.children.push(node)\n }\n if (action !== undefined) node.label = inspectLabel(action)\n node.detail = { ...detail(row, envelope), sequence: node.detail.sequence }\n if (Option.isSome(scheduled)) {\n node.status = \"running\"\n } else {\n const value = Option.getOrThrow(settled)\n node.status = value.outcome === \"failed\" ? \"failed\"\n : value.outcome === \"deferred\" ? \"waiting\"\n : value.outcome === \"skipped\" ? \"skipped\" : \"completed\"\n if (value.outcome !== \"deferred\") node.endedAt = envelope.emittedAtMs\n // The redacted preview is evidence, including when truncated. Never\n // evaluate it, or mistake a JSON prefix for a complete return value.\n if (value.result !== undefined) node.detail = { ...node.detail, output: value.result.preview }\n }\n continue\n }\n if (\n envelope.eventType === \"flows.engine.attempt-started\" || envelope.eventType === \"flows.engine.attempt-finished\"\n ) {\n const marker = decodeMarker({ eventType: envelope.eventType, payload: envelope.payload })\n if (Option.isNone(marker) || marker.value.payload.runId !== envelope.executionId) {\n generic()\n continue\n }\n const current = attempt(marker.value.payload.stepKeyDigest, marker.value.payload.attempt)\n if (marker.value.eventType === \"flows.engine.attempt-started\") current.status = \"running\"\n else {\n current.status = marker.value.payload.state === \"succeeded\" ? \"completed\" : \"failed\"\n current.endedAt = envelope.emittedAtMs\n }\n current.detail = { ...current.detail, fields: { ...envelope } }\n continue\n }\n if (envelope.eventType === EngineEvent.attemptEventType) {\n const recorded = decodeAttempt(envelope.payload)\n if (Option.isNone(recorded) || recorded.value.executionId !== envelope.executionId) {\n execution.coherent = false\n generic()\n continue\n }\n const { lifecycle, lineage, stepKeyDigest, attempt: number } = recorded.value\n // Lineage may describe a trampoline predecessor, not a spawned parent.\n // Product ancestry comes only from RunState.parentExecutionId below.\n execution.parentId = lineage.parentRunId ?? undefined\n const current = attempt(stepKeyDigest, number)\n current.startedAt = lifecycle.startedAtMs\n current.status = lifecycle.state === \"succeeded\"\n ? \"completed\"\n : lifecycle.state === \"suspended\"\n ? \"waiting\"\n : lifecycle.state\n current.detail = { ...detail(row, envelope), sequence: current.detail.sequence }\n if (lifecycle.state === \"succeeded\" || lifecycle.state === \"failed\") {\n current.endedAt = lifecycle.finishedAtMs\n current.detail = {\n ...current.detail,\n ...(lifecycle.result._tag === \"Success\"\n ? { output: json(lifecycle.result.value) }\n : { message: json(lifecycle.result.detail) })\n }\n }\n continue\n }\n if (envelope.eventType === EngineEvent.stateEventType) {\n const recorded = decodeState(envelope.payload)\n if (Option.isNone(recorded) || recorded.value.executionId !== envelope.executionId) {\n execution.coherent = false\n generic()\n continue\n }\n execution.parentId = recorded.value.lineage.parentRunId ?? undefined\n const registerWait = (waitId: string, kind: \"sleep\" | \"signal\") => {\n const waits = execution.waits ??= new Map()\n const id = identity(key, waitId)\n const existing = waits.get(id)\n if (existing === undefined) waits.set(id, { id: `engine-wait:${id}`, kind, since: envelope.emittedAtMs })\n // A later clock record refines a generic deferred identity without\n // restarting the wait or dropping its recorded settlement.\n else if (kind === \"sleep\") existing.kind = kind\n }\n if (recorded.value.event._tag === \"Execution\" && recorded.value.event.lifecycle.state !== \"completed\") {\n for (const wait of recorded.value.event.lifecycle.waits) registerWait(wait.waitId, wait._tag === \"Clock\" ? \"sleep\" : \"signal\")\n }\n if (recorded.value.event._tag === \"ClockScheduled\") {\n registerWait(recorded.value.event.waitId, \"sleep\")\n } else if (recorded.value.event._tag === \"DeferredCompleted\") {\n const wait = execution.waits?.get(identity(key, recorded.value.event.waitId))\n if (wait !== undefined && wait.settledAt === undefined) wait.settledAt = envelope.emittedAtMs\n }\n if (recorded.value.event._tag !== \"Execution\") {\n generic()\n continue\n }\n const { lifecycle } = recorded.value.event\n execution.result = undefined\n execution.failure = undefined\n execution.span.detail = {\n ...detail(row, envelope),\n sequence: execution.span.detail.sequence,\n input: execution.span.detail.input\n }\n if (lifecycle.state === \"completed\") {\n execution.span.status = lifecycle.result._tag === \"Success\" ? \"completed\" : \"failed\"\n execution.span.endedAt = envelope.emittedAtMs\n execution.span.detail = {\n ...execution.span.detail,\n ...(lifecycle.result._tag === \"Success\"\n ? { output: json(lifecycle.result.value) }\n : { message: json(lifecycle.result.detail) })\n }\n if (lifecycle.result._tag === \"Success\") result(lifecycle.result.value)\n else failure(lifecycle.result.reason, lifecycle.result.detail)\n } else execution.span.status = lifecycle.state === \"suspended\" ? \"waiting\" : \"running\"\n continue\n }\n if (envelope.eventType === \"flows.engine.interrupted\") {\n const cancelled = decodeCancellation(envelope.payload)\n if (Option.isNone(cancelled)) {\n generic()\n continue\n }\n execution.result = undefined\n execution.failure = undefined\n execution.span.status = \"cancelled\"\n execution.span.endedAt = cancelled.value.interruptedAtMs\n execution.span.detail = {\n ...detail(row, envelope),\n sequence: execution.span.detail.sequence,\n input: execution.span.detail.input\n }\n continue\n }\n if (envelope.eventType === \"flows.engine.run-decision\") {\n const decision = decodeDecision(envelope.payload)\n if (Option.isNone(decision)) {\n const payload = envelope.payload\n // Claim, owner-fence, wake and child-policy decisions deliberately do\n // not carry RunState. Keep them visible without losing valid state\n // evidence; malformed state-bearing decisions still refuse claims.\n if (\n typeof payload === \"object\" && payload !== null &&\n (\"state\" in payload || (\"decision\" in payload && stateDecisions.some((name) => name === payload.decision)))\n ) {\n execution.coherent = false\n }\n generic()\n continue\n }\n const { state, status } = decision.value\n if (execution.flowName !== undefined && execution.flowName !== state.flowName) execution.coherent = false\n execution.flowName = state.flowName\n execution.span.label = inspectLabel(state.flowName)\n parent(state.parentExecutionId)\n execution.result = undefined\n execution.failure = undefined\n execution.span.detail = {\n ...detail(row, envelope),\n sequence: execution.span.detail.sequence,\n input: state.payload\n }\n if (decision.value.decision === \"created\") execution.span.status = \"pending\"\n // RunDriver commits this decision with suspended even when its payload\n // omits status/result (a released host scope can retain no suspension).\n else if (decision.value.decision === \"interrupt-released\") execution.span.status = \"waiting\"\n else if (status === \"running\" || status === \"pending\" || status === \"suspended\") {\n execution.span.status = status === \"suspended\" ? \"waiting\" : status\n } else if (status !== undefined) {\n const decodedResult = decodeResult(state.result)\n if (\n Option.isSome(decodedResult) && decodedResult.value._tag === \"Handoff\" && status === \"completed\" &&\n decision.value.decision === \"handed-off\"\n ) {\n // A round handed off; its raw result describes the successor, not an output.\n execution.span.status = \"completed\"\n execution.span.endedAt = envelope.emittedAtMs\n continue\n }\n if (\n Option.isNone(decodedResult) || decodedResult.value._tag !== \"Complete\" ||\n (status === \"completed\") !== (decodedResult.value.exit._tag === \"Success\")\n ) {\n execution.coherent = false\n execution.span.status = \"unknown\"\n generic()\n continue\n }\n execution.span.status = status\n execution.span.endedAt = envelope.emittedAtMs\n execution.span.detail = {\n ...execution.span.detail,\n ...(decodedResult.value.exit._tag === \"Success\"\n ? { output: json(decodedResult.value.exit.value) }\n : { message: json(decodedResult.value.exit.cause) })\n }\n if (decodedResult.value.exit._tag === \"Success\") result(decodedResult.value.exit.value)\n else failure(\"cause\", decodedResult.value.exit.cause)\n }\n continue\n }\n generic()\n }\n const byExecution = new Map<string, Array<Execution>>()\n for (const current of executions.values()) {\n const generations = byExecution.get(current.envelope.executionId) ?? []\n generations.push(current)\n byExecution.set(current.envelope.executionId, generations)\n }\n const roots: Array<TraceBuilder> = []\n for (const current of executions.values()) {\n const parents = current.parentId === undefined ? [] : byExecution.get(current.parentId) ?? []\n // Build only a forest. Malformed cycles remain separate evidence rows.\n const ancestors = new Set<string>([current.envelope.executionId])\n let parent = parents.length === 1 ? parents[0] : undefined\n let cursor = parent\n while (cursor !== undefined) {\n if (ancestors.has(cursor.envelope.executionId)) {\n parent = undefined\n break\n }\n ancestors.add(cursor.envelope.executionId)\n const next = cursor.parentId === undefined ? [] : byExecution.get(cursor.parentId) ?? []\n cursor = next.length === 1 ? next[0] : undefined\n }\n if (parent === undefined) roots.push(current.span)\n else parent.span.children.push(current.span)\n }\n const evidence: Array<EngineExecutionEvidence> = [...executions.values()].map((current) => ({\n executionId: current.envelope.executionId,\n generation: current.envelope.generation,\n spanId: current.span.id,\n parentExecutionId: current.parentExecutionId,\n parentKnown: current.parentKnown === true,\n flowName: current.flowName,\n input: current.span.detail.input,\n coherent: current.coherent,\n graph: current.graph,\n status: current.span.status,\n waits: [...current.waits?.values() ?? []],\n result: current.result,\n failure: current.failure\n }))\n return { trace: [...roots, ...notices], evidence }\n}\n\n/**\n * Folds native executions and attempts into trace spans with recorded ancestry.\n *\n * @category utilities\n * @since 1.0.0\n */\nexport const engineTraceFromJournal = (records: ReadonlyArray<JournalRecord>): Array<TraceBuilder> =>\n foldEngineJournal(records).trace\n\n/**\n * Product claims use these typed facts, never text rendered into trace details.\n *\n * @category utilities\n * @since 1.0.0\n */\nexport const engineExecutionEvidence = (\n records: ReadonlyArray<JournalRecord>\n): ReadonlyArray<EngineExecutionEvidence> => foldEngineJournal(records).evidence\n\n/**\n * Same recorded native ancestry and historical cursor for every product result projection.\n *\n * @category utilities\n * @since 1.0.0\n */\nexport const engineRunEvidence = (records: ReadonlyArray<JournalRecord>, rootId: string, cursorSeq?: number) => {\n const visible: ReadonlyArray<JournalRecord> = records\n .filter((row) =>\n Number.isSafeInteger(row.sequence) && Number(row.sequence) >= 0 &&\n (cursorSeq === undefined || Number(row.sequence) <= cursorSeq)\n )\n .sort((left, right) => Number(left.sequence) - Number(right.sequence))\n const executions = engineExecutionEvidence(visible)\n const generations = new Map<string, Array<EngineExecutionEvidence>>()\n for (const execution of executions) {\n const found = generations.get(execution.executionId) ?? []\n found.push(execution)\n generations.set(execution.executionId, found)\n }\n const current = (execution: EngineExecutionEvidence) =>\n execution.coherent &&\n execution.generation === Math.max(...generations.get(execution.executionId)!.map((row) => row.generation))\n const belongs = (execution: EngineExecutionEvidence, ownerId = rootId): boolean => {\n const visited = new Set<string>()\n let candidate: EngineExecutionEvidence = execution\n while (true) {\n if (!candidate.coherent || !candidate.parentKnown || visited.has(candidate.executionId)) return false\n visited.add(candidate.executionId)\n if (candidate.executionId === ownerId) return ownerId !== rootId || candidate.parentExecutionId === undefined\n if (candidate.parentExecutionId === undefined) return false\n const parents: ReadonlyArray<EngineExecutionEvidence> = generations.get(candidate.parentExecutionId) ?? []\n // A child names a native parent ID, not its generation. Never infer a\n // parent generation from arrival time after a rewind.\n if (parents.length !== 1) return false\n candidate = parents[0]!\n }\n }\n const owned = executions.filter((row) => current(row) && belongs(row))\n const completed = owned.filter((row) => row.status === \"completed\" && row.result !== undefined)\n return { executions: owned, completed, belongs }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"EngineTrace.js","sourceRoot":"","sources":["../../src/EngineTrace.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAA;AAC1D,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAG1D,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1B,WAAW,EAAE,YAAY,CAAC,KAAK;IAC/B,UAAU,EAAE,YAAY,CAAC,mBAAmB;IAC5C,QAAQ,EAAE,YAAY,CAAC,GAAG;IAC1B,OAAO,EA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CAAA;YAClC,IAAI,SAAS,CAAC,WAAW,KAAK,OAAO;gBAAE,OAAO,OAAO,KAAK,MAAM,IAAI,SAAS,CAAC,iBAAiB,KAAK,SAAS,CAAA;YAC7G,IAAI,SAAS,CAAC,iBAAiB,KAAK,SAAS;gBAAE,OAAO,KAAK,CAAA;YAC3D,MAAM,OAAO,GAA2C,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAA;YAC1G,sEAAsE;YACtE,sDAAsD;YACtD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAA;YACtC,SAAS,GAAG,OAAO,CAAC,CAAC,CAAE,CAAA;QACzB,CAAC;IACH,CAAC,CAAA;IACD,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACtE,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,WAAW,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAA;IAC/F,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;AAClD,CAAC,CAAA","sourcesContent":["/**\n * Recorded native evidence, decoded through the contracts that wrote it.\n *\n * @since 1.0.0\n */\n\nimport { RunState } from \"@smthrs/engine-store/RunState\"\nimport { ResultEncoded } from \"@smthrs/flow/Flow\"\nimport * as EngineEvent from \"@smthrs/journal/EngineEvent\"\nimport * as JournalEvent from \"@smthrs/journal/JournalEvent\"\nimport { Option, Schema } from \"effect\"\nimport { inspectLabel } from \"./internal/inspectLabels.ts\"\nimport type { JournalRecord, SpanDetail, TraceBuilder } from \"./RunTrace.ts\"\n\n// This is the private control bridge's envelope, not another engine contract.\nconst Envelope = Schema.Struct({\n version: Schema.Literal(1),\n executionId: JournalEvent.RunId,\n generation: JournalEvent.NonNegativeQuantity,\n sequence: JournalEvent.Seq,\n eventId: Schema.String,\n sourceId: JournalEvent.SourceId,\n sourceSequence: JournalEvent.SourceSeq,\n emittedAtMs: JournalEvent.TimestampMs,\n eventType: Schema.NonEmptyString,\n payload: Schema.Json,\n meta: Schema.Json\n})\ntype Envelope = typeof Envelope.Type\n\nconst decodeEnvelope = Schema.decodeUnknownOption(Envelope)\nconst decodeGraph = Schema.decodeUnknownOption(EngineEvent.NodeGraph)\nconst decodeScheduled = Schema.decodeUnknownOption(EngineEvent.NodeScheduledPayload)\nconst decodeSettled = Schema.decodeUnknownOption(EngineEvent.NodeSettledPayload)\nconst decodeAttempt = Schema.decodeUnknownOption(EngineEvent.AttemptPayload, { onExcessProperty: \"error\" })\nconst decodeState = Schema.decodeUnknownOption(EngineEvent.StatePayload, { onExcessProperty: \"error\" })\nconst decodeMarker = Schema.decodeUnknownOption(EngineEvent.CurrentAttempt)\nconst stateDecisions = [\n \"created\",\n \"resumed\",\n \"transitioned\",\n \"handed-off\",\n \"lineage-exhausted\",\n \"round-invalid\",\n \"quarantined\",\n \"interrupt-released\"\n] as const\nconst decodeDecision = Schema.decodeUnknownOption(Schema.Struct({\n decision: Schema.Literals(stateDecisions),\n status: Schema.optionalKey(Schema.Literals([\"pending\", \"running\", \"suspended\", \"completed\", \"failed\", \"cancelled\"])),\n state: RunState\n}))\n// RunDriver's durable cancellation record has no run-decision counterpart.\nconst decodeCancellation = Schema.decodeUnknownOption(Schema.Struct({\n outcome: Schema.Literal(\"cancelled\"),\n interruptedAtMs: JournalEvent.TimestampMs,\n owner: Schema.String,\n cascadedTo: Schema.optionalKey(Schema.Array(JournalEvent.RunId))\n}))\nconst decodeResult = Schema.decodeUnknownOption(ResultEncoded, { onExcessProperty: \"error\" })\n\nconst json = (value: unknown): string => typeof value === \"string\" ? value : JSON.stringify(value)\nconst identity = (...parts: ReadonlyArray<string | number>) =>\n parts.map((part) => encodeURIComponent(String(part))).join(\":\")\nconst span = (id: string, kind: TraceBuilder[\"kind\"], label: string, at: number, detail: SpanDetail): TraceBuilder => ({\n id,\n kind,\n label,\n status: \"recorded\",\n startedAt: at,\n children: [],\n detail\n})\nconst detail = (row: JournalRecord, envelope: Envelope): SpanDetail => ({\n sequence: row.sequence,\n event: envelope.eventType,\n fields: { ...envelope }\n})\ninterface Execution {\n readonly envelope: Envelope\n readonly span: TraceBuilder\n parentId?: string | undefined\n parentExecutionId?: string | undefined\n parentKnown?: boolean | undefined\n flowName?: string | undefined\n coherent: boolean\n waits?: Map<string, { id: string; kind: \"sleep\" | \"signal\"; since: number; settledAt?: number }>\n graph?: EngineEvent.NodeGraph | undefined\n result?: { readonly value: unknown; readonly sequence: number } | undefined\n failure?: EngineExecutionEvidence[\"failure\"] | undefined\n}\n\n/**\n * A render-only view of the same decoded execution facts; never persisted.\n *\n * @category models\n * @since 1.0.0\n */\nexport interface EngineExecutionEvidence {\n readonly executionId: string\n readonly generation: number\n readonly spanId: string\n readonly parentExecutionId?: string | undefined\n readonly parentKnown: boolean\n readonly flowName?: string | undefined\n readonly input?: unknown | undefined\n readonly coherent: boolean\n /** Declared nodes, including work not reached at this journal cursor. */\n readonly graph?: EngineEvent.NodeGraph | undefined\n readonly status: string\n /** Recorded clock and deferred registrations and their explicit settlements. */\n readonly waits: ReadonlyArray<\n { readonly id: string; readonly kind: \"sleep\" | \"signal\"; readonly since: number; readonly settledAt?: number }\n >\n readonly result?: { readonly value: unknown; readonly sequence: number } | undefined\n /** Original classified failure bytes, never parsed from rendered detail. */\n readonly failure?: {\n readonly kind: \"cause\" | \"error\" | \"defect\" | \"interrupted\" | \"encoding\"\n readonly value: unknown\n readonly sequence: number\n } | undefined\n}\nconst decodeProjection = Schema.decodeUnknownOption(Schema.Struct({\n version: Schema.Literal(1),\n executionId: JournalEvent.RunId,\n generation: JournalEvent.NonNegativeQuantity\n}))\n\n/**\n * Observation completion is separate from the control run's terminal verdict.\n *\n * @category utilities\n * @since 1.0.0\n */\nexport const engineProjectionPending = (records: ReadonlyArray<JournalRecord> = []): boolean => {\n const states = new Map<string, { generation: number; pending: boolean }>()\n for (const row of [...records].sort((left, right) => (left.sequence ?? 0) - (right.sequence ?? 0))) {\n if (row.kind === \"control.engine.projection-gap\") {\n // The gap is rendered as missing evidence. Stop polling rather than\n // disguising an observation failure as an indefinitely running task.\n for (const state of states.values()) state.pending = false\n continue\n }\n if (row.kind !== \"control.engine.projection-started\" && row.kind !== \"control.engine.projection-settled\") continue\n const decoded = decodeProjection(row.payload)\n if (Option.isNone(decoded)) continue\n const { executionId, generation } = decoded.value\n const current = states.get(executionId)\n if (row.kind === \"control.engine.projection-started\") {\n if (current === undefined || generation > current.generation) {\n states.set(executionId, { generation, pending: true })\n }\n } else if (current?.generation === generation) current.pending = false\n }\n return [...states.values()].some((state) => state.pending)\n}\n\n/**\n * Generations never share attempt identity. Native timestamps describe native\n * work; the outer control sequence still determines the historical UI cursor.\n * Only recorded parent IDs can nest executions. Ambiguous parent generations\n * remain beside the root instead of guessing which historical parent owned them.\n */\nconst foldEngineJournal = (records: ReadonlyArray<JournalRecord>) => {\n const executions = new Map<string, Execution>()\n const attempts = new Map<string, TraceBuilder>()\n const notices: Array<TraceBuilder> = []\n const nodes = new Map<string, TraceBuilder>()\n const instances = new Map<string, number>()\n const seen = new Map<string, string>()\n for (const row of records) {\n if (row.kind === \"control.engine.projection-gap\") {\n const notice = span(\n `engine-gap:${row.sequence ?? notices.length}`,\n \"event\",\n \"Engine evidence gap\",\n row.occurredAt ?? 0,\n {\n sequence: row.sequence,\n event: row.kind,\n fields: { evidence: row.payload }\n }\n )\n notice.status = \"unknown\"\n notice.endedAt = notice.startedAt\n notices.push(notice)\n continue\n }\n if (row.kind !== \"control.engine.event\") continue\n const decoded = decodeEnvelope(row.payload)\n if (Option.isNone(decoded)) {\n const notice = span(\n `engine-invalid:${row.sequence ?? notices.length}`,\n \"event\",\n \"Unreadable engine evidence\",\n row.occurredAt ?? 0,\n {\n sequence: row.sequence,\n event: row.kind,\n fields: { evidence: row.payload }\n }\n )\n notice.status = \"unknown\"\n notice.endedAt = notice.startedAt\n notices.push(notice)\n continue\n }\n const envelope = decoded.value\n const key = identity(envelope.executionId, envelope.generation)\n const eventKey = identity(key, envelope.sequence)\n const previous = seen.get(eventKey)\n if (previous !== undefined) {\n if (previous !== JSON.stringify(envelope)) {\n const conflict = executions.get(key)\n conflict!.coherent = false\n }\n continue\n }\n seen.set(eventKey, JSON.stringify(envelope))\n let execution = executions.get(key)\n if (execution === undefined) {\n execution = {\n envelope,\n coherent: true,\n span: span(`engine:${key}`, \"execution\", envelope.executionId, envelope.emittedAtMs, detail(row, envelope))\n }\n executions.set(key, execution)\n }\n const parent = (parentId: string | undefined) => {\n if (execution.parentKnown && execution.parentExecutionId !== parentId) execution.coherent = false\n execution.parentKnown = true\n execution.parentExecutionId = parentId\n execution.parentId = parentId\n }\n const result = (value: unknown) => {\n if (Number.isSafeInteger(row.sequence) && row.sequence! >= 0) {\n execution.result = { value, sequence: row.sequence! }\n }\n }\n const failure = (kind: NonNullable<EngineExecutionEvidence[\"failure\"]>[\"kind\"], value: unknown) => {\n if (Number.isSafeInteger(row.sequence) && row.sequence! >= 0) {\n execution.failure = { kind, value, sequence: row.sequence! }\n }\n }\n const generic = () => {\n const event = span(\n `engine-event:${eventKey}`,\n \"event\",\n envelope.eventType,\n envelope.emittedAtMs,\n detail(row, envelope)\n )\n event.endedAt = event.startedAt\n execution.span.children.push(event)\n }\n const attempt = (step: string, number: number) => {\n const attemptKey = identity(key, step, number)\n let current = attempts.get(attemptKey)\n if (current === undefined) {\n current = span(\n `engine-attempt:${attemptKey}`,\n \"attempt\",\n `attempt ${number} · ${step.slice(0, 12)}`,\n envelope.emittedAtMs,\n detail(row, envelope)\n )\n attempts.set(attemptKey, current)\n execution.span.children.push(current)\n }\n return current\n }\n if (\n envelope.eventType === EngineEvent.nodeEventTypes.planRecorded ||\n envelope.eventType === EngineEvent.nodeEventTypes.subgraphAppended\n ) {\n const payload = envelope.payload as { graph?: unknown }\n const graph = decodeGraph(payload?.graph)\n if (Option.isSome(graph)) {\n const nodes = new Map(execution.graph?.nodes.map((node) => [node.id, node]))\n for (const node of graph.value.nodes) nodes.set(node.id, node)\n execution.graph = { ...graph.value, nodes: [...nodes.values()] }\n }\n generic()\n continue\n }\n if (\n envelope.eventType === EngineEvent.nodeEventTypes.nodeScheduled ||\n envelope.eventType === EngineEvent.nodeEventTypes.nodeSettled\n ) {\n const scheduled = envelope.eventType === EngineEvent.nodeEventTypes.nodeScheduled\n ? decodeScheduled(envelope.payload) :\n Option.none()\n const settled = envelope.eventType === EngineEvent.nodeEventTypes.nodeSettled\n ? decodeSettled(envelope.payload) :\n Option.none()\n const recorded = Option.isSome(scheduled) ? scheduled.value : Option.isSome(settled) ? settled.value : undefined\n if (recorded === undefined) {\n generic()\n continue\n }\n const nodeKey = identity(key, recorded.nodeId)\n const action = recorded.action ?? execution.graph?.nodes.find((node) => node.id === recorded.nodeId)?.action\n let node = nodes.get(nodeKey)\n if (node === undefined || Option.isSome(scheduled)) {\n const instance = (instances.get(nodeKey) ?? 0) + 1\n instances.set(nodeKey, instance)\n node = span(\n `engine-node:${nodeKey}#${instance}`,\n \"call\",\n inspectLabel(action ?? recorded.nodeId),\n envelope.emittedAtMs,\n detail(row, envelope)\n )\n nodes.set(nodeKey, node)\n execution.span.children.push(node)\n }\n if (action !== undefined) node.label = inspectLabel(action)\n node.detail = { ...detail(row, envelope), sequence: node.detail.sequence }\n if (Option.isSome(scheduled)) {\n node.status = \"running\"\n } else {\n const value = Option.getOrThrow(settled)\n node.status = value.outcome === \"failed\" ?\n \"failed\"\n : value.outcome === \"deferred\" ?\n \"waiting\"\n : value.outcome === \"skipped\"\n ? \"skipped\"\n : \"completed\"\n if (value.outcome !== \"deferred\") node.endedAt = envelope.emittedAtMs\n // The redacted preview is evidence, including when truncated. Never\n // evaluate it, or mistake a JSON prefix for a complete return value.\n if (value.result !== undefined) node.detail = { ...node.detail, output: value.result.preview }\n }\n continue\n }\n if (\n envelope.eventType === \"flows.engine.attempt-started\" || envelope.eventType === \"flows.engine.attempt-finished\"\n ) {\n const marker = decodeMarker({ eventType: envelope.eventType, payload: envelope.payload })\n if (Option.isNone(marker) || marker.value.payload.runId !== envelope.executionId) {\n generic()\n continue\n }\n const current = attempt(marker.value.payload.stepKeyDigest, marker.value.payload.attempt)\n if (marker.value.eventType === \"flows.engine.attempt-started\") current.status = \"running\"\n else {\n current.status = marker.value.payload.state === \"succeeded\" ? \"completed\" : \"failed\"\n current.endedAt = envelope.emittedAtMs\n }\n current.detail = { ...current.detail, fields: { ...envelope } }\n continue\n }\n if (envelope.eventType === EngineEvent.attemptEventType) {\n const recorded = decodeAttempt(envelope.payload)\n if (Option.isNone(recorded) || recorded.value.executionId !== envelope.executionId) {\n execution.coherent = false\n generic()\n continue\n }\n const { lifecycle, lineage, stepKeyDigest, attempt: number } = recorded.value\n // Lineage may describe a trampoline predecessor, not a spawned parent.\n // Product ancestry comes only from RunState.parentExecutionId below.\n execution.parentId = lineage.parentRunId ?? undefined\n const current = attempt(stepKeyDigest, number)\n current.startedAt = lifecycle.startedAtMs\n current.status = lifecycle.state === \"succeeded\"\n ? \"completed\"\n : lifecycle.state === \"suspended\"\n ? \"waiting\"\n : lifecycle.state\n current.detail = { ...detail(row, envelope), sequence: current.detail.sequence }\n if (lifecycle.state === \"succeeded\" || lifecycle.state === \"failed\") {\n current.endedAt = lifecycle.finishedAtMs\n current.detail = {\n ...current.detail,\n ...(lifecycle.result._tag === \"Success\"\n ? { output: json(lifecycle.result.value) }\n : { message: json(lifecycle.result.detail) })\n }\n }\n continue\n }\n if (envelope.eventType === EngineEvent.stateEventType) {\n const recorded = decodeState(envelope.payload)\n if (Option.isNone(recorded) || recorded.value.executionId !== envelope.executionId) {\n execution.coherent = false\n generic()\n continue\n }\n execution.parentId = recorded.value.lineage.parentRunId ?? undefined\n const registerWait = (waitId: string, kind: \"sleep\" | \"signal\") => {\n const waits = execution.waits ??= new Map()\n const id = identity(key, waitId)\n const existing = waits.get(id)\n if (existing === undefined) waits.set(id, { id: `engine-wait:${id}`, kind, since: envelope.emittedAtMs })\n // A later clock record refines a generic deferred identity without\n // restarting the wait or dropping its recorded settlement.\n else if (kind === \"sleep\") existing.kind = kind\n }\n if (recorded.value.event._tag === \"Execution\" && recorded.value.event.lifecycle.state !== \"completed\") {\n for (const wait of recorded.value.event.lifecycle.waits) {\n registerWait(wait.waitId, wait._tag === \"Clock\" ? \"sleep\" : \"signal\")\n }\n }\n if (recorded.value.event._tag === \"ClockScheduled\") {\n registerWait(recorded.value.event.waitId, \"sleep\")\n } else if (recorded.value.event._tag === \"DeferredCompleted\") {\n const wait = execution.waits?.get(identity(key, recorded.value.event.waitId))\n if (wait !== undefined && wait.settledAt === undefined) wait.settledAt = envelope.emittedAtMs\n }\n if (recorded.value.event._tag !== \"Execution\") {\n generic()\n continue\n }\n const { lifecycle } = recorded.value.event\n execution.result = undefined\n execution.failure = undefined\n execution.span.detail = {\n ...detail(row, envelope),\n sequence: execution.span.detail.sequence,\n input: execution.span.detail.input\n }\n if (lifecycle.state === \"completed\") {\n execution.span.status = lifecycle.result._tag === \"Success\" ? \"completed\" : \"failed\"\n execution.span.endedAt = envelope.emittedAtMs\n execution.span.detail = {\n ...execution.span.detail,\n ...(lifecycle.result._tag === \"Success\"\n ? { output: json(lifecycle.result.value) }\n : { message: json(lifecycle.result.detail) })\n }\n if (lifecycle.result._tag === \"Success\") result(lifecycle.result.value)\n else failure(lifecycle.result.reason, lifecycle.result.detail)\n } else execution.span.status = lifecycle.state === \"suspended\" ? \"waiting\" : \"running\"\n continue\n }\n if (envelope.eventType === \"flows.engine.interrupted\") {\n const cancelled = decodeCancellation(envelope.payload)\n if (Option.isNone(cancelled)) {\n generic()\n continue\n }\n execution.result = undefined\n execution.failure = undefined\n execution.span.status = \"cancelled\"\n execution.span.endedAt = cancelled.value.interruptedAtMs\n execution.span.detail = {\n ...detail(row, envelope),\n sequence: execution.span.detail.sequence,\n input: execution.span.detail.input\n }\n continue\n }\n if (envelope.eventType === \"flows.engine.run-decision\") {\n const decision = decodeDecision(envelope.payload)\n if (Option.isNone(decision)) {\n const payload = envelope.payload\n // Claim, owner-fence, wake and child-policy decisions deliberately do\n // not carry RunState. Keep them visible without losing valid state\n // evidence; malformed state-bearing decisions still refuse claims.\n if (\n typeof payload === \"object\" && payload !== null &&\n (\"state\" in payload || (\"decision\" in payload && stateDecisions.some((name) => name === payload.decision)))\n ) {\n execution.coherent = false\n }\n generic()\n continue\n }\n const { state, status } = decision.value\n if (execution.flowName !== undefined && execution.flowName !== state.flowName) execution.coherent = false\n execution.flowName = state.flowName\n execution.span.label = inspectLabel(state.flowName)\n parent(state.parentExecutionId)\n execution.result = undefined\n execution.failure = undefined\n execution.span.detail = {\n ...detail(row, envelope),\n sequence: execution.span.detail.sequence,\n input: state.payload\n }\n if (decision.value.decision === \"created\") execution.span.status = \"pending\"\n // RunDriver commits this decision with suspended even when its payload\n // omits status/result (a released host scope can retain no suspension).\n else if (decision.value.decision === \"interrupt-released\") execution.span.status = \"waiting\"\n else if (status === \"running\" || status === \"pending\" || status === \"suspended\") {\n execution.span.status = status === \"suspended\" ? \"waiting\" : status\n } else if (status !== undefined) {\n const decodedResult = decodeResult(state.result)\n if (\n Option.isSome(decodedResult) && decodedResult.value._tag === \"Handoff\" && status === \"completed\" &&\n decision.value.decision === \"handed-off\"\n ) {\n // A round handed off; its raw result describes the successor, not an output.\n execution.span.status = \"completed\"\n execution.span.endedAt = envelope.emittedAtMs\n continue\n }\n if (\n Option.isNone(decodedResult) || decodedResult.value._tag !== \"Complete\" ||\n (status === \"completed\") !== (decodedResult.value.exit._tag === \"Success\")\n ) {\n execution.coherent = false\n execution.span.status = \"unknown\"\n generic()\n continue\n }\n execution.span.status = status\n execution.span.endedAt = envelope.emittedAtMs\n execution.span.detail = {\n ...execution.span.detail,\n ...(decodedResult.value.exit._tag === \"Success\"\n ? { output: json(decodedResult.value.exit.value) }\n : { message: json(decodedResult.value.exit.cause) })\n }\n if (decodedResult.value.exit._tag === \"Success\") result(decodedResult.value.exit.value)\n else failure(\"cause\", decodedResult.value.exit.cause)\n }\n continue\n }\n generic()\n }\n const byExecution = new Map<string, Array<Execution>>()\n for (const current of executions.values()) {\n const generations = byExecution.get(current.envelope.executionId) ?? []\n generations.push(current)\n byExecution.set(current.envelope.executionId, generations)\n }\n const roots: Array<TraceBuilder> = []\n for (const current of executions.values()) {\n const parents = current.parentId === undefined ? [] : byExecution.get(current.parentId) ?? []\n // Build only a forest. Malformed cycles remain separate evidence rows.\n const ancestors = new Set<string>([current.envelope.executionId])\n let parent = parents.length === 1 ? parents[0] : undefined\n let cursor = parent\n while (cursor !== undefined) {\n if (ancestors.has(cursor.envelope.executionId)) {\n parent = undefined\n break\n }\n ancestors.add(cursor.envelope.executionId)\n const next = cursor.parentId === undefined ? [] : byExecution.get(cursor.parentId) ?? []\n cursor = next.length === 1 ? next[0] : undefined\n }\n if (parent === undefined) roots.push(current.span)\n else parent.span.children.push(current.span)\n }\n const evidence: Array<EngineExecutionEvidence> = [...executions.values()].map((current) => ({\n executionId: current.envelope.executionId,\n generation: current.envelope.generation,\n spanId: current.span.id,\n parentExecutionId: current.parentExecutionId,\n parentKnown: current.parentKnown === true,\n flowName: current.flowName,\n input: current.span.detail.input,\n coherent: current.coherent,\n graph: current.graph,\n status: current.span.status,\n waits: [...current.waits?.values() ?? []],\n result: current.result,\n failure: current.failure\n }))\n return { trace: [...roots, ...notices], evidence }\n}\n\n/**\n * Folds native executions and attempts into trace spans with recorded ancestry.\n *\n * @category utilities\n * @since 1.0.0\n */\nexport const engineTraceFromJournal = (records: ReadonlyArray<JournalRecord>): Array<TraceBuilder> =>\n foldEngineJournal(records).trace\n\n/**\n * Product claims use these typed facts, never text rendered into trace details.\n *\n * @category utilities\n * @since 1.0.0\n */\nexport const engineExecutionEvidence = (\n records: ReadonlyArray<JournalRecord>\n): ReadonlyArray<EngineExecutionEvidence> => foldEngineJournal(records).evidence\n\n/**\n * Same recorded native ancestry and historical cursor for every product result projection.\n *\n * @category utilities\n * @since 1.0.0\n */\nexport const engineRunEvidence = (records: ReadonlyArray<JournalRecord>, rootId: string, cursorSeq?: number) => {\n const visible: ReadonlyArray<JournalRecord> = records\n .filter((row) =>\n Number.isSafeInteger(row.sequence) && Number(row.sequence) >= 0 &&\n (cursorSeq === undefined || Number(row.sequence) <= cursorSeq)\n )\n .sort((left, right) => Number(left.sequence) - Number(right.sequence))\n const executions = engineExecutionEvidence(visible)\n const generations = new Map<string, Array<EngineExecutionEvidence>>()\n for (const execution of executions) {\n const found = generations.get(execution.executionId) ?? []\n found.push(execution)\n generations.set(execution.executionId, found)\n }\n const current = (execution: EngineExecutionEvidence) =>\n execution.coherent &&\n execution.generation === Math.max(...generations.get(execution.executionId)!.map((row) => row.generation))\n const belongs = (execution: EngineExecutionEvidence, ownerId = rootId): boolean => {\n const visited = new Set<string>()\n let candidate: EngineExecutionEvidence = execution\n while (true) {\n if (!candidate.coherent || !candidate.parentKnown || visited.has(candidate.executionId)) return false\n visited.add(candidate.executionId)\n if (candidate.executionId === ownerId) return ownerId !== rootId || candidate.parentExecutionId === undefined\n if (candidate.parentExecutionId === undefined) return false\n const parents: ReadonlyArray<EngineExecutionEvidence> = generations.get(candidate.parentExecutionId) ?? []\n // A child names a native parent ID, not its generation. Never infer a\n // parent generation from arrival time after a rewind.\n if (parents.length !== 1) return false\n candidate = parents[0]!\n }\n }\n const owned = executions.filter((row) => current(row) && belongs(row))\n const completed = owned.filter((row) => row.status === \"completed\" && row.result !== undefined)\n return { executions: owned, completed, belongs }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayProjection.d.ts","sourceRoot":"","sources":["../../src/GatewayProjection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAgB,aAAa,EAAE,MAAM,EAAW,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rB,QAAQ,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,KAChD,aAAa,CAAC,aAAa,CAsB7B,CAAA;AAyCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,EACjD,QAAQ,SAAS,CAAC,MAAM,GAAG,SAAS,KACnC,aAAa,CAAC,YAAY,CA4B5B,CAAA;AAMD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,SAAS,aAAa,CAAC,YAAY,CAAC,KACnC,aAAa,CAAC,eAAe,CAmB/B,CAAA;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,UAAU,GACrB,QAAQ,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,KAChD,aAAa,CAAC,aAAa,CAuB7B,CAAA;AA4BD;;;;GAIG;AACH,eAAO,MAAM,YAAY,GACvB,KAAK,aAAa,CAAC,UAAU,EAC7B,QAAQ,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,EACjD,KAAK,MAAM,KACV,MAAM,CAAC,YAwBT,CAAA"}
|
|
@@ -488,7 +488,14 @@ const humanWaitRow = (run, wait, projected, questionProvenance = "legacy-observa
|
|
|
488
488
|
*/
|
|
489
489
|
export const approvals = (events, run) => {
|
|
490
490
|
const native = run === undefined ? undefined : ExecutionFact.foldControl(events, run.runId, run.executionView);
|
|
491
|
+
const grantFacts = events.filter((event) => event.kind === "control.approval.requested" && Schema.is(ControlFacts.ApprovalRequestFact)(event.payload));
|
|
492
|
+
const grants = ControlFacts.fold(grantFacts).approvals;
|
|
491
493
|
const observed = run?.pendingWaits?.map((wait) => {
|
|
494
|
+
// An agent ask parks on its registered grant token, not a HumanTask answer.
|
|
495
|
+
// Preserve the committed target instead of inventing an answer-only target.
|
|
496
|
+
const grant = grants.find((row) => row.runId === run.runId && row.requestId === wait.token);
|
|
497
|
+
if (grant !== undefined)
|
|
498
|
+
return grant;
|
|
492
499
|
const projected = native?.provenance.humanWaits === "events" ?
|
|
493
500
|
native.view?.humanWaits?.find((candidate) => candidate.executionId === wait.runId && candidate.waiting?.tokenDigest === wait.tokenDigest) :
|
|
494
501
|
undefined;
|