@gitroll/tacitt-cli 0.6.4 → 0.6.6

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/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ PROPRIETARY SOFTWARE — ALL RIGHTS RESERVED
2
+
3
+ This repository is not licensed as open-source software. Except for permissions
4
+ expressly granted by the applicable rights holders in a separate written agreement,
5
+ no permission is granted to use, copy, modify, distribute, sublicense, or sell this
6
+ software or substantial portions of it. Public access to source code does not itself
7
+ grant such permission. Rights provided by applicable law or the hosting platform's
8
+ terms are not limited by this notice.
9
+
10
+ Third-party components remain subject to their respective licenses and notices.
11
+ This notice does not replace or restrict permissions granted by those licenses.
package/README.md CHANGED
@@ -1,85 +1,42 @@
1
1
  # Tacitt CLI
2
2
 
3
- Local session review and export through the public npm package. Requires Node.js
4
- `>=24.19.0 <25`, npm and connectivity to the npm registry. Consumers do not need npm
3
+ Local session review, privacy decisions and reviewed export/Send for coding agents.
4
+ Requires Node.js `>=24.19.0 <25` and npm. Package acquisition does not need an npm
5
5
  login or organization membership.
6
6
 
7
- This release integrates B privacy analysis with the native Ray review journey and
8
- configured v5 export, published on both `latest` and `next`. Before any reading, the
9
- agent groups sessions into Works by repository (linked worktrees fold into their
10
- repository) named after the project, proposes a project type for each Work and lets
11
- you leave whole types out; Dropped Works are not read. Older cached credentials
12
- require a fresh Identity sign-in.
13
-
14
- This release uses storage schema 20, Journey format 8 and review contract 5. State
15
- from older previews, including 0.2.0, rc.1 and the b candidates, is preserved and is not
16
- automatically migrated or imported; use a fresh, separate state directory for a
17
- new review and retain the pinned CLI for older tasks. Installing or updating the
18
- Skill does not reset task state. Resetting control state does not erase private
19
- review payload files: their bodies remain locally readable, and a fresh store
20
- does not discover or import them.
21
-
22
- Windows verification remains partly advisory: some automated account and lifecycle
23
- checks still time out. Prefer macOS or Linux.
24
-
25
- Start the Manual static browser journey:
26
-
27
- ```sh
28
- npx --yes @gitroll/tacitt-cli@latest
29
- ```
30
-
31
- Install or deliberately update both Codex and Claude user Skills:
32
-
33
7
  ```sh
34
8
  npx --yes @gitroll/tacitt-cli@latest skill.install
35
9
  ```
36
10
 
37
- Add `--agent codex` or `--agent claude` to select a client. Add `--scope project`
38
- from a workspace to install there instead. After installation, the terminal shows
39
- the next step: enter `$tacitt` in a fresh Codex conversation or `/tacitt`
40
- in Claude Code. The Skill prepares its exact matching CLI
41
- through npx; no global Tacitt CLI installation is necessary. Existing loaded tasks
42
- keep that release; a later deliberate install affects new invocations. Retain the
43
- recorded exact invocation when resuming a previous task after an agent restart.
11
+ Then use `$tacitt` in a fresh Codex conversation or `/tacitt` in Claude Code.
12
+ Select one client with `--agent codex` or `--agent claude`; use `--scope project`
13
+ for a workspace-local installation. The installer pairs the Skill with this exact
14
+ CLI version, preserves verified previous release assets for existing tasks, and
15
+ reports unmanaged-file collisions. Installation alone starts no scan and resets
16
+ no source logs, state or existing exports.
44
17
 
45
- The human hint uses stderr and only lists the installed clients. Stdout remains
46
- JSON; explicit `--input` keeps the machine interface without a hint. Installation
47
- itself starts no scan.
18
+ For the standalone Manual browser interface, run:
48
19
 
49
- The agent handles the conversation-led journey. One Allow in chat authorizes B review through the current App's model provider. The
50
- provider receives locally cleaned original text **before privacy masking**:
51
- complete main user and assistant text and retained tool results. Tool-call
52
- arguments, children, setup files and other source metadata receive static
53
- processing; images are not analyzed. Reading starts only after consent. Every decision is made in the
54
- conversation; the right panel is a read-only view of progress, Works, actual output
55
- previews and Send scope. Only official sign-in opens a browser page.
56
-
57
- Each direct category answer applies once. Certain/protected content stays hidden;
58
- delegated choices are attributed to the agent for the current run. Complete reading,
59
- verified ZIP preview and Work review precede Send; a ready subset requires explicit scope
60
- confirmation. Send uses official Identity, uploads the confirmed primary and
61
- follows its actual assessment into the owner's current Tacitt profile. Local export
62
- remains available before upload. The standalone Manual journey uses its existing
63
- static browser interface.
64
-
65
- You can limit a category answer to the current review. It remains your own choice
66
- without changing preferences saved for later runs. An established current-only
67
- limit survives later answers; ask explicitly to remember it for future runs.
68
-
69
- The CLI and installed Skill pin the same exact version for the entire journey.
70
- Local ZIP success does not establish deployment compatibility or a completed
71
- assessment. Verify the target service's v5 support before using Send. Codex and
72
- Claude native App acceptance are separate checks; success in one does not verify
73
- the other. Local-only requests stop before Identity sign-in or upload.
74
-
75
- Updates only replace verified managed Skill files and preserve prior release
76
- references. Unmanaged or edited Skill collisions are reported for explicit review;
77
- state, dictionaries, source logs and existing ZIPs are not reset by installation.
78
- Package acquisition, network or version-verification failures stop setup before
79
- dependent session work.
80
-
81
- Bundled Web dependency notices are included in
82
- `dist/web/THIRD_PARTY_LICENSES.md`. Tacitt CLI's own package license metadata remains
83
- `UNLICENSED`.
20
+ ```sh
21
+ npx --yes @gitroll/tacitt-cli@latest
22
+ ```
84
23
 
