@quantiya/codevibe-core 2.0.0 → 2.0.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/dist/__tests__/cp-5-baseline-invariants.test.d.ts +1 -0
- package/dist/__tests__/prompt-parser.test.d.ts +1 -0
- package/dist/adapter/__tests__/capabilities.test.d.ts +1 -0
- package/dist/adapter/__tests__/contract-conformance.test.d.ts +1 -0
- package/dist/adapter/__tests__/packets.test.d.ts +1 -0
- package/dist/adapter/__tests__/progress.test.d.ts +1 -0
- package/dist/adapter/__tests__/registry.test.d.ts +1 -0
- package/dist/adapter/__tests__/smoke/claude.smoke.test.d.ts +1 -0
- package/dist/adapter/__tests__/smoke/codex.smoke.test.d.ts +1 -0
- package/dist/adapter/__tests__/smoke/gemini.smoke.test.d.ts +1 -0
- package/dist/adapter/capabilities.d.ts +68 -0
- package/dist/adapter/index.d.ts +7 -0
- package/dist/adapter/packets.d.ts +129 -0
- package/dist/adapter/progress.d.ts +93 -0
- package/dist/adapter/registry.d.ts +91 -0
- package/dist/adapter/types.d.ts +22 -0
- package/dist/appsync/__tests__/appsync-client-apply-user-decision.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-classb.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-event-source-filter.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-planner.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-task-group.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client.test.d.ts +1 -0
- package/dist/appsync/__tests__/cleanup-subscription.test.d.ts +1 -0
- package/dist/appsync/__tests__/coerce-awsjson-and-review-summary.test.d.ts +1 -0
- package/dist/appsync/__tests__/cp1f-quorum-sdk.test.d.ts +1 -0
- package/dist/appsync/__tests__/event-throttle.test.d.ts +1 -0
- package/dist/appsync/appsync-client.d.ts +1025 -2
- package/dist/appsync/event-throttle.d.ts +28 -0
- package/dist/appsync/index.d.ts +4 -1
- package/dist/appsync/queries.d.ts +34 -0
- package/dist/audit-keys/index.d.ts +32 -0
- package/dist/auth/__tests__/auth-telemetry.test.d.ts +1 -0
- package/dist/auth/auth-service.d.ts +32 -2
- package/dist/auth/auth-telemetry.d.ts +117 -6
- package/dist/auth/index.d.ts +1 -0
- package/dist/companion-mode/__tests__/persist-preference.test.d.ts +1 -0
- package/dist/companion-mode/__tests__/resolve-agent.test.d.ts +1 -0
- package/dist/companion-mode/agent-picker.d.ts +9 -0
- package/dist/companion-mode/index.d.ts +55 -0
- package/dist/companion-mode/persist-preference.d.ts +24 -0
- package/dist/companion-mode/resolve-agent.d.ts +41 -0
- package/dist/config/config.d.ts +8 -1
- package/dist/continuation/__tests__/dirty-state-collector.test.d.ts +1 -0
- package/dist/continuation/__tests__/integration.test.d.ts +1 -0
- package/dist/continuation/__tests__/packet-reader.test.d.ts +1 -0
- package/dist/continuation/__tests__/packet-writer.test.d.ts +1 -0
- package/dist/continuation/__tests__/parity.test.d.ts +1 -0
- package/dist/continuation/__tests__/status-cli.test.d.ts +1 -0
- package/dist/continuation/dirty-state-collector.d.ts +46 -0
- package/dist/continuation/index.d.ts +8 -0
- package/dist/continuation/packet-reader.d.ts +33 -0
- package/dist/continuation/packet-writer.d.ts +86 -0
- package/dist/continuation/types.d.ts +239 -0
- package/dist/credential-broker/__tests__/broker.test.d.ts +1 -0
- package/dist/credential-broker/__tests__/canonical.test.d.ts +1 -0
- package/dist/credential-broker/__tests__/scrubber.test.d.ts +1 -0
- package/dist/credential-broker/__tests__/upstream-client.test.d.ts +1 -0
- package/dist/credential-broker/__tests__/vendor-key-store.test.d.ts +1 -0
- package/dist/credential-broker/audit-sink.d.ts +69 -0
- package/dist/credential-broker/broker-config.d.ts +39 -0
- package/dist/credential-broker/broker-token.d.ts +123 -0
- package/dist/credential-broker/broker.d.ts +165 -0
- package/dist/credential-broker/canonical.d.ts +119 -0
- package/dist/credential-broker/index.d.ts +15 -0
- package/dist/credential-broker/scrubber.d.ts +45 -0
- package/dist/credential-broker/types.d.ts +141 -0
- package/dist/credential-broker/upstream-client.d.ts +20 -0
- package/dist/credential-broker/vendor-key-store.d.ts +54 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.js +559 -55
- package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
- package/dist/keychain/keychain-backend.d.ts +82 -0
- package/dist/keychain/keychain-manager.d.ts +16 -2
- package/dist/local-executor/__tests__/agentic-disposable-repo.test.d.ts +1 -0
- package/dist/local-executor/__tests__/agentic-resolve.test.d.ts +1 -0
- package/dist/local-executor/__tests__/agentic-resolver-flag.test.d.ts +1 -0
- package/dist/local-executor/__tests__/authority-symlink-fixture.d.ts +15 -0
- package/dist/local-executor/__tests__/authority.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class-a-emit.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class-a-sign.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class-b-consumer.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class-b-consumer.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class1-reconcilers.test.d.ts +1 -0
- package/dist/local-executor/__tests__/class2-resolver.test.d.ts +1 -0
- package/dist/local-executor/__tests__/confined-model-caller.test.d.ts +1 -0
- package/dist/local-executor/__tests__/conflict-classifier.test.d.ts +1 -0
- package/dist/local-executor/__tests__/conflict-resolution-durable-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/conflict-resolution-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/cp1f-quorum-consumer.test.d.ts +1 -0
- package/dist/local-executor/__tests__/cp7-audit-writer.test.d.ts +1 -0
- package/dist/local-executor/__tests__/durable-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/git-lock-retry.test.d.ts +1 -0
- package/dist/local-executor/__tests__/hook-bridge.test.d.ts +1 -0
- package/dist/local-executor/__tests__/implementor-argv.test.d.ts +1 -0
- package/dist/local-executor/__tests__/local-executor-teams.test.d.ts +1 -0
- package/dist/local-executor/__tests__/local-executor.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-conflict-extract.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-conflict-git.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-conflict-resolve-agentic.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-conflict-resolve.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-journal-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-train-agentic-recovery.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-train-w3.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-train-waveb.integration.test.d.ts +1 -0
- package/dist/local-executor/__tests__/merge-train.test.d.ts +1 -0
- package/dist/local-executor/__tests__/promote-wal-store.test.d.ts +1 -0
- package/dist/local-executor/__tests__/revert-reconcile.test.d.ts +1 -0
- package/dist/local-executor/__tests__/revert-runner.test.d.ts +1 -0
- package/dist/local-executor/__tests__/shared-contract-detector.test.d.ts +1 -0
- package/dist/local-executor/__tests__/spawn.test.d.ts +1 -0
- package/dist/local-executor/__tests__/substrate-engage.test.d.ts +1 -0
- package/dist/local-executor/__tests__/team-execution-flag.test.d.ts +1 -0
- package/dist/local-executor/__tests__/track-registry.test.d.ts +1 -0
- package/dist/local-executor/__tests__/verification-runner.test.d.ts +1 -0
- package/dist/local-executor/__tests__/wb2-review-bundle.test.d.ts +1 -0
- package/dist/local-executor/__tests__/wb2-substrate-spawn.live.test.d.ts +1 -0
- package/dist/local-executor/__tests__/workspace-shadow.test.d.ts +1 -0
- package/dist/local-executor/__tests__/worktree-merge.test.d.ts +1 -0
- package/dist/local-executor/agentic-disposable-repo.d.ts +52 -0
- package/dist/local-executor/agentic-resolve.d.ts +54 -0
- package/dist/local-executor/agentic-resolver-flag.d.ts +9 -0
- package/dist/local-executor/authority.d.ts +61 -0
- package/dist/local-executor/class-a-emit.d.ts +140 -0
- package/dist/local-executor/class-a-sign.d.ts +57 -0
- package/dist/local-executor/class-b-consumer.d.ts +276 -0
- package/dist/local-executor/class-b-verify.d.ts +30 -0
- package/dist/local-executor/class1-reconcilers.d.ts +58 -0
- package/dist/local-executor/class2-resolver.d.ts +74 -0
- package/dist/local-executor/confined-model-caller.d.ts +39 -0
- package/dist/local-executor/conflict-classifier.d.ts +21 -0
- package/dist/local-executor/conflict-resolution-durable-store.d.ts +61 -0
- package/dist/local-executor/conflict-resolution-store.d.ts +210 -0
- package/dist/local-executor/conflict-types.d.ts +86 -0
- package/dist/local-executor/cp7-audit-writer.d.ts +152 -0
- package/dist/local-executor/durable-store.d.ts +334 -0
- package/dist/local-executor/git-lock-retry.d.ts +40 -0
- package/dist/local-executor/hook-bridge.d.ts +36 -0
- package/dist/local-executor/implementor-argv.d.ts +183 -0
- package/dist/local-executor/index.d.ts +49 -0
- package/dist/local-executor/local-executor-impl.d.ts +724 -0
- package/dist/local-executor/merge-conflict-extract.d.ts +34 -0
- package/dist/local-executor/merge-conflict-resolve.d.ts +101 -0
- package/dist/local-executor/merge-journal-store.d.ts +311 -0
- package/dist/local-executor/merge-train.d.ts +713 -0
- package/dist/local-executor/promote-wal-store.d.ts +301 -0
- package/dist/local-executor/resolution-set-index.d.ts +51 -0
- package/dist/local-executor/revert-reconcile.d.ts +89 -0
- package/dist/local-executor/revert-runner.d.ts +17 -0
- package/dist/local-executor/shared-contract-detector.d.ts +57 -0
- package/dist/local-executor/spawn.d.ts +34 -0
- package/dist/local-executor/task-group-types.d.ts +346 -0
- package/dist/local-executor/team-execution-flag.d.ts +21 -0
- package/dist/local-executor/track-registry.d.ts +50 -0
- package/dist/local-executor/types.d.ts +417 -0
- package/dist/local-executor/verification-gates/build.d.ts +6 -0
- package/dist/local-executor/verification-gates/deploy-preflight.d.ts +6 -0
- package/dist/local-executor/verification-gates/diff-sanity.d.ts +6 -0
- package/dist/local-executor/verification-gates/hostile-grep.d.ts +6 -0
- package/dist/local-executor/verification-gates/lint.d.ts +6 -0
- package/dist/local-executor/verification-gates/shell-runner.d.ts +40 -0
- package/dist/local-executor/verification-gates/source-traceability.d.ts +6 -0
- package/dist/local-executor/verification-gates/tests.d.ts +6 -0
- package/dist/local-executor/verification-gates/typecheck.d.ts +6 -0
- package/dist/local-executor/verification-runner.d.ts +28 -0
- package/dist/local-executor/wb2-review-bundle.d.ts +59 -0
- package/dist/local-executor/workspace-shadow.d.ts +290 -0
- package/dist/local-executor/worktree-merge.d.ts +601 -0
- package/dist/local-model/__tests__/installer.test.d.ts +1 -0
- package/dist/local-model/__tests__/manager.test.d.ts +1 -0
- package/dist/local-model/__tests__/ollama.test.d.ts +1 -0
- package/dist/local-model/__tests__/runtime.test.d.ts +1 -0
- package/dist/local-model/__tests__/state.test.d.ts +1 -0
- package/dist/local-model/manager.d.ts +119 -0
- package/dist/local-model/ollama.d.ts +27 -0
- package/dist/local-model/runtime.d.ts +27 -0
- package/dist/local-model/state.d.ts +32 -0
- package/dist/orchestration/__tests__/setup-bootstrap.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-failure-recourse.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-save.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-seat-picker.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-telemetry.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-test-agents.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-types.test.d.ts +1 -0
- package/dist/orchestration/__tests__/setup-wizard.test.d.ts +1 -0
- package/dist/orchestration/__tests__/v1-options.test.d.ts +1 -0
- package/dist/orchestration/detect-agents.d.ts +16 -2
- package/dist/orchestration/index.d.ts +1 -0
- package/dist/orchestration/orchestration-cli.d.ts +4 -1
- package/dist/orchestration/setup-bootstrap.d.ts +146 -0
- package/dist/orchestration/setup-failure-recourse.d.ts +23 -0
- package/dist/orchestration/setup-save.d.ts +47 -0
- package/dist/orchestration/setup-seat-picker.d.ts +72 -0
- package/dist/orchestration/setup-telemetry.d.ts +54 -0
- package/dist/orchestration/setup-test-agents.d.ts +108 -0
- package/dist/orchestration/setup-types.d.ts +141 -0
- package/dist/orchestration/setup-wizard.d.ts +57 -0
- package/dist/orchestration/v1-options.d.ts +97 -0
- package/dist/orchestration-shell/__tests__/attachments.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/audit-browser.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/audited-path-fixes.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/bracketed-paste.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-authority-bridge.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-group-halt-wiring.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-orchestration-session-bootstrap.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-planner-stack.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-probe-group-status.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-quorum-loop-tier.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-singleton-enforcement.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-stub-session-adapter.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-verdict-classifier-wiring.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/components.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/context-store.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp10-585-accept-echo-target.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp10-585-loop.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp10-585-prompts.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp12-w2b-team-loop.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp12-w4-team-recovery.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp1f-quorum-loop.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp606-team-track-user-resolved.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp7-reviewer-substrate.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/declared-test-runner.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/emit-shell-event.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/familiarize-routing.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/gate-decision-submit.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/gate-details-panel.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/gate-prompts.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/gate-verdict-details-dispatch.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/group-decision-submit.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/hostile-grep.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/image-attach-e2e.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/input-bar-autocomplete.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/live-region-cap.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/live-static-order.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/mode-selection.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/model-cli.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/non-gate-prompt-routing.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/orchestration-app-group-decision-transport.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/orchestration-app-layout.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/process-markers.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/reducer.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/reissue-team-retained-spec.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/review-summary-render.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/reviewer-wizard.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/reviewers-format.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/root-discovery.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/runOrchestrationShell-classify-dispatch.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/runOrchestrationShell-planner-wiring.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/runOrchestrationShell-signal.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/runOrchestrationShell.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/serialize-submissions.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/slash-router.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/slash-suggest.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/status-format.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/sticky-preference.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/task-progress.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/team-decompose-routing.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/team-decompose-types.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/team-decompose.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/team-e2e-smoke.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/tier2-reviewer-selection.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/web-browsing.test.d.ts +1 -0
- package/dist/orchestration-shell/attachments.d.ts +152 -0
- package/dist/orchestration-shell/audit-browser.d.ts +115 -0
- package/dist/orchestration-shell/audit-runner.d.ts +59 -0
- package/dist/orchestration-shell/bracketed-paste.d.ts +26 -0
- package/dist/orchestration-shell/cli.d.ts +431 -0
- package/dist/orchestration-shell/cli.js +44191 -0
- package/dist/orchestration-shell/cohort-flag.d.ts +16 -0
- package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
- package/dist/orchestration-shell/components/CodeVibeLogo.d.ts +2 -0
- package/dist/orchestration-shell/components/ConversationPane.d.ts +13 -0
- package/dist/orchestration-shell/components/GateDetailsPanel.d.ts +57 -0
- package/dist/orchestration-shell/components/GatePanelEntry.d.ts +9 -0
- package/dist/orchestration-shell/components/GatePromptEntry.d.ts +16 -0
- package/dist/orchestration-shell/components/InputBar.d.ts +55 -0
- package/dist/orchestration-shell/components/LiveProgressLine.d.ts +8 -0
- package/dist/orchestration-shell/components/MultiTrackStatusNode.d.ts +8 -0
- package/dist/orchestration-shell/components/OrchestrationApp.d.ts +129 -0
- package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
- package/dist/orchestration-shell/components/StatusBar.d.ts +20 -0
- package/dist/orchestration-shell/components/nodes/AdvisoryEntry.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/GateStatusNode.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/PlannerDecisionEntry.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/ReviewerQuorumStatusNode.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/SlashOutputEntry.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/SubagentEventEntry.d.ts +8 -0
- package/dist/orchestration-shell/components/nodes/UserMessageEntry.d.ts +8 -0
- package/dist/orchestration-shell/context-store.d.ts +389 -0
- package/dist/orchestration-shell/declared-test-runner.d.ts +84 -0
- package/dist/orchestration-shell/emit-shell-event.d.ts +64 -0
- package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
- package/dist/orchestration-shell/gate-prompts.d.ts +481 -0
- package/dist/orchestration-shell/index.d.ts +712 -0
- package/dist/orchestration-shell/ink-runtime.d.ts +84 -0
- package/dist/orchestration-shell/live-region-cap.d.ts +70 -0
- package/dist/orchestration-shell/live-static-order.d.ts +22 -0
- package/dist/orchestration-shell/mode-selection.d.ts +46 -0
- package/dist/orchestration-shell/non-tty-fallback.d.ts +67 -0
- package/dist/orchestration-shell/process-markers.d.ts +12 -0
- package/dist/orchestration-shell/quorum-loop.d.ts +1900 -0
- package/dist/orchestration-shell/reducer.d.ts +8 -0
- package/dist/orchestration-shell/root-discovery.d.ts +25 -0
- package/dist/orchestration-shell/route-browse.d.ts +20 -0
- package/dist/orchestration-shell/slash-router.d.ts +64 -0
- package/dist/orchestration-shell/slash-routes/continuation.d.ts +71 -0
- package/dist/orchestration-shell/slash-routes/reviewers.d.ts +41 -0
- package/dist/orchestration-shell/slash-suggest.d.ts +29 -0
- package/dist/orchestration-shell/status-format.d.ts +59 -0
- package/dist/orchestration-shell/sticky-preference.d.ts +24 -0
- package/dist/orchestration-shell/store.d.ts +17 -0
- package/dist/orchestration-shell/task-progress.d.ts +122 -0
- package/dist/orchestration-shell/team-decompose.d.ts +196 -0
- package/dist/orchestration-shell/types.d.ts +777 -0
- package/dist/orchestration-shell/vendor/ink-parse-keypress.d.ts +42 -0
- package/dist/orchestration-shell/web/extract.d.ts +11 -0
- package/dist/orchestration-shell/web/fetch.d.ts +15 -0
- package/dist/orchestration-shell/web/ip.d.ts +26 -0
- package/dist/orchestration-shell/web/sanitize.d.ts +14 -0
- package/dist/orchestration-shell/web/search.d.ts +16 -0
- package/dist/planner/__tests__/cache-clarification-bypass.test.d.ts +1 -0
- package/dist/planner/__tests__/cache.test.d.ts +1 -0
- package/dist/planner/__tests__/client.test.d.ts +1 -0
- package/dist/planner/__tests__/health-machine-transitions.test.d.ts +1 -0
- package/dist/planner/__tests__/local-gemma.test.d.ts +1 -0
- package/dist/planner/__tests__/types-zod.test.d.ts +1 -0
- package/dist/planner/adapter.d.ts +16 -0
- package/dist/planner/cache.d.ts +35 -0
- package/dist/planner/client.d.ts +103 -0
- package/dist/planner/health-state.d.ts +24 -0
- package/dist/planner/index.d.ts +7 -0
- package/dist/planner/local-advisory.d.ts +84 -0
- package/dist/planner/local-gemma.d.ts +23 -0
- package/dist/planner/types.d.ts +123 -0
- package/dist/reviewer/__tests__/antigravity-provider.test.d.ts +1 -0
- package/dist/reviewer/__tests__/claude-provider-json.test.d.ts +1 -0
- package/dist/reviewer/__tests__/cp7-reviewer-sandbox.test.d.ts +1 -0
- package/dist/reviewer/__tests__/output-parser-classifier-helpers.test.d.ts +1 -0
- package/dist/reviewer/__tests__/verdict-classifier.test.d.ts +1 -0
- package/dist/reviewer/index.d.ts +2 -0
- package/dist/reviewer/output-parser.d.ts +48 -12
- package/dist/reviewer/provider.d.ts +107 -3
- package/dist/reviewer/providers/__tests__/failure-classifier.test.d.ts +1 -0
- package/dist/reviewer/providers/antigravity.d.ts +49 -0
- package/dist/reviewer/providers/claude.d.ts +19 -4
- package/dist/reviewer/providers/codex.d.ts +47 -5
- package/dist/reviewer/providers/failure-classifier.d.ts +26 -0
- package/dist/reviewer/providers/gemini.d.ts +5 -4
- package/dist/reviewer/registry.d.ts +5 -5
- package/dist/reviewer/subprocess.d.ts +37 -0
- package/dist/reviewer/token-usage.d.ts +32 -0
- package/dist/reviewer/types.d.ts +5 -5
- package/dist/reviewer/verdict-classifier.d.ts +62 -0
- package/dist/session/__tests__/prepare-event-timestamp.test.d.ts +1 -0
- package/dist/session/__tests__/session-resume-service-keys.test.d.ts +1 -0
- package/dist/session/index.d.ts +1 -0
- package/dist/session/prepare-event-timestamp.d.ts +30 -0
- package/dist/session/session-rekey.d.ts +40 -0
- package/dist/session/session-resume.d.ts +25 -0
- package/dist/structural-summary/__tests__/__fixtures__/fixture-helpers.d.ts +11 -0
- package/dist/structural-summary/__tests__/assembler.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/generator.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/language-detect.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/cargo.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/gomod.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/gradle.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/index.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/npm.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/podfile.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/manifest-parsers/pyproject.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/opt-in-store.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/privacy-filter.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/safe-file-read.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/user-ignore-matcher.test.d.ts +1 -0
- package/dist/structural-summary/__tests__/walker.test.d.ts +1 -0
- package/dist/structural-summary/generator.d.ts +8 -0
- package/dist/structural-summary/index.d.ts +7 -0
- package/dist/structural-summary/manifest-parsers/cargo.d.ts +3 -0
- package/dist/structural-summary/manifest-parsers/index.d.ts +7 -0
- package/dist/structural-summary/manifest-parsers/npm.d.ts +3 -0
- package/dist/structural-summary/manifest-parsers/other.d.ts +17 -0
- package/dist/structural-summary/opt-in-store.d.ts +24 -0
- package/dist/structural-summary/privacy-filter.d.ts +110 -0
- package/dist/structural-summary/safe-file-read.d.ts +11 -0
- package/dist/structural-summary/types.d.ts +215 -0
- package/dist/structural-summary/user-ignore-matcher.d.ts +9 -0
- package/dist/structural-summary/walker.d.ts +20 -0
- package/dist/substrate/__tests__/docker.test.d.ts +1 -0
- package/dist/substrate/__tests__/forwarder.test.d.ts +1 -0
- package/dist/substrate/__tests__/git-proxy.test.d.ts +1 -0
- package/dist/substrate/__tests__/sandbox-exec.test.d.ts +1 -0
- package/dist/substrate/__tests__/substrate-e2e.integration.test.d.ts +1 -0
- package/dist/substrate/command-runner.d.ts +19 -0
- package/dist/substrate/docker.d.ts +134 -0
- package/dist/substrate/errors.d.ts +33 -0
- package/dist/substrate/forwarder.d.ts +67 -0
- package/dist/substrate/git-proxy.d.ts +35 -0
- package/dist/substrate/index.d.ts +12 -0
- package/dist/substrate/relay-script.d.ts +27 -0
- package/dist/substrate/sandbox-exec.d.ts +116 -0
- package/dist/substrate/types.d.ts +218 -0
- package/dist/substrate-launch/__tests__/apikey-bootstrap.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/creditless-loop.integration.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/engage-substrate.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/fallback-ladder.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/le-env-scrub.test.d.ts +1 -0
- package/dist/substrate-launch/__tests__/sanitized-env.test.d.ts +1 -0
- package/dist/substrate-launch/apikey-bootstrap.d.ts +84 -0
- package/dist/substrate-launch/engage-substrate.d.ts +102 -0
- package/dist/substrate-launch/fallback-ladder.d.ts +49 -0
- package/dist/substrate-launch/index.d.ts +12 -0
- package/dist/substrate-launch/le-env-scrub.d.ts +77 -0
- package/dist/substrate-launch/sanitized-env.d.ts +73 -0
- package/dist/types/auth.d.ts +6 -1
- package/dist/types/events.d.ts +19 -2
- package/dist/types/reviewer.d.ts +6 -6
- package/package.json +21 -3
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import type { ConflictClass, ConflictKind, ConflictSide } from './conflict-types';
|
|
2
|
+
/** The fields that uniquely identify a 3-way conflict region (§4.5 key). */
|
|
3
|
+
export interface ConflictIdInput {
|
|
4
|
+
repoId: string;
|
|
5
|
+
path: string;
|
|
6
|
+
/** base = merge-base side. */
|
|
7
|
+
base: ConflictSide;
|
|
8
|
+
/** track = the merging track branch (ours). */
|
|
9
|
+
track: ConflictSide;
|
|
10
|
+
/** counterpart = the current integration tip (theirs). */
|
|
11
|
+
counterpart: ConflictSide;
|
|
12
|
+
conflictKind: ConflictKind;
|
|
13
|
+
/** Deterministic 0-based index of the conflict region in the diff3 output. */
|
|
14
|
+
hunkOrdinal: number;
|
|
15
|
+
/** The pinned merge-implementation id (git version + strategy / vendored). */
|
|
16
|
+
mergeImplId: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Compute the deterministic `conflict_id` for a 3-way conflict region. Pure;
|
|
20
|
+
* identical inputs → identical id; any change in any of the three sides' blob/
|
|
21
|
+
* mode/type, the conflict kind, the hunk ordinal, or `merge_impl_id` → a
|
|
22
|
+
* different id (→ re-resolve, never a stale replay).
|
|
23
|
+
*/
|
|
24
|
+
export declare function computeConflictId(input: ConflictIdInput): string;
|
|
25
|
+
/** SHA-256 hex of arbitrary resolved bytes (the audited `resolved_blob_hash`). */
|
|
26
|
+
export declare function hashResolvedBytes(bytes: Buffer): string;
|
|
27
|
+
/** The full agentic-resolution input identity (CP-14 WB2 / #C14-WB2-AGENTIC-IDENTITY). */
|
|
28
|
+
export interface AgenticInstanceKey {
|
|
29
|
+
/** The off-branch merge-result tree the agent resolved against (full context). */
|
|
30
|
+
conflictedTree: string;
|
|
31
|
+
/** The slot's class-2 `conflict_id`s (sorted into the key for order-stability). */
|
|
32
|
+
conflictIds: readonly string[];
|
|
33
|
+
/** The resolving agent kind (CLAUDE | CODEX | GEMINI). */
|
|
34
|
+
implementorAgent: string;
|
|
35
|
+
/** The resolving agent's per-spawn task identity. */
|
|
36
|
+
implementorTaskId: string;
|
|
37
|
+
/** The pinned merge-implementation id (git version + strategy / vendored). */
|
|
38
|
+
mergeImplId: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Compute the deterministic agentic-resolution `instance_id`. Pure; a change in
|
|
42
|
+
* the conflict-set, the `conflictedTree` (full context), the resolver agent/task,
|
|
43
|
+
* or `merge_impl_id` → a distinct instance (never a stale-context replay).
|
|
44
|
+
*/
|
|
45
|
+
export declare function computeAgenticInstanceId(key: AgenticInstanceKey): string;
|
|
46
|
+
/** A snapshot of the three sides' identity (stored for audit + exact-input replay). */
|
|
47
|
+
export interface ConflictSidesSnapshot {
|
|
48
|
+
base: {
|
|
49
|
+
blobOid?: string;
|
|
50
|
+
mode?: string;
|
|
51
|
+
type: ConflictSide['type'];
|
|
52
|
+
};
|
|
53
|
+
track: {
|
|
54
|
+
blobOid?: string;
|
|
55
|
+
mode?: string;
|
|
56
|
+
type: ConflictSide['type'];
|
|
57
|
+
};
|
|
58
|
+
counterpart: {
|
|
59
|
+
blobOid?: string;
|
|
60
|
+
mode?: string;
|
|
61
|
+
type: ConflictSide['type'];
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** A first-class ConflictResolution audit record (§4.5). */
|
|
65
|
+
export interface ConflictResolutionRecord {
|
|
66
|
+
conflict_id: string;
|
|
67
|
+
repoId: string;
|
|
68
|
+
path: string;
|
|
69
|
+
conflict_kind: ConflictKind;
|
|
70
|
+
hunk_ordinal: number;
|
|
71
|
+
merge_impl_id: string;
|
|
72
|
+
sides: ConflictSidesSnapshot;
|
|
73
|
+
/** The durable per-hunk resolved lines (so multiple hunks COMPOSE). */
|
|
74
|
+
resolved_hunk_patch: string;
|
|
75
|
+
/** SHA-256 of the fully-resolved FILE bytes — the integrity check on replay. */
|
|
76
|
+
resolved_blob_hash: string;
|
|
77
|
+
/** Who resolved it: a deterministic reconciler (lockfile-only in W3-core), the
|
|
78
|
+
* bounded prompt→JSON LLM, an AGENTIC resolver (CP-14 WB2 — read+write in a
|
|
79
|
+
* disposable repo; recorded per-slot via {@link AgenticResolutionRecord}, not
|
|
80
|
+
* here), or a human. */
|
|
81
|
+
resolver: 'reconciler:lockfile' | 'llm' | 'agentic' | 'human';
|
|
82
|
+
/** Free-text rationale (byte-explanation for class-1; model/human reasoning). */
|
|
83
|
+
rationale: string;
|
|
84
|
+
/** Self-reported confidence (best-effort; class-2 is Tier-2'd regardless). */
|
|
85
|
+
confidence?: number;
|
|
86
|
+
/** The resolution class (§4.3). */
|
|
87
|
+
class: ConflictClass;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* A per-SLOT agentic ConflictResolution audit record (CP-14 WB2). Unlike the
|
|
91
|
+
* per-hunk {@link ConflictResolutionRecord}, an agentic resolution covers the
|
|
92
|
+
* whole slot's class-2 conflict-set, is keyed by its full-context
|
|
93
|
+
* {@link AgenticInstanceKey} (`instance_id`), and binds the resolved TREE OID
|
|
94
|
+
* (the selective-imported result) + per-file resolved blob OIDs — the
|
|
95
|
+
* full-committed-tree-OID authentication (agy r2-HIGH) compares the committed
|
|
96
|
+
* commit tree against `resolved_tree_oid`. There is no `resolved_hunk_patch`:
|
|
97
|
+
* the agent wrote whole files, so the audit is tree/blob-level, not hunk-level.
|
|
98
|
+
*/
|
|
99
|
+
export interface AgenticResolutionRecord {
|
|
100
|
+
/** {@link computeAgenticInstanceId} over the slot's {@link AgenticInstanceKey}. */
|
|
101
|
+
instance_id: string;
|
|
102
|
+
/** The off-branch merge-result tree the agent resolved against (full context). */
|
|
103
|
+
conflictedTree: string;
|
|
104
|
+
/** The slot's class-2 `conflict_id`s this resolution covers (sorted). */
|
|
105
|
+
conflictIds: string[];
|
|
106
|
+
implementorAgent: string;
|
|
107
|
+
implementorTaskId: string;
|
|
108
|
+
merge_impl_id: string;
|
|
109
|
+
/** The resolved tree OID (the selective-imported result overlaid on `conflictedTree`). */
|
|
110
|
+
resolved_tree_oid: string;
|
|
111
|
+
/**
|
|
112
|
+
* Per-conflicted-file resolved-content digests (the only paths the agent's edits import).
|
|
113
|
+
* `blobSha256` is the SHA-256 of the resolved file bytes ({@link hashResolvedBytes}), NOT a
|
|
114
|
+
* git blob OID (Stage-2 Codex LOW — the prior `blobOid` name was misleading). It is an audit
|
|
115
|
+
* field only; the full-tree-OID moat ({@link AgenticResolutionRecord.resolved_tree_oid}) is
|
|
116
|
+
* what `verifyAgenticSlot` checks — this per-file digest is NOT on any OID-auth path.
|
|
117
|
+
*/
|
|
118
|
+
resolved_blobs: Array<{
|
|
119
|
+
path: string;
|
|
120
|
+
blobSha256: string;
|
|
121
|
+
}>;
|
|
122
|
+
resolver: 'agentic';
|
|
123
|
+
/** Agentic resolution is always class-2 (the LLM-resolvable tier). */
|
|
124
|
+
class: 2;
|
|
125
|
+
/** Free-text rationale (best-effort; the slot is final-tip Tier-2'd regardless). */
|
|
126
|
+
rationale?: string;
|
|
127
|
+
}
|
|
128
|
+
/** Strip a `ConflictSide` to its stored identity snapshot (no raw bytes). */
|
|
129
|
+
export declare function snapshotSides(input: ConflictIdInput): ConflictSidesSnapshot;
|
|
130
|
+
/**
|
|
131
|
+
* The durable ConflictResolution store (§4.5). Keyed by `conflict_id`. The
|
|
132
|
+
* merge-train looks up a conflict's id BEFORE invoking any model: on a hit the
|
|
133
|
+
* recorded resolution replays (no model call); on a miss it resolves and
|
|
134
|
+
* `put`s the record. Implementations persist to the audit corpus (the
|
|
135
|
+
* `MergeGateResult` chain) with the same EventDedupKey discipline; the
|
|
136
|
+
* in-memory impl below is for tests + a same-process replay cache.
|
|
137
|
+
*/
|
|
138
|
+
export interface ConflictResolutionStore {
|
|
139
|
+
get(conflictId: string): Promise<ConflictResolutionRecord | null>;
|
|
140
|
+
/**
|
|
141
|
+
* Persist a resolution. Idempotent on `conflict_id`: a second put with the
|
|
142
|
+
* SAME conflict_id keeps the ORIGINAL record (the recorded resolution for a
|
|
143
|
+
* given exact 3-way input is immutable — never overwritten by a re-run).
|
|
144
|
+
* Returns the record now in the store (original on a dup).
|
|
145
|
+
*
|
|
146
|
+
* `attemptId` (CP-14 WB2) tags the record as PENDING for that resolve attempt
|
|
147
|
+
* until the `resolution_recorded` WAL marker is durable; a crashed attempt's
|
|
148
|
+
* pending records are dropped by {@link clearPending} on recovery (case 3),
|
|
149
|
+
* never colliding with a fresh non-deterministic re-attempt. Omit for a
|
|
150
|
+
* deterministic (class-1 / replay-stable) record that has no collision risk.
|
|
151
|
+
*/
|
|
152
|
+
put(record: ConflictResolutionRecord, attemptId?: string): Promise<ConflictResolutionRecord>;
|
|
153
|
+
/** Look up an agentic per-slot resolution by its `instance_id`. */
|
|
154
|
+
getAgentic(instanceId: string): Promise<AgenticResolutionRecord | null>;
|
|
155
|
+
/**
|
|
156
|
+
* Persist an agentic per-slot resolution (keyed by `instance_id`). Idempotent
|
|
157
|
+
* on `instance_id` (same full-context instance → keep the original). `attemptId`
|
|
158
|
+
* tags it PENDING until the WAL marker (see {@link put}).
|
|
159
|
+
*/
|
|
160
|
+
putAgentic(record: AgenticResolutionRecord, attemptId?: string): Promise<AgenticResolutionRecord>;
|
|
161
|
+
/**
|
|
162
|
+
* Recovery case 3 (Codex r5 / agy r5): drop every PENDING (pre-WAL) record
|
|
163
|
+
* written under `attemptId` — per-hunk AND agentic — so a fresh non-deterministic
|
|
164
|
+
* re-dispatch can write without a first-writer-wins collision. Pending records
|
|
165
|
+
* are non-authoritative by construction (only a durable WAL makes them load-
|
|
166
|
+
* bearing), so clearing them is safe. No-op for an unknown `attemptId`.
|
|
167
|
+
*/
|
|
168
|
+
clearPending(attemptId: string): Promise<void>;
|
|
169
|
+
/** Explicitly delete a single record by `conflict_id` or agentic `instance_id`. */
|
|
170
|
+
delete(key: string): Promise<void>;
|
|
171
|
+
}
|
|
172
|
+
/** In-memory {@link ConflictResolutionStore} (tests + same-process replay cache). */
|
|
173
|
+
export declare class InMemoryConflictResolutionStore implements ConflictResolutionStore {
|
|
174
|
+
private readonly byId;
|
|
175
|
+
private readonly agenticById;
|
|
176
|
+
/** attemptId → the keys (conflict_id / instance_id) it wrote while PENDING. */
|
|
177
|
+
private readonly pendingByAttempt;
|
|
178
|
+
private trackPending;
|
|
179
|
+
get(conflictId: string): Promise<ConflictResolutionRecord | null>;
|
|
180
|
+
put(record: ConflictResolutionRecord, attemptId?: string): Promise<ConflictResolutionRecord>;
|
|
181
|
+
getAgentic(instanceId: string): Promise<AgenticResolutionRecord | null>;
|
|
182
|
+
putAgentic(record: AgenticResolutionRecord, attemptId?: string): Promise<AgenticResolutionRecord>;
|
|
183
|
+
clearPending(attemptId: string): Promise<void>;
|
|
184
|
+
delete(key: string): Promise<void>;
|
|
185
|
+
/** Test helper: number of distinct recorded per-hunk resolutions. */
|
|
186
|
+
get size(): number;
|
|
187
|
+
/** Test helper: number of distinct recorded agentic per-slot resolutions. */
|
|
188
|
+
get agenticSize(): number;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Verify that `bytes` match the record's audited `resolved_blob_hash`. The bytes
|
|
192
|
+
* MUST be at the SAME granularity the record hashed:
|
|
193
|
+
* - class-2 (per-hunk): the resolved HUNK bytes (`resolved_hunk_patch`);
|
|
194
|
+
* - class-1 (whole-file): the whole resolved FILE bytes.
|
|
195
|
+
* Used as a fail-closed integrity guard: on a fresh resolve it confirms the
|
|
196
|
+
* stored hash reproduces the bytes; on a durable-store REPLAY it catches a
|
|
197
|
+
* corrupted record — a mismatch → FAIL CLOSED (re-resolve / escalate), never
|
|
198
|
+
* adopt unverified bytes (§4.5).
|
|
199
|
+
*/
|
|
200
|
+
export declare function verifyResolvedBytes(record: ConflictResolutionRecord, bytes: Buffer): boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Recompute the `conflict_id` from a record's STORED identity fields (repoId /
|
|
203
|
+
* path / sides {blob,mode,type} / conflict_kind / hunk_ordinal / merge_impl_id).
|
|
204
|
+
* On a durable-store REPLAY the result MUST equal both the record's own
|
|
205
|
+
* `conflict_id` AND the lookup key — a mismatch means the record's identity
|
|
206
|
+
* metadata was tampered/corrupted (the hunk-hash alone wouldn't catch a flipped
|
|
207
|
+
* `class`/`sides`/`kind`), so the caller FAILS CLOSED instead of replaying it
|
|
208
|
+
* (Stage-2 r1 Codex HIGH — replay must not trust mutable record metadata).
|
|
209
|
+
*/
|
|
210
|
+
export declare function recomputeConflictIdFromRecord(record: ConflictResolutionRecord): string;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The git conflict KIND for a path (§4.5). Only `content` (a regular-file text
|
|
3
|
+
* 3-way content conflict) is class-1/class-2 eligible; every other kind is a
|
|
4
|
+
* hard route-to-human (class-3) — a blob-only resolution would be unsound for a
|
|
5
|
+
* rename/mode/type/submodule/binary conflict.
|
|
6
|
+
*/
|
|
7
|
+
export type ConflictKind = 'content' | 'add_add' | 'rename_rename' | 'rename_delete' | 'modify_delete' | 'mode_change' | 'type_change' | 'submodule' | 'binary';
|
|
8
|
+
/** A git tree-entry object type for one side of a conflict (§4.5 key input). */
|
|
9
|
+
export type GitObjectType = 'regular' | 'symlink' | 'gitlink';
|
|
10
|
+
/**
|
|
11
|
+
* One side (base / track / counterpart) of a 3-way conflict for a single path.
|
|
12
|
+
* `blobOid`/`mode`/`type` are part of the `conflict_id` key (§4.5) so a same-blob
|
|
13
|
+
* but different-mode/type pair can never stale-replay across each other.
|
|
14
|
+
* `content` is the raw bytes (present for regular text sides; absent for a
|
|
15
|
+
* deleted side or a non-blob).
|
|
16
|
+
*/
|
|
17
|
+
export interface ConflictSide {
|
|
18
|
+
/** The git blob OID (40/64-hex), or undefined for a deleted/absent side. */
|
|
19
|
+
blobOid?: string;
|
|
20
|
+
/** The octal tree-entry mode (e.g. `100644`, `100755`, `120000`, `160000`). */
|
|
21
|
+
mode?: string;
|
|
22
|
+
/** The object type of this side. */
|
|
23
|
+
type: GitObjectType;
|
|
24
|
+
/** Raw bytes of this side's blob (regular text sides), or undefined. */
|
|
25
|
+
content?: Buffer;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The full per-path conflict descriptor the classifier + resolver consume.
|
|
29
|
+
* Assembled by the merge-train wiring (W3-6) from the 3-way blob extraction.
|
|
30
|
+
*/
|
|
31
|
+
export interface ConflictFileMeta {
|
|
32
|
+
/** Repo-relative path (the integration-tip path). */
|
|
33
|
+
path: string;
|
|
34
|
+
/** The git conflict kind. */
|
|
35
|
+
conflictKind: ConflictKind;
|
|
36
|
+
/** True if any side is detected binary (NUL byte / git binary heuristic). */
|
|
37
|
+
isBinary: boolean;
|
|
38
|
+
/** True if any present REGULAR side is not valid UTF-8 (and not NUL-binary) —
|
|
39
|
+
* e.g. a Latin-1 / invalid-UTF-8 text file. The diff3 parse + compose path is
|
|
40
|
+
* UTF-8 string-based, so such a blob would round-trip through `U+FFFD`
|
|
41
|
+
* replacement bytes and silently corrupt unchanged context lines. It is routed
|
|
42
|
+
* to class-3 (`non_utf8`), FAILING CLOSED before class-2 (Stage-2 r6 Codex MED).
|
|
43
|
+
* A byte-oriented diff3 path could re-enable these as class-2; that is a follow-on. */
|
|
44
|
+
isNonUtf8: boolean;
|
|
45
|
+
/** True if any touched path carries a Git-LFS filter (→ class-3, §4.2). */
|
|
46
|
+
hasLfs: boolean;
|
|
47
|
+
/** True if `.gitattributes` declares a custom `merge=`/`filter=` driver for
|
|
48
|
+
* this path (→ class-3, §4.2) — never run a driver, never silently strip it. */
|
|
49
|
+
hasDangerousAttr: boolean;
|
|
50
|
+
/** The three sides (base = merge-base; track = the merging branch; counterpart
|
|
51
|
+
* = the current integration tip). */
|
|
52
|
+
base: ConflictSide;
|
|
53
|
+
track: ConflictSide;
|
|
54
|
+
counterpart: ConflictSide;
|
|
55
|
+
}
|
|
56
|
+
/** The resolution class for a conflict (§4.3). */
|
|
57
|
+
export type ConflictClass = 1 | 2 | 3;
|
|
58
|
+
/** Why a conflict was put in its class (audit + the human-gate surface). */
|
|
59
|
+
export interface ConflictClassification {
|
|
60
|
+
/** 1 = deterministic-mechanical, 2 = LLM-assisted (Tier-2'd), 3 = human gate. */
|
|
61
|
+
class: ConflictClass;
|
|
62
|
+
/** Human-readable rationale. */
|
|
63
|
+
reason: string;
|
|
64
|
+
/** For class-1: the deterministic reconciler family to apply. W3-core ships
|
|
65
|
+
* only the structurally-safe `lockfile` reconciler; whitespace/import-order
|
|
66
|
+
* are deferred to the language-aware follow-on (see class1-reconcilers.ts). */
|
|
67
|
+
reconciler?: 'lockfile';
|
|
68
|
+
/** For class-3: the structural trigger category that forced the human gate. */
|
|
69
|
+
humanGateTrigger?: 'shared_contract' | 'dangerous_attr' | 'submodule' | 'lfs' | 'binary' | 'non_utf8' | 'mode_change' | 'type_change' | 'rename' | 'add_add' | 'modify_delete' | 'lockfile_version_delta';
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* One conflict HUNK within a path — the unit a resolution is recorded against
|
|
73
|
+
* (§4.5 stores the per-hunk `resolved_hunk_patch` so multiple hunks on one file
|
|
74
|
+
* COMPOSE rather than overwrite). `hunkOrdinal` is the deterministic index of
|
|
75
|
+
* the conflict region in the pinned diff3 output.
|
|
76
|
+
*/
|
|
77
|
+
export interface ConflictHunk {
|
|
78
|
+
/** Deterministic 0-based index of this conflict region in the diff3 output. */
|
|
79
|
+
hunkOrdinal: number;
|
|
80
|
+
/** The base (merge-base) lines of this region. */
|
|
81
|
+
baseLines: string[];
|
|
82
|
+
/** The track-branch (ours) lines of this region. */
|
|
83
|
+
trackLines: string[];
|
|
84
|
+
/** The integration-tip (theirs) lines of this region. */
|
|
85
|
+
counterpartLines: string[];
|
|
86
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { AuditKindCp7, StrictAuditSink } from "../credential-broker/audit-sink";
|
|
2
|
+
/** One CP-7 audit-log entry, mirroring `codevibe-audit::AuditEntry` (no new fields). */
|
|
3
|
+
export interface Cp7AuditEntry {
|
|
4
|
+
/** Primary key — this entry's identity (a uuid). NOT the dedup key. */
|
|
5
|
+
entry_id: string;
|
|
6
|
+
/** Foreign key to the orchestration task this entry describes. */
|
|
7
|
+
task_id: string;
|
|
8
|
+
/** Which CP-7 audit kind (snake_case wire form). */
|
|
9
|
+
kind: AuditKindCp7;
|
|
10
|
+
/** Typed payload per `kind` (the broker/LE-supplied object). */
|
|
11
|
+
payload: Record<string, unknown>;
|
|
12
|
+
/** When the event occurred (a fixed ISO-8601 ms-precision UTC string). */
|
|
13
|
+
timestamp: string;
|
|
14
|
+
/**
|
|
15
|
+
* Hex SHA-256 of the canonical serialization of the PREVIOUS entry in this
|
|
16
|
+
* task's file. `null` ONLY for the genesis (first) entry — the documented
|
|
17
|
+
* zero/empty sentinel (§W3.2 step 3).
|
|
18
|
+
*/
|
|
19
|
+
prev_hash: string | null;
|
|
20
|
+
/** Deterministic event-identity key (the framed W0 helper output, hex). */
|
|
21
|
+
event_dedup_key: string;
|
|
22
|
+
}
|
|
23
|
+
/** The pinned canonical-form version tag (bump = chain-breaking migration). */
|
|
24
|
+
export declare const CP7_CANONICAL_FORM_VERSION = "cp7-w3-canonical-v1";
|
|
25
|
+
/** The documented genesis `prev_hash` sentinel — `null` (first entry only). */
|
|
26
|
+
export declare const GENESIS_PREV_HASH: null;
|
|
27
|
+
/**
|
|
28
|
+
* Deterministic, stable-key-ordered JSON serialization of an arbitrary
|
|
29
|
+
* JSON-able value. Object keys are recursively sorted ascending (JS default
|
|
30
|
+
* `<` on the key strings — UTF-16 code-unit order); arrays keep element order;
|
|
31
|
+
* scalars use `JSON.stringify`. This is the `payload` serializer (and is reused
|
|
32
|
+
* for the whole canonical object so the ordering rule is single-sourced).
|
|
33
|
+
*
|
|
34
|
+
* Rejects values that JSON cannot round-trip deterministically: `undefined`,
|
|
35
|
+
* functions, and non-finite numbers throw (a payload carrying one is a bug —
|
|
36
|
+
* fail closed rather than silently drop a field and corrupt the chain).
|
|
37
|
+
*/
|
|
38
|
+
export declare function canonicalJson(value: unknown): string;
|
|
39
|
+
/**
|
|
40
|
+
* Serialize a {@link Cp7AuditEntry} to its PINNED canonical bytes (a UTF-8
|
|
41
|
+
* string). The 7 fields are emitted in {@link CANONICAL_FIELD_ORDER}; `payload`
|
|
42
|
+
* (and every field, via the single-sourced {@link canonicalJson}) is
|
|
43
|
+
* stable-key-ordered. THIS string is what `computeEntryHash` hashes — the
|
|
44
|
+
* verifier contract (CP-8 must reproduce it).
|
|
45
|
+
*/
|
|
46
|
+
export declare function canonicalEntryBytes(entry: Cp7AuditEntry): string;
|
|
47
|
+
/**
|
|
48
|
+
* The TS-NATIVE tamper-evident chain hash of a {@link Cp7AuditEntry}: lowercase
|
|
49
|
+
* hex SHA-256 over its {@link canonicalEntryBytes}. The NEXT entry's `prev_hash`
|
|
50
|
+
* is this value; flipping ANY field of THIS entry changes these bytes → changes
|
|
51
|
+
* this hash → breaks the next entry's `prev_hash` link → chain verify fails.
|
|
52
|
+
*
|
|
53
|
+
* NOT a byte-mirror of the Rust `sha256_hex(serde_json::to_string(&AuditEntry))`
|
|
54
|
+
* chain (§W3.2 step 3) — TS-native by design.
|
|
55
|
+
*/
|
|
56
|
+
export declare function computeEntryHash(entry: Cp7AuditEntry): string;
|
|
57
|
+
/**
|
|
58
|
+
* Verify a hash chain over an ordered list of entries (the CP-8 reader logic,
|
|
59
|
+
* inlined here for the W3 self-consistency + mutation tests). Returns the index
|
|
60
|
+
* of the FIRST broken link, or `null` if the whole chain verifies.
|
|
61
|
+
*
|
|
62
|
+
* A chain is valid iff entry[0].prev_hash === GENESIS sentinel AND for every
|
|
63
|
+
* i>0, entry[i].prev_hash === computeEntryHash(entry[i-1]).
|
|
64
|
+
*/
|
|
65
|
+
export declare function verifyChain(entries: ReadonlyArray<Cp7AuditEntry>): number | null;
|
|
66
|
+
/**
|
|
67
|
+
* The real {@link StrictAuditSink} for a live session (§W3.2). ONE instance per
|
|
68
|
+
* `task_id`, bound to that task's `audit.jsonl` path. Every `emit`:
|
|
69
|
+
* 1. allocates an `entry_id` (uuid),
|
|
70
|
+
* 2. computes the framed `event_dedup_key` from the payload,
|
|
71
|
+
* 3. chains `prev_hash` off the last entry written to THIS file,
|
|
72
|
+
* 4. builds the {@link Cp7AuditEntry} (no new fields),
|
|
73
|
+
* 5. durably appends (`O_CREAT|O_APPEND|O_WRONLY|`**`O_NOFOLLOW`** open +
|
|
74
|
+
* `fstat` regular-file assert + `writeSync` + **`fsyncSync`**) and returns
|
|
75
|
+
* `{ack}` ONLY after fsync; ANY throw → `{nack}` (NEVER swallowed). The
|
|
76
|
+
* O_NOFOLLOW open refuses to follow a planted leaf symlink (ELOOP) so the
|
|
77
|
+
* record can never be redirected into the agent-writable workdir; a
|
|
78
|
+
* post-write finalize failure POISONS the writer (fail closed),
|
|
79
|
+
* 6. with all appends serialized per-task (in-instance queue) so concurrent
|
|
80
|
+
* emits chain deterministically.
|
|
81
|
+
*/
|
|
82
|
+
export declare class Cp7AuditWriter implements StrictAuditSink {
|
|
83
|
+
private readonly taskId;
|
|
84
|
+
private readonly auditPath;
|
|
85
|
+
/** The last entry's hash (the next entry's `prev_hash`). `null` = genesis. */
|
|
86
|
+
private lastHash;
|
|
87
|
+
/** True once we've established `lastHash` (in-memory OR from the file). */
|
|
88
|
+
private chainInitialized;
|
|
89
|
+
/** The in-instance serialization tail — appends chain onto this. */
|
|
90
|
+
private appendQueue;
|
|
91
|
+
/**
|
|
92
|
+
* Stage-2 r1 MEDIUM — the writer is POISONED once an append has WRITTEN bytes
|
|
93
|
+
* to disk but FAILED to complete cleanly (fsync/close threw AFTER the write
|
|
94
|
+
* syscall). The bytes are durable but `lastHash` did NOT advance, so the
|
|
95
|
+
* on-disk chain has an orphaned line a later emit would acknowledge against a
|
|
96
|
+
* stale `prev_hash` → a forever-broken chain. Once poisoned, EVERY subsequent
|
|
97
|
+
* `emit` fails closed with `{nack}` (NEVER acks onto a broken chain). This is
|
|
98
|
+
* set ONLY on a POST-write failure — a PRE-write failure (open/O_NOFOLLOW/
|
|
99
|
+
* fstat reject → the file is untouched) nacks WITHOUT poisoning, since the
|
|
100
|
+
* chain on disk is still intact and the next emit can proceed.
|
|
101
|
+
*/
|
|
102
|
+
private poisoned;
|
|
103
|
+
/**
|
|
104
|
+
* @param taskId The orchestration task_id — the audit scope (§3.5). Bound
|
|
105
|
+
* at construction; every entry carries it + the dedup keys
|
|
106
|
+
* frame on it.
|
|
107
|
+
* @param auditPath The per-task `audit.jsonl` absolute path. The LE derives it
|
|
108
|
+
* as `<repoRootCanonical>/.codevibe/audit/<group>/<track>/`
|
|
109
|
+
* and asserts (containment guard) it is OUTSIDE the agent's
|
|
110
|
+
* workdir BEFORE constructing this (see engage-substrate.ts).
|
|
111
|
+
*/
|
|
112
|
+
constructor(taskId: string, auditPath: string);
|
|
113
|
+
/** The per-task audit file path (for the E2E + teardown). */
|
|
114
|
+
get path(): string;
|
|
115
|
+
/**
|
|
116
|
+
* Emit one strict audit row. Resolves `{ack: entry_id}` ONLY after the row is
|
|
117
|
+
* durably fsync'd; resolves `{nack: reason}` on ANY failure (open/O_NOFOLLOW
|
|
118
|
+
* ELOOP/fstat/write/fsync/canonicalization). NEVER throws, NEVER swallows a
|
|
119
|
+
* failure into a false ack.
|
|
120
|
+
*
|
|
121
|
+
* Appends are serialized onto an in-instance queue so concurrent emits chain
|
|
122
|
+
* deterministically (no interleaved `prev_hash` race).
|
|
123
|
+
*
|
|
124
|
+
* Stage-2 r1 MEDIUM — POISON FAIL-CLOSED: if an append wrote bytes to disk but
|
|
125
|
+
* failed to finalize (fsync/close threw after the write), the writer becomes
|
|
126
|
+
* POISONED and EVERY subsequent emit nacks (`"writer poisoned after partial
|
|
127
|
+
* write"`) — never an ack onto the now-broken on-disk chain. A PRE-write
|
|
128
|
+
* failure (open/O_NOFOLLOW/fstat/dedup/canonicalize) nacks WITHOUT poisoning
|
|
129
|
+
* (the file is untouched; the next emit may proceed).
|
|
130
|
+
*/
|
|
131
|
+
emit(kind: AuditKindCp7, payload: Record<string, unknown>): Promise<{
|
|
132
|
+
ack: string;
|
|
133
|
+
} | {
|
|
134
|
+
nack: string;
|
|
135
|
+
}>;
|
|
136
|
+
/**
|
|
137
|
+
* The serialized single-append body. Runs under the queue (never concurrently
|
|
138
|
+
* with another append on this instance). Returns `{ack}`/`{nack}` — NEVER
|
|
139
|
+
* rejects (a throw is caught + converted to a nack so the chain tail stays
|
|
140
|
+
* a resolved promise).
|
|
141
|
+
*/
|
|
142
|
+
private appendOne;
|
|
143
|
+
/**
|
|
144
|
+
* Recover the chain tail from an existing file (resumed session). Reads the
|
|
145
|
+
* file's last non-empty line, parses it as a {@link Cp7AuditEntry}, and
|
|
146
|
+
* returns `computeEntryHash` of it. Returns `null` (genesis) if the file is
|
|
147
|
+
* absent or empty. A corrupt last line THROWS — better a hard fail than
|
|
148
|
+
* silently re-chaining off a forged/truncated tail (mirrors the Rust
|
|
149
|
+
* `FileAuditWriter::open` CorruptedTail contract).
|
|
150
|
+
*/
|
|
151
|
+
private readLastHashFromFile;
|
|
152
|
+
}
|