@quantiya/codevibe-core 2.0.1 → 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__/prompt-parser.test.d.ts +1 -0
- package/dist/adapter/registry.d.ts +69 -2
- package/dist/appsync/__tests__/appsync-client-event-source-filter.test.d.ts +1 -0
- package/dist/appsync/__tests__/appsync-client-task-group.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 +621 -10
- package/dist/appsync/event-throttle.d.ts +28 -0
- package/dist/appsync/index.d.ts +3 -0
- package/dist/appsync/queries.d.ts +19 -0
- package/dist/audit-keys/index.d.ts +32 -0
- package/dist/auth/auth-service.d.ts +32 -2
- package/dist/auth/auth-telemetry.d.ts +19 -1
- package/dist/auth/index.d.ts +1 -0
- package/dist/companion-mode/persist-preference.d.ts +1 -1
- 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 +6 -1
- package/dist/index.js +427 -124
- package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
- package/dist/keychain/keychain-backend.d.ts +82 -0
- 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__/class-a-sign.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__/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__/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__/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__/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 +33 -1
- package/dist/local-executor/class-a-emit.d.ts +3 -1
- package/dist/local-executor/class-a-sign.d.ts +57 -0
- package/dist/local-executor/class-b-consumer.d.ts +159 -4
- 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 +1 -1
- package/dist/local-executor/implementor-argv.d.ts +183 -0
- package/dist/local-executor/index.d.ts +44 -3
- package/dist/local-executor/local-executor-impl.d.ts +645 -4
- 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 +29 -1
- 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 +238 -4
- 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/detect-agents.d.ts +15 -2
- package/dist/orchestration/setup-types.d.ts +2 -1
- 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-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-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-verdict-classifier-wiring.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__/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-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__/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__/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__/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__/serialize-submissions.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__/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 +336 -1
- package/dist/orchestration-shell/cli.js +39318 -3436
- package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
- package/dist/orchestration-shell/components/ConversationPane.d.ts +7 -1
- 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 +7 -0
- package/dist/orchestration-shell/components/InputBar.d.ts +17 -3
- 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 +81 -15
- package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
- package/dist/orchestration-shell/components/StatusBar.d.ts +15 -2
- 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 +1 -1
- package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
- package/dist/orchestration-shell/gate-prompts.d.ts +361 -3
- package/dist/orchestration-shell/index.d.ts +613 -1
- package/dist/orchestration-shell/ink-runtime.d.ts +21 -1
- 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/non-tty-fallback.d.ts +21 -0
- package/dist/orchestration-shell/quorum-loop.d.ts +1900 -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 +20 -1
- 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/task-progress.d.ts +122 -0
- package/dist/orchestration-shell/team-decompose.d.ts +196 -0
- package/dist/orchestration-shell/types.d.ts +363 -3
- 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__/local-gemma.test.d.ts +1 -0
- package/dist/planner/index.d.ts +2 -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 +16 -6
- 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/index.d.ts +1 -0
- package/dist/session/prepare-event-timestamp.d.ts +30 -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 +3 -1
- package/dist/types/reviewer.d.ts +6 -6
- package/package.json +7 -3
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/** Fail-closed payload line (routing step 3 + decrypt failure). */
|
|
2
|
+
export declare const ENTRY_DETAILS_UNAVAILABLE = "Entry details unavailable";
|
|
3
|
+
/** Empty/sparse chain empty-state. */
|
|
4
|
+
export declare const NO_AUDIT_ENTRIES = "No audit entries yet.";
|
|
5
|
+
/** queryAudit error / 1 MB overflow empty-state. */
|
|
6
|
+
export declare const AUDIT_LOG_TOO_LARGE = "Audit log too large to display here \u2014 export coming soon";
|
|
7
|
+
/** Screen title. */
|
|
8
|
+
export declare const AUDIT_LOG_TITLE = "Audit log";
|
|
9
|
+
/** Max interstitial headline (non-Max → render this + the existing upgrade CTA). */
|
|
10
|
+
export declare const AUDIT_BROWSER_MAX_HEADLINE = "The audit browser is a Max feature";
|
|
11
|
+
/**
|
|
12
|
+
* The SINGLE shared client constant naming which `kind`s may render directly
|
|
13
|
+
* from a non-envelope plaintext payload (shared-contract §3 step 2). Today
|
|
14
|
+
* exactly `task_authorized`. Any other non-envelope payload FAILS CLOSED.
|
|
15
|
+
* A future CP-9/CP-12 wire-public kind must be added here explicitly before
|
|
16
|
+
* it renders plaintext — the default for "plaintext I don't recognize" is
|
|
17
|
+
* suppress-not-show (zero-knowledge defense).
|
|
18
|
+
*/
|
|
19
|
+
export declare const WIRE_PUBLIC_PLAINTEXT_KINDS: ReadonlySet<string>;
|
|
20
|
+
/**
|
|
21
|
+
* `auditKindCopy` — every key is a REAL serde wire label from the Rust enum
|
|
22
|
+
* (`codevibe-audit/src/lib.rs:121-337`, `#[serde(rename_all = "snake_case")]`).
|
|
23
|
+
* The `audit-browser.test.ts` asserts every key is in the canonical wire-label
|
|
24
|
+
* set (so a typo can't silently ship). Unknown/future kind → the raw snake_case
|
|
25
|
+
* string (see `auditKindLabel`), never blank.
|
|
26
|
+
*/
|
|
27
|
+
export declare const auditKindCopy: Readonly<Record<string, string>>;
|
|
28
|
+
/** Humanize a wire kind via `auditKindCopy`; unknown/future → raw snake_case. */
|
|
29
|
+
export declare function auditKindLabel(kind: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* The minimal content-decrypt primitive the router needs — structurally
|
|
32
|
+
* compatible with `cryptoService.decryptContent(ciphertextB64, sessionKeyB64)`.
|
|
33
|
+
* Injected so the parity test runs with a mock (no live crypto).
|
|
34
|
+
*/
|
|
35
|
+
export type DecryptContentFn = (encryptedB64: string, sessionKeyBase64: string) => string;
|
|
36
|
+
/** How a single entry's payload resolved (§3). */
|
|
37
|
+
export type AuditEntryRouteStatus = 'decrypted' | 'plaintext' | 'unavailable';
|
|
38
|
+
/** A reviewer-verdict suggested-change / finding row (untruncated). */
|
|
39
|
+
export interface AuditReviewerVerdictModel {
|
|
40
|
+
/** Display label for the 4-value verdict via `decisionCopy` (unknown → raw). */
|
|
41
|
+
readonly decisionLabel: string;
|
|
42
|
+
/** Seat / role / agent provenance line, or null when absent. */
|
|
43
|
+
readonly provenance: string | null;
|
|
44
|
+
/** The UNTRUNCATED reviewer reasoning, or null when absent. */
|
|
45
|
+
readonly reasoning: string | null;
|
|
46
|
+
/** Each suggested-changes entry (untruncated), or empty. */
|
|
47
|
+
readonly suggestedChanges: ReadonlyArray<string>;
|
|
48
|
+
}
|
|
49
|
+
/** A `task_authorized` wire-public plaintext authority model. */
|
|
50
|
+
export interface AuditTaskAuthorizedModel {
|
|
51
|
+
readonly authorizedAction: string | null;
|
|
52
|
+
readonly authorityScope: string | null;
|
|
53
|
+
readonly authorityExpiresAt: string | null;
|
|
54
|
+
readonly approvalEventId: string | null;
|
|
55
|
+
}
|
|
56
|
+
/** The render model for ONE audit entry (§4). */
|
|
57
|
+
export interface AuditEntryModel {
|
|
58
|
+
/** Per-entry stable key (timestamp + entryId fallback). */
|
|
59
|
+
readonly entryId: string;
|
|
60
|
+
/** Humanized kind label (`auditKindCopy`; unknown → raw snake_case). */
|
|
61
|
+
readonly kindLabel: string;
|
|
62
|
+
/** Raw snake_case kind (for tests / forward-compat display). */
|
|
63
|
+
readonly kind: string;
|
|
64
|
+
/** RFC3339 timestamp (header line), or null when absent. */
|
|
65
|
+
readonly timestamp: string | null;
|
|
66
|
+
/** How the payload resolved. */
|
|
67
|
+
readonly status: AuditEntryRouteStatus;
|
|
68
|
+
/**
|
|
69
|
+
* The neutral payload line shown when `status === 'unavailable'`
|
|
70
|
+
* (`Entry details unavailable`), else null.
|
|
71
|
+
*/
|
|
72
|
+
readonly unavailableLine: string | null;
|
|
73
|
+
/** Reviewer-verdict full review (only `reviewer_verdict_recorded`), or null. */
|
|
74
|
+
readonly reviewerVerdict: AuditReviewerVerdictModel | null;
|
|
75
|
+
/** `task_authorized` authority scalars, or null. */
|
|
76
|
+
readonly taskAuthorized: AuditTaskAuthorizedModel | null;
|
|
77
|
+
/**
|
|
78
|
+
* Best-effort pretty-printed JSON of an ALREADY-SAFE payload (a decrypted
|
|
79
|
+
* envelope OR an allow-listed plaintext) that didn't match its expected
|
|
80
|
+
* per-kind shape, OR an unknown-but-ENVELOPE kind. NEVER set for a
|
|
81
|
+
* fail-closed entry. Null when a structured model rendered instead.
|
|
82
|
+
*/
|
|
83
|
+
readonly rawJson: string | null;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Route ONE audit row's payload per shared-contract §3 (shape-detect →
|
|
87
|
+
* allow-list → fail-closed) and build its render model. INVARIANT: every row
|
|
88
|
+
* yields a rendered model OR the neutral `Entry details unavailable` line —
|
|
89
|
+
* NEVER ciphertext, NEVER a crash, NEVER raw-JSON for an unknown non-envelope
|
|
90
|
+
* plaintext.
|
|
91
|
+
*
|
|
92
|
+
* @param row one raw `Record<string, unknown>` from `queryAudit().rows`
|
|
93
|
+
* @param sessionKey the task's session key (base64), or null when unavailable
|
|
94
|
+
* @param decrypt injected `cryptoService.decryptContent` (mock in tests)
|
|
95
|
+
*/
|
|
96
|
+
export declare function routeAuditEntry(row: Record<string, unknown>, sessionKey: string | null, decrypt: DecryptContentFn): AuditEntryModel;
|
|
97
|
+
/** The full render model for the per-task audit browser. */
|
|
98
|
+
export interface AuditBrowserModel {
|
|
99
|
+
readonly title: string;
|
|
100
|
+
/** Newest-first entry models. Empty → render `emptyLine`. */
|
|
101
|
+
readonly entries: ReadonlyArray<AuditEntryModel>;
|
|
102
|
+
/** Set when there are zero entries (the `No audit entries yet.` line). */
|
|
103
|
+
readonly emptyLine: string | null;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Build the full newest-first audit browser model from the server-ascending
|
|
107
|
+
* `rows`. PURE — takes the rows + the session key + the injected decrypt fn.
|
|
108
|
+
* Ordering (§2): the rows come back server-ascending; we reverse to newest-first
|
|
109
|
+
* (using `timestamp`/`entryId` as keys — there is NO `seq_num` on the wire).
|
|
110
|
+
*/
|
|
111
|
+
export declare function buildAuditBrowserModel(rows: ReadonlyArray<Record<string, unknown>>, sessionKey: string | null, decrypt: DecryptContentFn): AuditBrowserModel;
|
|
112
|
+
/** Render a single entry model as readable plaintext lines. */
|
|
113
|
+
export declare function renderAuditEntryText(entry: AuditEntryModel): string[];
|
|
114
|
+
/** Render the whole browser model as a readable newest-first timeline. */
|
|
115
|
+
export declare function renderAuditBrowserText(model: AuditBrowserModel): string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { AppSyncClient } from '../appsync';
|
|
2
|
+
import type { Tier } from './types';
|
|
3
|
+
import { type AuditBrowserModel, type DecryptContentFn } from './audit-browser';
|
|
4
|
+
/** Upgrade CTA appended below the Max interstitial (matches the existing copy). */
|
|
5
|
+
export declare const AUDIT_BROWSER_UPGRADE_HINT = "Upgrade to Max at https://quantiya.ai/codevibe to access the audit browser.";
|
|
6
|
+
/**
|
|
7
|
+
* The minimal AppSync surface the runner needs — `queryAudit` (the existing
|
|
8
|
+
* 2-arg `{taskId,sessionId}` method) + `getSubscriptionStatus`. Narrowed so the
|
|
9
|
+
* tests can inject a stub without the full client.
|
|
10
|
+
*/
|
|
11
|
+
export type AuditAppSyncClient = Pick<AppSyncClient, 'queryAudit' | 'getSubscriptionStatus'>;
|
|
12
|
+
export interface RunAuditBrowserDeps {
|
|
13
|
+
/** The authenticated AppSync client (caller ran `authenticateWithStoredTokens`). */
|
|
14
|
+
appsyncClient: AuditAppSyncClient;
|
|
15
|
+
/** The task to browse. */
|
|
16
|
+
taskId: string;
|
|
17
|
+
/** The session the task belongs to (the `queryAudit` 2-arg shape needs it). */
|
|
18
|
+
sessionId: string;
|
|
19
|
+
/**
|
|
20
|
+
* The effective tier. When provided (the CLI passes `readTierFromEnvOrDefault`),
|
|
21
|
+
* it is authoritative (honors `CODEVIBE_TIER`). When omitted, the runner reads
|
|
22
|
+
* `getSubscriptionStatus().tier` from the backend.
|
|
23
|
+
*/
|
|
24
|
+
tier?: Tier;
|
|
25
|
+
/** Test seam — defaults to `cryptoService.decryptContent`. */
|
|
26
|
+
decryptFn?: DecryptContentFn;
|
|
27
|
+
/** Test seam — defaults to `keychainManager.getSessionKey(sessionId)`. */
|
|
28
|
+
getSessionKeyFn?: (sessionId: string) => Promise<string | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Test seam — overrides the Max-gate tier resolution entirely (skips
|
|
31
|
+
* getSubscriptionStatus). When set, this wins over `tier` + the backend read.
|
|
32
|
+
*/
|
|
33
|
+
resolveTierFn?: () => Promise<Tier>;
|
|
34
|
+
}
|
|
35
|
+
/** The outcome of a browser run. */
|
|
36
|
+
export type RunAuditBrowserResult = {
|
|
37
|
+
kind: 'gated';
|
|
38
|
+
headline: string;
|
|
39
|
+
upgradeHint: string;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'ok';
|
|
42
|
+
model: AuditBrowserModel;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'error';
|
|
45
|
+
line: string;
|
|
46
|
+
reason: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Run the per-task audit browser: Max-gate → fetch → resolve session key →
|
|
50
|
+
* route + build the newest-first render model. Returns a discriminated result
|
|
51
|
+
* the shell / CLI render. NEVER throws (every failure → a structured result).
|
|
52
|
+
*/
|
|
53
|
+
export declare function runAuditBrowser(deps: RunAuditBrowserDeps): Promise<RunAuditBrowserResult>;
|
|
54
|
+
/**
|
|
55
|
+
* Render a `RunAuditBrowserResult` as readable plaintext (the meta-CLI default
|
|
56
|
+
* output + the inline `/audit` shell output). The `--json` CLI path renders the
|
|
57
|
+
* model directly as JSON instead (see `cli.ts`).
|
|
58
|
+
*/
|
|
59
|
+
export declare function renderAuditResultText(result: RunAuditBrowserResult): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** DECSET enable: terminal starts wrapping pastes in START…END. */
|
|
2
|
+
export declare const ENABLE_BRACKETED_PASTE = "\u001B[?2004h";
|
|
3
|
+
/** DECSET disable: restore normal paste behavior. */
|
|
4
|
+
export declare const DISABLE_BRACKETED_PASTE = "\u001B[?2004l";
|
|
5
|
+
/** Paste-start marker (6 bytes). */
|
|
6
|
+
export declare const PASTE_START = "\u001B[200~";
|
|
7
|
+
/** Paste-end marker (6 bytes). */
|
|
8
|
+
export declare const PASTE_END = "\u001B[201~";
|
|
9
|
+
/** Minimal write-stream shape we need (real `process.stdout` satisfies it). */
|
|
10
|
+
export interface DecsetStream {
|
|
11
|
+
write(s: string): unknown;
|
|
12
|
+
isTTY?: boolean;
|
|
13
|
+
writable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** `<OrchestrationApp>` registers its `useStdout().stdout` here on mount. */
|
|
16
|
+
export declare function setRenderStdout(stdout: DecsetStream | null): void;
|
|
17
|
+
/** Enable bracketed paste on the render stdout (idempotent; TTY-gated). */
|
|
18
|
+
export declare function enableBracketedPaste(explicit?: DecsetStream | null): void;
|
|
19
|
+
/**
|
|
20
|
+
* Disable bracketed paste (idempotent; TTY-gated). Safe to call from the signal
|
|
21
|
+
* path AND the unmount cleanup (double-call is a no-op once disabled). Callers
|
|
22
|
+
* that clear the render-stdout ref MUST disable FIRST, then clear (Stage-2 LOW).
|
|
23
|
+
*/
|
|
24
|
+
export declare function disableBracketedPaste(explicit?: DecsetStream | null): void;
|
|
25
|
+
/** Test-only: reset module state between tests. */
|
|
26
|
+
export declare function __resetBracketedPasteStateForTests(): void;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { AppSyncClient } from '../appsync';
|
|
2
2
|
import { Session } from '../types';
|
|
3
|
+
import { Mode, Tier } from './types';
|
|
4
|
+
import { type RunOrchestrationShellArgs } from './index';
|
|
3
5
|
import { type ShellEventEmit } from './emit-shell-event';
|
|
4
|
-
import { BackendPlannerClient, PlannerCacheLayer, PlannerHealthMachine } from '../planner';
|
|
6
|
+
import { BackendPlannerClient, PlannerCacheLayer, PlannerHealthMachine, type LocalGemmaAdvisoryRunner, type LocalGemmaPlannerRunner } from '../planner';
|
|
5
7
|
import type { PlannerAdapter, PlannerInput, PlannerDecision, PlannerProbeResult } from '../planner/adapter';
|
|
8
|
+
import { type LocalExecutor, type AuthorityScope, type EmitShellEventFn as LEEmitShellEventFn } from '../local-executor';
|
|
9
|
+
import { type EngineGroupState } from '../local-executor';
|
|
10
|
+
import type { TeamTapEvent } from './index';
|
|
11
|
+
import type { GroupDecisionSubmitDeps } from './gate-decision-submit';
|
|
12
|
+
import { QuorumLoop } from './quorum-loop';
|
|
13
|
+
import type { TaskProgressEvent } from './task-progress';
|
|
14
|
+
import { type VerdictClassifier } from '../reviewer/verdict-classifier';
|
|
15
|
+
import { type LocalModelArtifactConfig, type LocalModelCommand, type LocalModelEntitlement, type LocalModelStore } from '../local-model/manager';
|
|
16
|
+
import { type LocalModelState } from '../local-model/state';
|
|
6
17
|
/**
|
|
7
18
|
* CP-1.b IMPL r5 H-1 — Sentinel error thrown by the stub-session
|
|
8
19
|
* planner adapter. `handleShellUserInput` catches this typed class and
|
|
@@ -44,6 +55,19 @@ export declare class PlannerUnavailableAdapter implements PlannerAdapter {
|
|
|
44
55
|
probe(): Promise<PlannerProbeResult>;
|
|
45
56
|
setActiveSession(sessionId: string | null): void;
|
|
46
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Local-LLM planner placeholder for the Gemma QAT migration slice. This adapter
|
|
60
|
+
* is intentionally local-only: it never calls AppSync planner mutations or any
|
|
61
|
+
* hosted fallback. Until the verified Gemma runner is wired, natural-language
|
|
62
|
+
* planning requests fail closed with an actionable shell message.
|
|
63
|
+
*/
|
|
64
|
+
export declare class LocalModelPlannerUnavailableAdapter implements PlannerAdapter {
|
|
65
|
+
private readonly reason;
|
|
66
|
+
constructor(reason: string);
|
|
67
|
+
classify(_input: PlannerInput): Promise<PlannerDecision>;
|
|
68
|
+
probe(): Promise<PlannerProbeResult>;
|
|
69
|
+
setActiveSession(_sessionId: string | null): void;
|
|
70
|
+
}
|
|
47
71
|
/**
|
|
48
72
|
* CP-1.b IMPL r5 H-1 — Detect a CP-1.a stub session. Two signals:
|
|
49
73
|
* (a) `sessionId` starts with `cp1a-local-` (the
|
|
@@ -58,6 +82,119 @@ export declare class PlannerUnavailableAdapter implements PlannerAdapter {
|
|
|
58
82
|
* until the user registers a device key.
|
|
59
83
|
*/
|
|
60
84
|
export declare function isStubSession(session: Session): boolean;
|
|
85
|
+
export declare function buildStubSessionShellArgs(args: Omit<RunOrchestrationShellArgs, 'disableStructuralContextRefresh'>): RunOrchestrationShellArgs;
|
|
86
|
+
/**
|
|
87
|
+
* CP-1.f §3.C.19 — resolve a REAL backend session for the orchestration loop
|
|
88
|
+
* (closes #513). When authenticated:
|
|
89
|
+
* 1. resume the user's most-recent ACTIVE session via `getSession` (which
|
|
90
|
+
* returns `encryptedKeys`) AND warm the session-key cache from them so the
|
|
91
|
+
* QuorumLoop's `getSessionKey` is non-null, OR
|
|
92
|
+
* 2. create a new orchestration session with the FULL E2E bootstrap
|
|
93
|
+
* (`prepareSessionEncryption` → `createSession` with isEncrypted /
|
|
94
|
+
* encryptedKeys / creatorDeviceId / encryptionVersion → `cacheSessionKey`),
|
|
95
|
+
* so the orchestration/planner-proxy Lambda is a recipient in
|
|
96
|
+
* `Session.encryptedKeys` (can decrypt encProposal/verdict) AND the local
|
|
97
|
+
* key cache is warm. Stage-1 FIX 1 — replaces the prior crypto-dropping
|
|
98
|
+
* `createSession` reimplementation that hung the loop ("no session key").
|
|
99
|
+
* Falls back to `buildStubSession()` when unauthenticated / offline / on any
|
|
100
|
+
* error — the stub-session guards downstream keep that path fully usable.
|
|
101
|
+
*
|
|
102
|
+
* The tier is resolved here too (§3.C.19): a `CODEVIBE_TIER` env override wins
|
|
103
|
+
* (the dev/dogfood lever), else `getSubscriptionStatus`, else FREE (fail-closed
|
|
104
|
+
* — Orchestration Mode is never surfaced to Free).
|
|
105
|
+
*/
|
|
106
|
+
export declare function resumeOrCreateSession(appsyncClient: AppSyncClient, deps?: {
|
|
107
|
+
resolveSessionIdFn?: (client: AppSyncClient) => Promise<string | null>;
|
|
108
|
+
}): Promise<{
|
|
109
|
+
session: Session;
|
|
110
|
+
tier: Tier;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* CP-8 Slice C (#570) — parse a top-level `audit show <task-id> [--json]
|
|
114
|
+
* [--session <id>]` subcommand from the raw argv. Returns null when the argv is
|
|
115
|
+
* NOT an audit subcommand (so `main` falls through to mode selection). Detected
|
|
116
|
+
* BEFORE the mode parse so `audit` isn't swallowed as a passthrough arg.
|
|
117
|
+
*/
|
|
118
|
+
export interface ParsedAuditArgs {
|
|
119
|
+
taskId: string;
|
|
120
|
+
json: boolean;
|
|
121
|
+
/** Explicit session override; when absent the runner resolves the active session. */
|
|
122
|
+
sessionId?: string;
|
|
123
|
+
}
|
|
124
|
+
export declare function parseAuditArgs(argv: string[]): ParsedAuditArgs | null;
|
|
125
|
+
export interface ParsedModelArgs {
|
|
126
|
+
command: LocalModelCommand | 'help';
|
|
127
|
+
viaWithLocalModelFlag: boolean;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Parse local-model meta commands before mode selection. These commands must
|
|
131
|
+
* not be swallowed as Companion passthrough args, because the entitlement gate
|
|
132
|
+
* has to run before any model download, warmup, or health check can start.
|
|
133
|
+
*/
|
|
134
|
+
export declare function parseModelArgs(argv: string[]): ParsedModelArgs | null;
|
|
135
|
+
export declare function runModelCli(parsed: ParsedModelArgs, deps?: {
|
|
136
|
+
appsyncClient?: AppSyncClient;
|
|
137
|
+
resolveEntitlement?: () => Promise<LocalModelEntitlement>;
|
|
138
|
+
stdout?: (s: string) => void;
|
|
139
|
+
stderr?: (s: string) => void;
|
|
140
|
+
}): Promise<number>;
|
|
141
|
+
export interface LocalModelBootDecision {
|
|
142
|
+
mode: Mode;
|
|
143
|
+
notice: string | null;
|
|
144
|
+
}
|
|
145
|
+
export declare function resolveLocalModelBoot(args: {
|
|
146
|
+
requestedMode: Mode;
|
|
147
|
+
entitlement: LocalModelEntitlement;
|
|
148
|
+
state: LocalModelState;
|
|
149
|
+
}): LocalModelBootDecision;
|
|
150
|
+
export interface LocalGemmaPlannerBuildResult {
|
|
151
|
+
adapter: PlannerAdapter;
|
|
152
|
+
advisoryRunner: LocalGemmaAdvisoryRunner | null;
|
|
153
|
+
/**
|
|
154
|
+
* REVIEWER-VERDICT-GEMMA-CLASSIFIER-DESIGN.md (§Wiring) — the SAME resolved
|
|
155
|
+
* Gemma runner instance as {@link advisoryRunner} (both `null` on the unavailable
|
|
156
|
+
* path), exposed with the wider `LocalGemmaPlannerRunner` type (it carries
|
|
157
|
+
* `classify`, which the verdict classifier needs; `advisoryRunner` keeps the
|
|
158
|
+
* stricter `LocalGemmaAdvisoryRunner` type its consumer requires). One instance ⇒
|
|
159
|
+
* a SINGLE availability source for both the planner and the verdict classifier —
|
|
160
|
+
* they can never disagree about whether Gemma is up.
|
|
161
|
+
*/
|
|
162
|
+
classifyRunner: LocalGemmaPlannerRunner | null;
|
|
163
|
+
runtimeKind: NonNullable<RunOrchestrationShellArgs['plannerRuntimeKind']>;
|
|
164
|
+
/**
|
|
165
|
+
* TUI redesign (2026-06-29) — display label for the status-bar planner badge
|
|
166
|
+
* (model name, tag-stripped, e.g. `gemma4`). Derived even on the unavailable
|
|
167
|
+
* path so the degraded badge can still name the intended model.
|
|
168
|
+
*/
|
|
169
|
+
runtimeLabel: string;
|
|
170
|
+
reason: string | null;
|
|
171
|
+
}
|
|
172
|
+
export declare function buildLocalGemmaPlannerAdapter(args: {
|
|
173
|
+
state: LocalModelState;
|
|
174
|
+
config?: LocalModelArtifactConfig;
|
|
175
|
+
store?: LocalModelStore;
|
|
176
|
+
env?: NodeJS.ProcessEnv;
|
|
177
|
+
}): Promise<LocalGemmaPlannerBuildResult>;
|
|
178
|
+
/**
|
|
179
|
+
* CP-8 Slice C (#570) — the meta-CLI `codevibe audit show <task-id> [--json]`
|
|
180
|
+
* entrypoint. Authenticates the AppSync client (mirrors the `main()` auth
|
|
181
|
+
* wiring), resolves the task's session id (explicit `--session` OR the most
|
|
182
|
+
* recent ACTIVE session), runs the Max-gated browser, and prints either the
|
|
183
|
+
* JSON model (`--json`) or a readable newest-first timeline (default).
|
|
184
|
+
*
|
|
185
|
+
* Returns a process exit code (0 = printed something the user expects; 2 =
|
|
186
|
+
* usage error). The Max interstitial + error empty-state are NOT failures —
|
|
187
|
+
* they print and return 0.
|
|
188
|
+
*
|
|
189
|
+
* Exported for unit tests; production goes through `main()`.
|
|
190
|
+
*/
|
|
191
|
+
export declare function runAuditCli(parsed: ParsedAuditArgs, deps?: {
|
|
192
|
+
appsyncClient?: AppSyncClient;
|
|
193
|
+
/** Test seam — overrides the active-session resolution. */
|
|
194
|
+
resolveSessionIdFn?: (client: AppSyncClient) => Promise<string | null>;
|
|
195
|
+
stdout?: (s: string) => void;
|
|
196
|
+
stderr?: (s: string) => void;
|
|
197
|
+
}): Promise<number>;
|
|
61
198
|
export declare function main(argv: string[]): Promise<number>;
|
|
62
199
|
/**
|
|
63
200
|
* CP-1.b IMPL r4 H-1 — Production planner stack factory.
|
|
@@ -78,6 +215,204 @@ export declare function buildProductionPlannerStack(appsyncClient: AppSyncClient
|
|
|
78
215
|
cache: PlannerCacheLayer;
|
|
79
216
|
health: PlannerHealthMachine;
|
|
80
217
|
};
|
|
218
|
+
export interface BuildTeamLocalExecutorResult {
|
|
219
|
+
localExecutor: LocalExecutor;
|
|
220
|
+
teamShellEventTap: {
|
|
221
|
+
fn: (args: TeamTapEvent) => void;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* CP-1.f §3.C — the reviewer-quorum loop driver, constructed alongside the LE
|
|
225
|
+
* and wired into the LE's Class B consumer (real Ed25519 verify +
|
|
226
|
+
* REVIEWER_DISPATCH spawnReviewers + REVISE_FEEDBACK runReviseRound).
|
|
227
|
+
* `runOrchestrationShell` threads it for start_task START + reconnect recovery.
|
|
228
|
+
*/
|
|
229
|
+
quorumLoop: QuorumLoop;
|
|
230
|
+
/**
|
|
231
|
+
* CP-1.f live progress surfacing — the progress tap holder (see
|
|
232
|
+
* `BuildQuorumLoopExecutorResult.progressTap`).
|
|
233
|
+
*/
|
|
234
|
+
progressTap: ProgressTap;
|
|
235
|
+
/**
|
|
236
|
+
* Audited-path fix (Fix 1) — the PolicyRejection tap holder (see
|
|
237
|
+
* `BuildQuorumLoopExecutorResult.policyRejectionTap`).
|
|
238
|
+
*/
|
|
239
|
+
policyRejectionTap: PolicyRejectionTap;
|
|
240
|
+
/**
|
|
241
|
+
* PHASE-589/469 W3.2 — the two-phase group-escalation decision deps (WITHOUT
|
|
242
|
+
* the store; `runOrchestrationShell` completes it). Threaded into
|
|
243
|
+
* `gateDecisionDeps.groupDecision` so a synthesized `task_group_halted`
|
|
244
|
+
* 5-option prompt resolves through `submitGroupDecision`.
|
|
245
|
+
*/
|
|
246
|
+
groupDecisionDeps: Omit<GroupDecisionSubmitDeps, 'store'>;
|
|
247
|
+
/**
|
|
248
|
+
* PHASE-589/469 W3.1 (C4) — the startup reconcile-before-GC over the durable
|
|
249
|
+
* revert manifests. `runOrchestrationShell` awaits it ONCE at team-wiring
|
|
250
|
+
* startup, BEFORE the live Class B loop consumes packets.
|
|
251
|
+
*/
|
|
252
|
+
reconcileRevertManifests: () => Promise<void>;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* CP-1.f live progress surfacing — the desktop-local progress tap holder
|
|
256
|
+
* (mirrors `teamShellEventTap`). `cli.ts` builds it with a no-op `fn`; the
|
|
257
|
+
* QuorumLoop's `onProgress` calls `progressTap.fn(event)`, and
|
|
258
|
+
* `runOrchestrationShell` installs the store-dispatching `fn` at startup. Until
|
|
259
|
+
* then (and for non-loop sessions) the `fn` is inert. The loop also wraps every
|
|
260
|
+
* emit so a throwing `fn` can never break the loop.
|
|
261
|
+
*/
|
|
262
|
+
export interface ProgressTap {
|
|
263
|
+
fn: (event: TaskProgressEvent) => void;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Audited-path fix (Fix 1) — the PolicyRejection tap holder (mirrors
|
|
267
|
+
* `progressTap`). `cli.ts` builds it with a no-op `fn`; the LE's
|
|
268
|
+
* `onPolicyRejection` dep calls `policyRejectionTap.fn(info)`, and
|
|
269
|
+
* `runOrchestrationShell` installs the store-dispatching `fn` (a classified
|
|
270
|
+
* `SHELL_ADVISORY`) at startup. Until then (and for non-loop sessions) the `fn`
|
|
271
|
+
* is inert. The shadow-discard side is handled inside `cli.ts`'s wiring (it has
|
|
272
|
+
* the QuorumLoop reference); this tap carries ONLY the user-visible advisory.
|
|
273
|
+
*/
|
|
274
|
+
export interface PolicyRejectionTap {
|
|
275
|
+
fn: (info: {
|
|
276
|
+
detail: string;
|
|
277
|
+
category: string;
|
|
278
|
+
recommendedRecovery: string;
|
|
279
|
+
}) => void;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* [Gemma classifier · D11 + §Wiring] Resolve the reviewer verdict classifier
|
|
283
|
+
* threaded onto `QuorumLoopDeps.classifyVerdict`.
|
|
284
|
+
*
|
|
285
|
+
* - `classifyRunner === undefined` → the classifier is NOT wired (unit tests /
|
|
286
|
+
* the canned-prompt legacy paths the design leaves on regex) → `undefined`
|
|
287
|
+
* (the provider uses `parseVerdictOutput`). Production ALWAYS wires it (a
|
|
288
|
+
* `LocalGemmaPlannerRunner | null`), so this branch never fires in production.
|
|
289
|
+
* - `CODEVIBE_REVIEWER_VERDICT_CLASSIFIER=regex` → `undefined` (the ONLY operator
|
|
290
|
+
* revert to the regex parser). Any other value (incl. a typo) stays `gemma` so
|
|
291
|
+
* a mistyped flag can NEVER silently disable the fail-closed classifier.
|
|
292
|
+
* - `gemma` (default) → the real fail-closed Gemma classifier when the runner is
|
|
293
|
+
* present; a dummy always-ESCALATE classifier when it is `null` (Ollama
|
|
294
|
+
* unreachable at boot) — NEVER a silent regex fallback (agy-MED-1).
|
|
295
|
+
*/
|
|
296
|
+
export declare function resolveVerdictClassifier(classifyRunner: LocalGemmaPlannerRunner | null | undefined, env?: NodeJS.ProcessEnv): VerdictClassifier | undefined;
|
|
297
|
+
export interface BuildQuorumLoopExecutorResult {
|
|
298
|
+
localExecutor: LocalExecutor;
|
|
299
|
+
quorumLoop: QuorumLoop;
|
|
300
|
+
/**
|
|
301
|
+
* CP-1.f live progress surfacing — the progress tap holder. `cli.ts` threads
|
|
302
|
+
* it into `runOrchestrationShell`, which installs the store-dispatching `fn`.
|
|
303
|
+
*/
|
|
304
|
+
progressTap: ProgressTap;
|
|
305
|
+
/**
|
|
306
|
+
* Audited-path fix (Fix 1) — the PolicyRejection tap holder. `cli.ts` threads
|
|
307
|
+
* it into `runOrchestrationShell`, which installs the store-dispatching `fn`
|
|
308
|
+
* (a classified `SHELL_ADVISORY`).
|
|
309
|
+
*/
|
|
310
|
+
policyRejectionTap: PolicyRejectionTap;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* CP-1.f §3.C — Stage-2 r2 (Codex) FIX B. Construct the SINGLE-TASK QuorumLoop +
|
|
314
|
+
* its driving LE for a non-team orchestration session (Pro OR Max-without-teams).
|
|
315
|
+
*
|
|
316
|
+
* The single-implementor reviewer-quorum loop is a Pro+Max feature (Pro = 2
|
|
317
|
+
* seats, Max = 3 seats per `codevibe-policy`); only Agent Teams / MergeGate
|
|
318
|
+
* (CP-12) is Max-only. Before this fix the QuorumLoop was built ONLY inside
|
|
319
|
+
* `buildTeamLocalExecutor` (gated on `tier === 'MAX'`), so a real Pro
|
|
320
|
+
* orchestration session got NO loop → `start_task` silently no-op'd (the only
|
|
321
|
+
* `start_task` execution branch requires `args.quorumLoop`).
|
|
322
|
+
*
|
|
323
|
+
* The LE here is a MINIMAL single-track LE — it OMITS every team dep
|
|
324
|
+
* (`spawnTrackImplementor` / `buildTrackArgv` / `appsyncClient` / `repoRoot` /
|
|
325
|
+
* `deviceSigningKey` / `teamSessionKeyB64` / …), so `teamModeEnabled` is FALSE
|
|
326
|
+
* (a teams Class B packet is dropped, not acted on). It KEEPS the 4
|
|
327
|
+
* reviewer-quorum consumer deps (so the loop receives GATE_DISPATCH /
|
|
328
|
+
* REVIEWER_DISPATCH / REVISE_FEEDBACK) + the substrate engager (so the
|
|
329
|
+
* implementor still spawns inside the CP-7 moat). The shell wires the returned
|
|
330
|
+
* `localExecutor` for the Class B subscription + `quorumLoop` for start_task +
|
|
331
|
+
* reconnect recovery, EXACTLY as the team path does.
|
|
332
|
+
*
|
|
333
|
+
* Exported for unit tests; production goes through `main()`.
|
|
334
|
+
*/
|
|
335
|
+
export declare function buildQuorumLoopExecutor(args: {
|
|
336
|
+
appsyncClient: AppSyncClient;
|
|
337
|
+
session: Session;
|
|
338
|
+
emitter: (args: ShellEventEmit) => Promise<void>;
|
|
339
|
+
/** CP-1.f LOCK RP-6 — host-detected agents threaded into the loop. */
|
|
340
|
+
detectedAgents?: string[];
|
|
341
|
+
/** #585 auto-continuation (Max) — the resolved tier, threaded to the loop. */
|
|
342
|
+
tier?: Tier;
|
|
343
|
+
/**
|
|
344
|
+
* [Gemma classifier · §Wiring] The resolved Gemma runner (same instance as the
|
|
345
|
+
* planner's), forwarded to `buildAndArmQuorumLoop` where the verdict classifier is
|
|
346
|
+
* built. ABSENT (tests) → the classifier is not wired → regex parser.
|
|
347
|
+
*/
|
|
348
|
+
classifyRunner?: LocalGemmaPlannerRunner | null;
|
|
349
|
+
}): Promise<BuildQuorumLoopExecutorResult>;
|
|
350
|
+
/**
|
|
351
|
+
* PHASE-589+469 W2 (#TC-5) — map an LE hook-bridge event to the chokepoint's
|
|
352
|
+
* `ShellEventEmit`. The team-result summary (`ASSISTANT_RESPONSE`, from
|
|
353
|
+
* `emitGroupConvergence`) KEEPS its type AND forwards `content` (the
|
|
354
|
+
* light-markdown digest the phone renders); `LOCAL_AUTHORITY_REFUSAL` maps 1:1;
|
|
355
|
+
* every other type is coerced to `NOTIFICATION` (audit fallback — those never
|
|
356
|
+
* occur on the team paths). Exported so the #TC-5 test drives the REAL mapping
|
|
357
|
+
* (not a reproduction): a regression that dropped the `ASSISTANT_RESPONSE` type
|
|
358
|
+
* or its `content` — which would silently make the mobile summary dead — is
|
|
359
|
+
* caught here.
|
|
360
|
+
*/
|
|
361
|
+
export declare function mapTeamLeEventToShellEmit(e: Parameters<LEEmitShellEventFn>[0]): ShellEventEmit;
|
|
362
|
+
/**
|
|
363
|
+
* Construct the team-mode LocalExecutorImpl + the store-tap holder. Returns the
|
|
364
|
+
* pair `runOrchestrationShell` consumes (`localExecutor` + `teamShellEventTap`).
|
|
365
|
+
*
|
|
366
|
+
* Exported for the W3 E2E smoke (which injects stub deps) + future callers;
|
|
367
|
+
* production goes through `main()`.
|
|
368
|
+
*/
|
|
369
|
+
export declare function buildTeamLocalExecutor(args: {
|
|
370
|
+
appsyncClient: AppSyncClient;
|
|
371
|
+
session: Session;
|
|
372
|
+
emitter: (args: ShellEventEmit) => Promise<void>;
|
|
373
|
+
initialScope: AuthorityScope;
|
|
374
|
+
/** CP-1.f LOCK RP-6 — host-detected agents threaded into the loop. */
|
|
375
|
+
detectedAgents?: string[];
|
|
376
|
+
/** #585 auto-continuation (Max) — the resolved tier, threaded to the loop. */
|
|
377
|
+
tier?: Tier;
|
|
378
|
+
/**
|
|
379
|
+
* TEST SEAM — override the durable revert-manifest store root. Production omits it
|
|
380
|
+
* (defaults to the shared `~/.codevibe/revert-state/`). Tests pass an ISOLATED temp
|
|
381
|
+
* dir so the CLAIM→revert→COMMIT flow can't be contaminated by another test's
|
|
382
|
+
* leftover manifest/journal in the shared root (which stranded the COMMIT phase →
|
|
383
|
+
* `['claim']` in the full suite while passing in isolation), and so a sandboxed
|
|
384
|
+
* runner that can't write `~/.codevibe` doesn't EPERM.
|
|
385
|
+
*/
|
|
386
|
+
durableRootDir?: string;
|
|
387
|
+
/**
|
|
388
|
+
* [Gemma classifier · §Wiring] The resolved Gemma runner (same instance as the
|
|
389
|
+
* planner's), forwarded to `buildAndArmQuorumLoop` where the verdict classifier is
|
|
390
|
+
* built. ABSENT (tests) → the classifier is not wired → regex parser.
|
|
391
|
+
*/
|
|
392
|
+
classifyRunner?: LocalGemmaPlannerRunner | null;
|
|
393
|
+
}): Promise<BuildTeamLocalExecutorResult>;
|
|
394
|
+
/**
|
|
395
|
+
* PHASE-589/469 W3.1 (C4 / RESIDUAL 2) — probe the engine's TERMINAL view of a
|
|
396
|
+
* team group for the startup reconcile, via the `getTaskGroupStatus` query (the
|
|
397
|
+
* group row's authoritative `status` + `halt_reason`). This is what closes the
|
|
398
|
+
* OFFLINE lease-timeout case: a group the sweeper drove `Halted` while the desktop
|
|
399
|
+
* was down now resolves to `terminal_rejected` here → the reconcile auto-reverts
|
|
400
|
+
* the applied tree before a backend expiry could strand it dirty.
|
|
401
|
+
*
|
|
402
|
+
* - `halted` → `'terminal_rejected'` (revert)
|
|
403
|
+
* - `complete` → `'terminal_kept'` (mark accepted)
|
|
404
|
+
* - any non-terminal status (scheduling / → `'in_flight'` (leave the
|
|
405
|
+
* tracks_in_flight / draining / manifest)
|
|
406
|
+
* merge_gate_pending)
|
|
407
|
+
* - `unknown` (vanished / unowned / TTL'd) → `'unknown'` (orphan-TTL
|
|
408
|
+
* OR a probe error fallback GC)
|
|
409
|
+
*
|
|
410
|
+
* Fail-open on a probe error → `'unknown'` (the manifest is kept for the orphan-TTL
|
|
411
|
+
* fallback rather than blindly reverting a possibly-kept group). A
|
|
412
|
+
* `reject_revert_in_progress` CLAIM-crash manifest is NEVER GC'd regardless (its
|
|
413
|
+
* lifecycle is non-terminal), so it survives every restart and resumes its revert.
|
|
414
|
+
*/
|
|
415
|
+
export declare function probeEngineGroupState(appsyncClient: AppSyncClient, taskGroupId: string): Promise<EngineGroupState>;
|
|
81
416
|
import { HookBridge } from '../local-executor/hook-bridge';
|
|
82
417
|
export interface BridgeRefusalArgs {
|
|
83
418
|
refusedMessageId: string;
|