85
- Source, requirements and release evidence: [gitroll-dev/tacitt-cli](https://github.com/gitroll-dev/tacitt-cli).
24
+ The native Skill presents decisions in a focused panel. Source consent precedes
25
+ classification and privacy analysis. The current model provider receives frozen
26
+ original main conversations and retained tool results before privacy masking;
27
+ this workflow is not local-only. Send separately authorizes packaging/upload of
28
+ the selected reviewed material to the signed-in Tacitt account. Use Manual for
29
+ standalone local export. Keep session data and panel capability URLs private.
30
+
31
+ State from incompatible previews is not silently migrated. Keep the pinned CLI
32
+ for old tasks and use a separate state directory when required; installing the
33
+ Skill does not erase private payload files or import them into a fresh store.
34
+ Windows verification remains partly advisory; prefer macOS or Linux and review
35
+ reported platform limitations.
36
+
37
+ Tacitt retains `UNLICENSED` package metadata. Bundled Web dependency notices are
38
+ in `dist/web/THIRD_PARTY_LICENSES.md`. Source and current guidance are maintained
39
+ at [gitroll-dev/tacitt-cli](https://github.com/gitroll-dev/tacitt-cli). The
40
+ repository contains proprietary source; public visibility does not grant an
41
+ open-source license. Refer to the repository [LICENSE](https://github.com/gitroll-dev/tacitt-cli/blob/main/LICENSE) and any separate permission
42
+ from the rights holders.
@@ -1,5 +1,5 @@
1
- import "./locate-CNU4z9G1.mjs";
2
- import "./src-DmSIVU7-.mjs";
1
+ import "./locate-BWkblijS.mjs";
2
+ import "./src-d7n58sbH.mjs";
3
3
  import { z } from "zod";
4
4
  import { Worker } from "node:worker_threads";
5
5
  //#region apps/cli/src/agent-setup/index.ts
@@ -1,8 +1,8 @@
1
- import { J as listAgentSetup } from "./src-BRwicVza.mjs";
2
- import { Dn as createStaticProcessor, dn as workspaceSchema, ln as sessionSchema } from "./locate-CNU4z9G1.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-BgoSvnXe.mjs";
4
- import { fi as effectiveTreatmentSchema, ot as maximumAgentSetupSessions } from "./src-DmSIVU7-.mjs";
5
- import "./agent-setup-C7iqLMYm.mjs";
1
+ import { J as listAgentSetup } from "./src-p_uJNjV3.mjs";
2
+ import { Dn as createStaticProcessor, dn as workspaceSchema, ln as sessionSchema } from "./locate-BWkblijS.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-BBjnljUs.mjs";
4
+ import { fi as effectiveTreatmentSchema, ot as maximumAgentSetupSessions } from "./src-d7n58sbH.mjs";
5
+ import "./agent-setup-YlFIJz-h.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";
8
8
  //#region apps/cli/src/agent-setup/worker.ts
package/dist/cli.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { _ as permissionDiagnostic, a as readAgentPresence, d as guardDetachedStartup, f as createRenderActivity, g as longCommands, h as businessCommands, i as invoke, l as awaitingPassport, m as parseOptions, n as readOperation, o as createRuntime, p as helpText, r as waitOperation, s as executorEventSchema, t as cancelOperation, u as serveDetached, v as startupFailure, y as traceStartup } from "./query-BMvtisKu.mjs";
3
- import { nt as makePrivateDirectory, rt as openPrivateFile } from "./src-BRwicVza.mjs";
4
- import { A as createExecutionPort, j as startHost, k as readStateDump } from "./job-D4N5Pe91.mjs";
5
- import { $t as safeField, Qt as safeCode, Xt as ApplicationError } from "./locate-CNU4z9G1.mjs";
6
- import { $n as reviewTransportBytes, ci as stateSchema, ct as resolveFailureLocation, tt as readWorkspaceOutcomes } from "./src-DmSIVU7-.mjs";
7
- import { _t as isCoordinationBusy } from "./heap-DQbsSUrB.mjs";
2
+ import { _ as permissionDiagnostic, a as readAgentPresence, d as guardDetachedStartup, f as createRenderActivity, g as longCommands, h as businessCommands, i as invoke, l as awaitingPassport, m as parseOptions, n as readOperation, o as createRuntime, p as helpText, r as waitOperation, s as executorEventSchema, t as cancelOperation, u as serveDetached, v as startupFailure, y as traceStartup } from "./query-D2L1WzCS.mjs";
3
+ import { nt as makePrivateDirectory, rt as openPrivateFile } from "./src-p_uJNjV3.mjs";
4
+ import { A as createExecutionPort, I as inBackgroundStatusPoll, j as startHost, k as readStateDump } from "./job-DiewDY_E.mjs";
5
+ import { $t as safeField, Qt as safeCode, Xt as ApplicationError } from "./locate-BWkblijS.mjs";
6
+ import { $n as reviewTransportBytes, ci as stateSchema, ct as resolveFailureLocation, tt as readWorkspaceOutcomes } from "./src-d7n58sbH.mjs";
7
+ import { _t as isCoordinationBusy } from "./heap-DFHajqf2.mjs";
8
8
  import { constants, createReadStream, write } from "node:fs";
9
9
  import { z } from "zod";
10
10
  import { lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, writeFile } from "node:fs/promises";
@@ -305,9 +305,9 @@ async function serve(options, journeyId) {
305
305
  following = true;
306
306
  (async () => {
307
307
  const { journey: journeys, journeySend } = runtime.application;
308
- const journey = await journeys?.get({ journeyId });
308
+ const journey = await inBackgroundStatusPoll(async () => journeys?.get({ journeyId }));
309
309
  const ended = journey?.phase === "completed" || journey?.abandonedAt !== void 0;
310
- const send = (await journeys?.get({}))?.journeyId === journeyId ? (await journeySend?.get({ journeyId }))?.send : null;
310
+ const send = (await inBackgroundStatusPoll(async () => journeys?.get({})))?.journeyId === journeyId ? (await journeySend?.get({ journeyId }))?.send : null;
311
311
  const waiting = Boolean(send && awaitingPassport(send));
312
312
  const now = Date.now();
313
313
  endedAt = ended ? endedAt ?? now : void 0;
@@ -1,4 +1,4 @@
1
- import { i as errorCode } from "./model-CZeHzKif.mjs";
1
+ import { i as errorCode } from "./model-f_QnDyyb.mjs";
2
2
  import { a as titleHintLimits, i as encodeTitleError, o as titleInputSchema, t as assertTitleHeap } from "./heap-1FYhGds4.mjs";
3
3
  import { stat } from "node:fs/promises";
4
4
  import { isAbsolute, join } from "node:path";
@@ -1,8 +1,8 @@
1
- import { Y as createConfiguredPreviewStream } from "./src-BRwicVza.mjs";
2
- import { Dn as createStaticProcessor, dn as workspaceSchema, ln as sessionSchema } from "./locate-CNU4z9G1.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-BgoSvnXe.mjs";
4
- import { fi as effectiveTreatmentSchema } from "./src-DmSIVU7-.mjs";
5
- import { a as classifyRecord, n as assertPreviewHeap, t as runPreview } from "./run-u2EfHjz4.mjs";
1
+ import { Y as createConfiguredPreviewStream } from "./src-p_uJNjV3.mjs";
2
+ import { Dn as createStaticProcessor, dn as workspaceSchema, ln as sessionSchema } from "./locate-BWkblijS.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-BBjnljUs.mjs";
4
+ import { fi as effectiveTreatmentSchema } from "./src-d7n58sbH.mjs";
5
+ import { a as classifyRecord, n as assertPreviewHeap, t as runPreview } from "./run-RA_8zZsL.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";
8
8
  //#region apps/cli/src/preview/run.ts
@@ -1,8 +1,8 @@
1
- import { et as safeError, h as captureConfiguredSessionJob, j as runConfiguredSessionJob, u as runConfiguredScanJob, z as gitSeedsProvider } from "./src-BRwicVza.mjs";
2
- import { d as runJourneyBaseJob, i as runJourneyOutputVerifyJob, n as runJourneyOutputJob, r as runJourneyOutputShardJob } from "./job-D4N5Pe91.mjs";
3
- import { Dn as createStaticProcessor, Qt as safeCode } from "./locate-CNU4z9G1.mjs";
4
- import { l as createNativeAdapters } from "./src-BgoSvnXe.mjs";
5
- import "./src-DmSIVU7-.mjs";
1
+ import { et as safeError, h as captureConfiguredSessionJob, j as runConfiguredSessionJob, u as runConfiguredScanJob, z as gitSeedsProvider } from "./src-p_uJNjV3.mjs";
2
+ import { d as runJourneyBaseJob, i as runJourneyOutputVerifyJob, n as runJourneyOutputJob, r as runJourneyOutputShardJob } from "./job-DiewDY_E.mjs";
3
+ import { Dn as createStaticProcessor, Qt as safeCode } from "./locate-BWkblijS.mjs";
4
+ import { l as createNativeAdapters } from "./src-BBjnljUs.mjs";
5
+ import "./src-d7n58sbH.mjs";
6
6
  import { parentPort } from "node:worker_threads";
7
7
  //#region apps/cli/src/configured-session-worker.ts
8
8
  const port = parentPort;
@@ -1,4 +1,4 @@
1
- import { ur as ProcessingError } from "./locate-CNU4z9G1.mjs";
1
+ import { ur as ProcessingError } from "./locate-BWkblijS.mjs";
2
2
  //#region packages/processing/src/compression/frame.ts
3
3
  function createZstdFrameCheck(fail = () => {
4
4
  throw new ProcessingError("PROCESSING_INVALID_RECORD");
@@ -1,14 +1,14 @@
1
- import { S as readPrivateReviewPayload, at as windowsOwnerOnly, it as restrictToOwner, rt as openPrivateFile, tt as exclusiveLock, x as writePrivateReviewPayload } from "./src-BRwicVza.mjs";
2
- import { At as journeyTermSchema, It as termTypeSchema, Mt as reviewTermsResultSchema, Xt as ApplicationError, _ as semanticFindingSchema, b as validateBReview, c as textDigest, d as reviewAlignmentAudit, dt as nativeJourneySchema, er as isStaticCategory, ft as journeyGuidanceSchema, g as validateReviewAlignment, gt as journeyWorkSuggestionSchema, ht as journeyDescribeSchema, i as reviewBatchSchema, it as journeyDigestSchema, jt as reviewTermsInputSchema, kt as privacyTermSchema, l as validateReview, m as reviewAlignmentSchema, nn as reviewFamilies, o as reviewDigest, ot as journeyIdSchema, r as reviewBatchChunks, s as reviewSubmitSchema, sn as fileIdentitySchema, tn as familySelected, tr as staticCategories, u as findingReferenceKey, v as bContextEvidence, wn as createDetectionSummary } from "./locate-CNU4z9G1.mjs";
3
- import { $t as projectPreparationProgress, Bn as confirmedHideTerms, Cn as confirmedHideDeltaSchema, Cr as applyCardAnswers, En as settleConfirmedHides, Et as settleCorrections, Ft as journeyBatchReadSchema, G as validateInspectionClaim, Gn as retireWorkDescription, Gr as isReadingComplete, Gt as journeyContextSchema, H as validateInspectionBatches, Ht as newJourneyWork, Ir as journeySendSchema, It as journeyReviewStorageQuerySchema, J as validateInspectionInputs, Jr as selectedWorks, Jt as hidePublishSchema, K as validateInspectionFence, Kn as workDecisionDigest, Kr as isSelectedWork, Kt as hideBeginSchema, Ln as confirmedHideGroupIds, Lt as applyClassificationProposal, Mt as validateAttemptAppend, Nt as journeyGuidance, Ot as obsoleteJourney, Pn as bMaskedHits, Q as inspectionInputs, Qn as reviewRepairResourceSchema, Qt as journeyPolicyRespondSchema, Rn as confirmedHideKey, Rt as classificationCommitSchema, Un as maskedHitsStale, V as validateInspectionBatch, Vn as dictionaryHides, Wn as syncTermGroups, Wt as journeyContextQuerySchema, X as validateInspectionContribution, Xn as reviewCandidateResourceSchema, Xr as mergePrivacyTerms, Xt as journeySearchSaveSchema, Y as validateInspectionQuery, Yr as withReadingProgress, Yt as journeySearchResultSchema, Z as validateDetectionSummary, Zt as searchScopeDigest, _n as sessionUsefulnessInputSchema, an as reviewAttemptResourceSchema, bn as journeyCommitSchema, br as preparationStartSchema, c as reconstructBFields, ci as stateSchema, d as resolveGroupSplit, dr as validateScanExclusion, dt as manualUploadBindingSchema, en as journeyResourceQuerySchema, er as bReviewDigest, fn as sessionRereadResourceSchema, g as semanticGroupKey, gn as sessionReviewStatusSchema, gr as journeyPreparationProgressSchema, gt as candidateSortAvailable, h as hideScopeDigest, hn as sessionReviewResourceSchema, hr as journeyInventorySchema, in as sortingApplySchema, ir as scanCanonicalResourceSchema, jr as staticSessionId, jt as attemptBudgetCodePoints, l as chooseCheapPlacement, ln as sessionReconcileResultSchema, mn as sessionReviewQuerySchema, mr as journeyInventoryReadSchema, mt as manualUploadSchema, nn as journeyIsolateSchema, o as bRereadDigest, on as reviewAttemptsQuerySchema, or as scanSessionResourceSchema, q as validateInspectionHead, qn as workPrivacyDecisions, qr as isSkippedWork, qt as hideFinishSchema, rn as journeyPlaceSchema, rr as scanAliasResourceSchema, s as reconcileBSession, sn as reviewAttemptsResultSchema, sr as scanGitSeedsId, t as scanBatchContextDigest, tn as journeyResourceSchema, tr as mergeBRepair, u as reviseGroupMembership, un as sessionReconciliationResourceSchema, v as projectJourneyInventory, vn as sessionUsefulnessResourceSchema, vr as preparationBeginSchema, x as bReviewScope, xn as journeyEventSchema, xr as validatePreparationFacts, y as preparationScope, yn as journeyCommitResultSchema, yr as preparationSettlementSchema } from "./src-DmSIVU7-.mjs";
1
+ import { S as readPrivateReviewPayload, at as windowsOwnerOnly, it as restrictToOwner, rt as openPrivateFile, tt as exclusiveLock, x as writePrivateReviewPayload } from "./src-p_uJNjV3.mjs";
2
+ import { At as journeyTermSchema, It as termTypeSchema, Mt as reviewTermsResultSchema, Xt as ApplicationError, _ as semanticFindingSchema, b as validateBReview, c as textDigest, d as reviewAlignmentAudit, dt as nativeJourneySchema, er as isStaticCategory, ft as journeyGuidanceSchema, g as validateReviewAlignment, gt as journeyWorkSuggestionSchema, ht as journeyDescribeSchema, i as reviewBatchSchema, it as journeyDigestSchema, jt as reviewTermsInputSchema, kt as privacyTermSchema, l as validateReview, m as reviewAlignmentSchema, nn as reviewFamilies, o as reviewDigest, ot as journeyIdSchema, r as reviewBatchChunks, s as reviewSubmitSchema, sn as fileIdentitySchema, tn as familySelected, tr as staticCategories, u as findingReferenceKey, v as bContextEvidence, wn as createDetectionSummary } from "./locate-BWkblijS.mjs";
3
+ import { $t as projectPreparationProgress, Bn as confirmedHideTerms, Cn as confirmedHideDeltaSchema, Cr as applyCardAnswers, En as settleConfirmedHides, Et as settleCorrections, Ft as journeyBatchReadSchema, G as validateInspectionClaim, Gn as retireWorkDescription, Gr as isReadingComplete, Gt as journeyContextSchema, H as validateInspectionBatches, Ht as newJourneyWork, Ir as journeySendSchema, It as journeyReviewStorageQuerySchema, J as validateInspectionInputs, Jr as selectedWorks, Jt as hidePublishSchema, K as validateInspectionFence, Kn as workDecisionDigest, Kr as isSelectedWork, Kt as hideBeginSchema, Ln as confirmedHideGroupIds, Lt as applyClassificationProposal, Mt as validateAttemptAppend, Nt as journeyGuidance, Ot as obsoleteJourney, Pn as bMaskedHits, Q as inspectionInputs, Qn as reviewRepairResourceSchema, Qt as journeyPolicyRespondSchema, Rn as confirmedHideKey, Rt as classificationCommitSchema, Un as maskedHitsStale, V as validateInspectionBatch, Vn as dictionaryHides, Wn as syncTermGroups, Wt as journeyContextQuerySchema, X as validateInspectionContribution, Xn as reviewCandidateResourceSchema, Xr as mergePrivacyTerms, Xt as journeySearchSaveSchema, Y as validateInspectionQuery, Yr as withReadingProgress, Yt as journeySearchResultSchema, Z as validateDetectionSummary, Zt as searchScopeDigest, _n as sessionUsefulnessInputSchema, an as reviewAttemptResourceSchema, bn as journeyCommitSchema, br as preparationStartSchema, c as reconstructBFields, ci as stateSchema, d as resolveGroupSplit, dr as validateScanExclusion, dt as manualUploadBindingSchema, en as journeyResourceQuerySchema, er as bReviewDigest, fn as sessionRereadResourceSchema, g as semanticGroupKey, gn as sessionReviewStatusSchema, gr as journeyPreparationProgressSchema, gt as candidateSortAvailable, h as hideScopeDigest, hn as sessionReviewResourceSchema, hr as journeyInventorySchema, in as sortingApplySchema, ir as scanCanonicalResourceSchema, jr as staticSessionId, jt as attemptBudgetCodePoints, l as chooseCheapPlacement, ln as sessionReconcileResultSchema, mn as sessionReviewQuerySchema, mr as journeyInventoryReadSchema, mt as manualUploadSchema, nn as journeyIsolateSchema, o as bRereadDigest, on as reviewAttemptsQuerySchema, or as scanSessionResourceSchema, q as validateInspectionHead, qn as workPrivacyDecisions, qr as isSkippedWork, qt as hideFinishSchema, rn as journeyPlaceSchema, rr as scanAliasResourceSchema, s as reconcileBSession, sn as reviewAttemptsResultSchema, sr as scanGitSeedsId, t as scanBatchContextDigest, tn as journeyResourceSchema, tr as mergeBRepair, u as reviseGroupMembership, un as sessionReconciliationResourceSchema, v as projectJourneyInventory, vn as sessionUsefulnessResourceSchema, vr as preparationBeginSchema, x as bReviewScope, xn as journeyEventSchema, xr as validatePreparationFacts, y as preparationScope, yn as journeyCommitResultSchema, yr as preparationSettlementSchema } from "./src-d7n58sbH.mjs";
4
4
  import { constants } from "node:fs";
5
5
  import { z } from "zod";
6
6
  import { copyFile, link, lstat, mkdir, mkdtemp, open, readFile, realpath, rm, unlink } from "node:fs/promises";
7
7
  import { isAbsolute, join, resolve } from "node:path";
8
8
  import { isDeepStrictEqual } from "node:util";
9
9
  import { createHash, randomBytes, randomUUID } from "node:crypto";
10
- import { tmpdir } from "node:os";
11
10
  import { AsyncLocalStorage } from "node:async_hooks";
11
+ import { tmpdir } from "node:os";
12
12
  import { DatabaseSync } from "node:sqlite";
13
13
  import { getHeapStatistics, setFlagsFromString } from "node:v8";
14
14
  //#region packages/local-host/src/store/error.ts
@@ -5407,6 +5407,83 @@ function finishSessionUsefulness(db, args) {
5407
5407
  return result;
5408
5408
  }
5409
5409
  //#endregion
5410
+ //#region packages/local-host/src/store/journey/reconciliation/status/snapshot.ts
5411
+ const tableSchema = z.enum([
5412
+ "journey_runs",
5413
+ "journey_current",
5414
+ "journey_work_inputs",
5415
+ "journey_batches",
5416
+ "journey_resources",
5417
+ "journey_receipts",
5418
+ "journey_review_overlays",
5419
+ "journey_finding_groups"
5420
+ ]);
5421
+ const rowSchema = z.record(z.string(), z.union([
5422
+ z.string(),
5423
+ z.number(),
5424
+ z.bigint(),
5425
+ z.null(),
5426
+ z.instanceof(Uint8Array)
5427
+ ]));
5428
+ const statusDatabaseSnapshotSchema = z.record(tableSchema, z.array(rowSchema));
5429
+ /**
5430
+ * Only materialize immutable SQL values while the live transaction owns the state claim.
5431
+ * No JSON parsing, header validation, grouping or projection runs here. Keep original
5432
+ * rowids: progress uses resource insertion order to distinguish newer attempts.
5433
+ */
5434
+ function captureStatusDatabase(db, query) {
5435
+ const rows = (table, columns, where, ...args) => db.prepare(`SELECT ${columns} FROM ${table} ${where} ORDER BY rowid`).all(...args);
5436
+ return {
5437
+ journey_runs: rows("journey_runs", "id,state_json", "WHERE id=? OR id=(SELECT journey_id FROM journey_current WHERE singleton=1)", query.journeyId),
5438
+ journey_current: rows("journey_current", "singleton,journey_id", ""),
5439
+ journey_work_inputs: rows("journey_work_inputs", "journey_id,work_id,input_revision", "WHERE journey_id=?", query.journeyId),
5440
+ journey_batches: rows("journey_batches", "*", "WHERE journey_id=?", query.journeyId),
5441
+ journey_resources: rows("journey_resources", "rowid AS __rowid,journey_id,kind,id,json", "WHERE journey_id=? AND kind IN ('b-candidate','b-repair','b-session','b-reread','b-reconciliation','b-usefulness','b-attempt')", query.journeyId),
5442
+ journey_receipts: rows("journey_receipts", "request_key,request_hash,journey_id", `WHERE journey_id=? AND request_key IN (
5443
+ SELECT id FROM journey_resources WHERE journey_id=? AND kind IN ('b-reconciliation','b-usefulness')
5444
+ UNION ALL SELECT CASE WHEN json_valid(review_ref_json)
5445
+ THEN json_extract(review_ref_json,'$.idempotencyKey') END FROM journey_batches
5446
+ WHERE journey_id=? AND ?<>'' AND review_ref_json IS NOT NULL
5447
+ )`, query.journeyId, query.journeyId, query.journeyId, query.sessionReviewId ?? ""),
5448
+ journey_review_overlays: rows("journey_review_overlays", "journey_id,batch_id,reconciliation_id,overlay_digest", `WHERE journey_id=? AND reconciliation_id IN (SELECT id FROM journey_resources WHERE journey_id=? AND kind='b-reconciliation')`, query.journeyId, query.journeyId),
5449
+ journey_finding_groups: query.sessionReviewId ? rows("journey_finding_groups", "journey_id,batch_id,finding_id,group_id", "WHERE journey_id=?", query.journeyId) : []
5450
+ };
5451
+ }
5452
+ const capturedTables = `
5453
+ CREATE TABLE journey_runs (id TEXT PRIMARY KEY, state_json TEXT NOT NULL);
5454
+ CREATE TABLE journey_current (singleton INTEGER PRIMARY KEY, journey_id TEXT NOT NULL);
5455
+ CREATE TABLE journey_work_inputs (journey_id TEXT NOT NULL, work_id TEXT NOT NULL, input_revision INTEGER NOT NULL, PRIMARY KEY(journey_id,work_id));
5456
+ CREATE TABLE journey_batches (id TEXT PRIMARY KEY, journey_id TEXT NOT NULL, work_id TEXT NOT NULL, input_revision INTEGER NOT NULL, ordinal INTEGER NOT NULL, digest TEXT NOT NULL, header_json TEXT NOT NULL, batch_ref_json TEXT NOT NULL, review_ref_json TEXT, review_sequence INTEGER, UNIQUE(journey_id,work_id,input_revision,ordinal));
5457
+ CREATE TABLE journey_resources (journey_id TEXT NOT NULL, kind TEXT NOT NULL, id TEXT NOT NULL, json TEXT NOT NULL, PRIMARY KEY(journey_id,kind,id));
5458
+ CREATE TABLE journey_receipts (request_key TEXT PRIMARY KEY, request_hash TEXT NOT NULL, journey_id TEXT NOT NULL);
5459
+ CREATE TABLE journey_review_overlays (journey_id TEXT NOT NULL, batch_id TEXT NOT NULL, reconciliation_id TEXT NOT NULL, overlay_digest TEXT NOT NULL, PRIMARY KEY(journey_id,batch_id,reconciliation_id));
5460
+ CREATE TABLE journey_finding_groups (journey_id TEXT NOT NULL, batch_id TEXT NOT NULL, finding_id TEXT NOT NULL, group_id TEXT NOT NULL, PRIMARY KEY(journey_id,batch_id,finding_id));
5461
+ `;
5462
+ /** Request-local, query-only computation; never a replacement for live state. */
5463
+ function projectStatusDatabase(snapshot, project) {
5464
+ const db = new DatabaseSync(":memory:");
5465
+ try {
5466
+ try {
5467
+ db.exec(capturedTables);
5468
+ db.exec("BEGIN");
5469
+ for (const table of tableSchema.options) {
5470
+ const first = snapshot[table][0];
5471
+ if (!first) continue;
5472
+ const keys = Object.keys(first);
5473
+ const columns = keys.map((key) => `"${(key === "__rowid" ? "rowid" : key).replaceAll("\"", "\"\"")}"`);
5474
+ const insert = db.prepare(`INSERT INTO ${table} (${columns.join(",")}) VALUES (${columns.map(() => "?").join(",")})`);
5475
+ for (const row of snapshot[table]) insert.run(...keys.map((key) => row[key] ?? null));
5476
+ }
5477
+ db.exec("COMMIT; PRAGMA query_only=ON");
5478
+ } catch (cause) {
5479
+ throw new ApplicationError("CORRUPTED_STATE", void 0, { cause });
5480
+ }
5481
+ return project(db);
5482
+ } finally {
5483
+ db.close();
5484
+ }
5485
+ }
5486
+ //#endregion
5410
5487
  //#region packages/local-host/src/store/journey/batch-metadata.ts
5411
5488
  const activeBatchMetadataQuery = `
5412
5489
  WITH batch_metadata AS MATERIALIZED (
@@ -6659,6 +6736,14 @@ function listDeliveries(db, runId, operationId) {
6659
6736
  }
6660
6737
  //#endregion
6661
6738
  //#region packages/local-host/src/store/worker/operations.ts
6739
+ const selectProjectionSchema = z.object({
6740
+ snapshot: statusDatabaseSnapshotSchema,
6741
+ query: sessionReviewQuerySchema
6742
+ });
6743
+ const finishProjectionSchema = z.object({
6744
+ snapshot: statusDatabaseSnapshotSchema,
6745
+ packet: finishStatusSchema
6746
+ });
6662
6747
  function define(write, args, run, decode) {
6663
6748
  return {
6664
6749
  write,
@@ -6666,6 +6751,15 @@ function define(write, args, run, decode) {
6666
6751
  decode
6667
6752
  };
6668
6753
  }
6754
+ function defineProjection(args, project, decode) {
6755
+ const execute = (value) => project(args.parse(value));
6756
+ return {
6757
+ write: false,
6758
+ project: execute,
6759
+ execute: (_db, value) => execute(value),
6760
+ decode
6761
+ };
6762
+ }
6669
6763
  function readControlState(db) {
6670
6764
  try {
6671
6765
  return readStoredState(db);
@@ -6730,10 +6824,11 @@ function decodeResources(value) {
6730
6824
  });
6731
6825
  }
6732
6826
  const operations = {
6827
+ "journey.session.status.project-select": defineProjection(selectProjectionSchema, ({ snapshot, query }) => statusSelectionSchema.parse(projectStatusDatabase(snapshot, (db) => selectStatus(db, query))), (value) => statusSelectionSchema.parse(value)),
6828
+ "journey.session.status.project-finish": defineProjection(finishProjectionSchema, ({ snapshot, packet }) => sessionReviewStatusSchema.parse(projectStatusDatabase(snapshot, (db) => finishStatus(db, packet))), (value) => sessionReviewStatusSchema.parse(value)),
6733
6829
  "journey.review.select-reuse": define(false, reuseQuerySchema, selectReviewReuse, (value) => reuseSelectionSchema.parse(value)),
6734
6830
  "journey.review.finish-reuse": define(true, finishReuseSchema, finishReviewReuse, nothing),
6735
- "journey.session.status.select": define(false, sessionReviewQuerySchema, selectStatus, (value) => statusSelectionSchema.parse(value)),
6736
- "journey.session.status.finish": define(false, finishStatusSchema, finishStatus, (value) => sessionReviewStatusSchema.parse(value)),
6831
+ "journey.session.status.capture": define(false, sessionReviewQuerySchema, captureStatusDatabase, (value) => statusDatabaseSnapshotSchema.parse(value)),
6737
6832
  "journey.review.select-session": define(false, sessionDependencyQuerySchema, selectSessionDependencies, (value) => sessionDependenciesSchema.parse(value)),
6738
6833
  "journey.review.finish-session-resource": define(true, finishSessionResourceSchema, finishSessionResource, nothing),
6739
6834
  "journey.review.finish-session-compile": define(false, finishSessionCompileSchema, finishSessionCompile, nothing),
@@ -6924,6 +7019,12 @@ const commandSchema = z.discriminatedUnion("type", [
6924
7019
  generation: z.number().int().nonnegative()
6925
7020
  })
6926
7021
  }),
7022
+ z.object({
7023
+ type: z.literal("project"),
7024
+ id,
7025
+ operation: z.string(),
7026
+ args: z.unknown()
7027
+ }),
6927
7028
  z.object({
6928
7029
  type: z.literal("run"),
6929
7030
  id,
@@ -6990,6 +7091,7 @@ const replySchema = z.discriminatedUnion("type", [
6990
7091
  const allowedReplies = {
6991
7092
  begin: ["begun", "failed"],
6992
7093
  run: ["done", "failed"],
7094
+ project: ["done", "failed"],
6993
7095
  "read-for-write": ["state", "failed"],
6994
7096
  save: ["done", "failed"],
6995
7097
  abort: ["aborted", "failed"],
@@ -7148,6 +7250,7 @@ function createExecutor(send, options = {}) {
7148
7250
  let result;
7149
7251
  if (step.type === "run" && isOperationName(step.operation)) {
7150
7252
  const definition = operations[step.operation];
7253
+ if (definition.project) throw new ProtocolError("PROJECT_DURING_TRANSACTION");
7151
7254
  if (definition.write !== begin.write) throw new ProtocolError("OPERATION_MODE");
7152
7255
  result = definition.execute(db, step.args);
7153
7256
  phase("action");
@@ -7234,6 +7337,32 @@ receive(input) {
7234
7337
  dropAnchor();
7235
7338
  return send({ type: "anchor-dropped" });
7236
7339
  }
7340
+ if (command.type === "project") {
7341
+ if (active) return violate(command.id, "PROJECT_DURING_TRANSACTION");
7342
+ if (!isOperationName(command.operation)) return violate(command.id, "UNKNOWN_PROJECT");
7343
+ const project = operations[command.operation].project;
7344
+ if (!project) return violate(command.id, "UNKNOWN_PROJECT");
7345
+ try {
7346
+ const result = project(command.args);
7347
+ send({
7348
+ type: "done",
7349
+ id: command.id,
7350
+ busyMs: busy(),
7351
+ phases: {},
7352
+ result
7353
+ });
7354
+ } catch (error) {
7355
+ send({
7356
+ type: "failed",
7357
+ id: command.id,
7358
+ busyMs: busy(),
7359
+ phases: {},
7360
+ error: encodeError(error),
7361
+ closed: true
7362
+ });
7363
+ }
7364
+ return;
7365
+ }
7237
7366
  if (command.type === "begin") {
7238
7367
  if (active) return violate(command.id, "CONCURRENT_TRANSACTION");
7239
7368
  active = true;
@@ -1,7 +1,7 @@
1
- import { X as createInspectionProcessor } from "./src-BRwicVza.mjs";
2
- import { Dn as createStaticProcessor } from "./locate-CNU4z9G1.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-BgoSvnXe.mjs";
4
- import { U as validateInspectionRequest } from "./src-DmSIVU7-.mjs";
1
+ import { X as createInspectionProcessor } from "./src-p_uJNjV3.mjs";
2
+ import { Dn as createStaticProcessor } from "./locate-BWkblijS.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-BBjnljUs.mjs";
4
+ import { U as validateInspectionRequest } from "./src-d7n58sbH.mjs";
5
5
  import "./messages-D3m3bhva.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";