@vortex-os/base 0.11.0 → 0.12.0

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/index.d.ts CHANGED
@@ -179,6 +179,17 @@ interface AutoRecordConfig {
179
179
  * the gap but the agent leaves it for you.
180
180
  */
181
181
  readonly backfill: boolean;
182
+ /**
183
+ * The failure ledger (`data/_failures/`) — the self-improvement loop's
184
+ * evidence store. With this on, the agent records noticed failures
185
+ * (append-only, one file per occurrence) and the session-start report
186
+ * surfaces recurring keys with their escalation-ladder stage (2nd occurrence
187
+ * → the covering rule's gate is mandatory; 3rd+ → propose a deterministic
188
+ * guard — always a proposal, never auto-installed). On by default; off → no
189
+ * recording ritual and no report section ( `vortex failure` still works when
190
+ * invoked explicitly).
191
+ */
192
+ readonly failures: boolean;
182
193
  }
183
194
  /**
184
195
  * One environment label plus the signal that selects it. Rules are evaluated
@@ -2709,6 +2720,78 @@ declare function collectCarryover(repoRoot: string, ignore?: (repoRelPosixPath:
2709
2720
  interrupted: string | null;
2710
2721
  } | null;
2711
2722
 
2723
+ /**
2724
+ * `vortex guard` — deterministic write-time guards, wired as Claude Code hooks.
2725
+ *
2726
+ * `guard write` is a PreToolUse hook for the file-writing tools
2727
+ * (Write / Edit / MultiEdit / NotebookEdit). It reads the hook payload JSON
2728
+ * from stdin and DENIES the call when the NEW text contains a literal control
2729
+ * character (anything below U+0020 except tab/LF/CR, or U+007F) — the
2730
+ * documented repeat-failure class where escape notation was intended but the
2731
+ * raw byte got written into source files.
2732
+ *
2733
+ * Why a hook and not (another) rule: the failure happens precisely when the
2734
+ * model's active context is saturated with the offending bytes, i.e. when
2735
+ * memory-based discipline is weakest. A deterministic check at the write
2736
+ * boundary does not depend on recall. This is the "3rd occurrence → promote to
2737
+ * a deterministic guard" rung of the failure-ledger ladder, shipped as a
2738
+ * framework default because the class has zero legitimate uses in text writes
2739
+ * (escape notation is always available).
2740
+ *
2741
+ * Contract (mirrors the statusline renderer's "never break the host"):
2742
+ * - only the NEW text is scanned (`content`, `new_string`, `edits[].new_string`,
2743
+ * `new_source`) — `old_string` is deliberately NOT scanned, so cleaning an
2744
+ * already-polluted file stays possible;
2745
+ * - a clean payload produces NO output (exit 0) — the normal permission flow
2746
+ * proceeds untouched;
2747
+ * - a malformed payload, an unexpected tool, or any internal error is
2748
+ * FAIL-OPEN: exit 0, no output, never a blocked write from a guard bug.
2749
+ */
2750
+ /** The PreToolUse hook command `vortex init` wires (self-silencing like the session hooks). */
2751
+ declare const GUARD_WRITE_COMMAND = "npx --no-install vortex guard write || exit 0";
2752
+ /** Tool-name matcher for the guard's hook group. */
2753
+ declare const GUARD_WRITE_MATCHER = "Write|Edit|MultiEdit|NotebookEdit";
2754
+ /** A literal control character found in to-be-written text. */
2755
+ interface GuardFinding {
2756
+ /** Which payload field carried it (e.g. `content`, `edits[2].new_string`). */
2757
+ readonly field: string;
2758
+ /** Character offset within that field. */
2759
+ readonly index: number;
2760
+ readonly codePoint: number;
2761
+ }
2762
+ /** First forbidden control character in `text`, or null. */
2763
+ declare function findControlChar(text: string): {
2764
+ index: number;
2765
+ codePoint: number;
2766
+ } | null;
2767
+ /**
2768
+ * Scan a PreToolUse `tool_input` for forbidden control characters in every
2769
+ * NEW-text field. Returns the first finding, or null when clean.
2770
+ */
2771
+ declare function scanToolInput(toolInput: Record<string, unknown>): GuardFinding | null;
2772
+ /** Build the PreToolUse deny JSON for a finding. */
2773
+ declare function buildDenyDecision(finding: GuardFinding): string;
2774
+ /**
2775
+ * Decide on a raw PreToolUse payload. Returns the hook's stdout JSON (a deny
2776
+ * decision) when a forbidden character is found, or null to stay silent
2777
+ * (allow / not applicable / out-of-scope tool / unparseable — fail-open by design).
2778
+ */
2779
+ declare function guardWriteDecision(payloadText: string): string | null;
2780
+ /**
2781
+ * CLI entry — `vortex guard write` (stdin: PreToolUse payload JSON).
2782
+ * Always exits 0: a deny is expressed via the JSON decision on stdout, and
2783
+ * everything else stays silent so the hook's `|| exit 0` wrapper never fires.
2784
+ */
2785
+ declare function runGuardCli(argv: readonly string[], out: (s: string) => void, err: (s: string) => void): Promise<number>;
2786
+ /**
2787
+ * Nearest VortEX instance root at or above `startDir` (marker:
2788
+ * `.agent/vortex.json`), preferring an explicit `VORTEX_REPO_ROOT`, then the
2789
+ * host-provided `CLAUDE_PROJECT_DIR` — each honored only when it actually IS
2790
+ * an instance. Bounded walk; null when nothing matches (not an instance —
2791
+ * the guard still denies, it just has no ledger to count into).
2792
+ */
2793
+ declare function resolveInstanceRoot(startDir: string): string | null;
2794
+
2712
2795
  /**
2713
2796
  * Hook wiring for `/vortex init`: make sure the instance's
2714
2797
  * `.claude/settings.json` registers the VortEX SessionStart / SessionEnd hooks,
@@ -2722,6 +2805,7 @@ declare function collectCarryover(repoRoot: string, ignore?: (repoRelPosixPath:
2722
2805
  */
2723
2806
  declare const SESSION_START_COMMAND = "npx --no-install vortex session-start || exit 0";
2724
2807
  declare const SESSION_END_COMMAND = "npx --no-install vortex session-end || exit 0";
2808
+
2725
2809
  interface HookCommand {
2726
2810
  readonly type: "command";
2727
2811
  readonly command: string;
@@ -2745,7 +2829,7 @@ interface EnsureHooksResult {
2745
2829
  * migrated/de-duplicated in place (empty when nothing changed). Callers should
2746
2830
  * key "did we need to write?" off `alreadyWired`, not the name "added".
2747
2831
  */
2748
- readonly added: readonly ("SessionStart" | "SessionEnd")[];
2832
+ readonly added: readonly string[];
2749
2833
  /** True when nothing changed — every VortEX hook was already present. */
2750
2834
  readonly alreadyWired: boolean;
2751
2835
  }
@@ -2758,8 +2842,16 @@ declare function parseSettings(text: string | null | undefined): ClaudeSettings;
2758
2842
  * Merge the VortEX hooks into an existing settings object WITHOUT mutating the
2759
2843
  * input. A hook event is left untouched if it already references our command
2760
2844
  * (idempotent); otherwise our group is appended alongside any existing groups.
2845
+ *
2846
+ * `opts.guard` additionally wires the PreToolUse control-byte guard
2847
+ * (`vortex guard write`) for the file-writing tools. It is requested by
2848
+ * `vortex init` (instance settings) but NOT by `vortex global-setup`: a
2849
+ * machine-global deny hook would fire in every project on the machine, which
2850
+ * is a stronger default than "the instance opted into VortEX conventions".
2761
2851
  */
2762
- declare function ensureVortexHooks(existing: ClaudeSettings | null | undefined): EnsureHooksResult;
2852
+ declare function ensureVortexHooks(existing: ClaudeSettings | null | undefined, opts?: {
2853
+ readonly guard?: boolean;
2854
+ }): EnsureHooksResult;
2763
2855
  /** Serialize settings the way Claude writes them (2-space, trailing newline). */
2764
2856
  declare function serializeSettings(settings: ClaudeSettings): string;
2765
2857
 
@@ -3263,6 +3355,24 @@ declare function renderSessionStartReport(report: SessionStartHookReport, extras
3263
3355
  readonly uncommitted: number;
3264
3356
  readonly interrupted: string | null;
3265
3357
  };
3358
+ /**
3359
+ * Failure-ledger recurrence warnings (`data/_failures/`, gated by
3360
+ * `autoRecord.failures`): keys with 2+ open occurrences and their
3361
+ * escalation-ladder stage — 2nd occurrence = the covering rule's gate is
3362
+ * mandatory this session; 3rd+ = propose a deterministic guard (proposal
3363
+ * only). Machine-counted so escalation never depends on anyone remembering.
3364
+ */
3365
+ readonly failures?: {
3366
+ readonly warnings: readonly {
3367
+ readonly key: string;
3368
+ readonly count: number;
3369
+ readonly stage: "recorded" | "gate" | "promote";
3370
+ readonly rule: string | null;
3371
+ readonly lastDate: string;
3372
+ }[];
3373
+ readonly totalOpen: number;
3374
+ readonly omitted: number;
3375
+ };
3266
3376
  }): string;
3267
3377
 
3268
3378
  /**
@@ -3432,8 +3542,23 @@ declare function renderStatusline(d: StatuslineData, p: StatuslineProbes, mode?:
3432
3542
  declare function sniffEffortFromTranscript(transcriptPath: string, maxBytes?: number): string | null;
3433
3543
  /** Collect every environment lookup the renderer needs for this input. */
3434
3544
  declare function collectStatuslineProbes(d: StatuslineData, now?: Date): StatuslineProbes;
3435
- /** The statusLine command written by `install`. Mirrors the session hooks: bin-name resolution, fail-closed, self-silencing. */
3436
- declare function statuslineCommand(lite: boolean): string;
3545
+ /**
3546
+ * The statusLine command written by `install`.
3547
+ *
3548
+ * The host runs the statusLine command in the session's CURRENT working
3549
+ * directory — which MOVES as the session `cd`s around (measured: the hook cwd
3550
+ * followed the shell into a sibling repo). Anything cwd-relative (bare `npx`
3551
+ * lookup, `./node_modules/...`) therefore silently resolves nothing the moment
3552
+ * the session leaves the project, and the bar just vanishes. So:
3553
+ * - with a local install (`directRoot`): invoke the bin by ABSOLUTE path —
3554
+ * immune to cwd, and ~0.5s faster per refresh than npx (the other observed
3555
+ * disappearing-bar mode: npx latency under load) — with the npx lookup
3556
+ * chained as a fallback for when the repo has moved;
3557
+ * - global-only installs: the npx form alone (cwd-sensitive, but there is no
3558
+ * local path to pin).
3559
+ * Always self-silencing (`|| exit 0`).
3560
+ */
3561
+ declare function statuslineCommand(lite: boolean, directRoot?: string): string;
3437
3562
  interface StatuslineInstallResult {
3438
3563
  readonly status: "installed" | "already-ours" | "kept-existing";
3439
3564
  readonly settingsPath: string;
@@ -3446,7 +3571,7 @@ interface StatuslineInstallResult {
3446
3571
  * statusLine that is not ours is kept (the user owns their bar) unless `force`.
3447
3572
  * Switching full↔lite of our own command counts as ours and is updated.
3448
3573
  */
3449
- declare function ensureStatusline(existing: ClaudeSettings, lite: boolean, force?: boolean): {
3574
+ declare function ensureStatusline(existing: ClaudeSettings, lite: boolean, force?: boolean, directRoot?: string): {
3450
3575
  settings: ClaudeSettings;
3451
3576
  status: StatuslineInstallResult["status"];
3452
3577
  existing?: string;
@@ -3458,6 +3583,139 @@ declare function ensureStatusline(existing: ClaudeSettings, lite: boolean, force
3458
3583
  */
3459
3584
  declare function runStatuslineCli(argv: readonly string[], repoRoot: string, out: (s: string) => void, err: (s: string) => void): Promise<number>;
3460
3585
 
3586
+ /**
3587
+ * Failure ledger (`data/_failures/`) — the evidence store of the
3588
+ * self-improvement loop.
3589
+ *
3590
+ * The problem this solves: behavioral rules live in `data/_memory/`, but a rule
3591
+ * loaded at session start is *passive knowledge* — at action time the model's
3592
+ * active context is full of the task and the rule slips. The documented result
3593
+ * is the same failure recurring despite a registered rule. The fix is not
3594
+ * another rule; it is a LEDGER that makes recurrence countable by a machine,
3595
+ * plus an escalation ladder that turns counts into stronger defenses:
3596
+ *
3597
+ * 1st occurrence → record (append-only file, one per occurrence)
3598
+ * 2nd (rule held) → the rule's write-time gate becomes MANDATORY
3599
+ * 3rd+ → propose promoting to a deterministic guard (hook /
3600
+ * pre-commit / wrapper) — always a PROPOSAL; the user
3601
+ * approves, nothing self-installs
3602
+ *
3603
+ * Design notes:
3604
+ * - One markdown file per occurrence (`YYYY-MM-DD_HHMM-<key>.md`), frontmatter
3605
+ * carries the machine-read fields; the body is for humans. Append-only —
3606
+ * resolving a pattern flips `status` on its entries, never deletes.
3607
+ * - `recurrence_key` is the grouping identity: a stable kebab-case name for
3608
+ * the ROOT CAUSE (e.g. `literal-control-bytes`), not the symptom of the day.
3609
+ * Same cause → same key, that is what makes counting honest.
3610
+ * - Recording is an agent ritual (auto, append-only, one-line note to the
3611
+ * user — AI-RULES "Default behaviors"); deterministic guards may also append
3612
+ * here directly so counting never depends on the failing agent noticing.
3613
+ * - The session-start report surfaces groups at 2+ open occurrences with their
3614
+ * ladder stage, so escalation never depends on human memory either.
3615
+ */
3616
+ /** Directory name under `data/` holding the ledger. */
3617
+ declare const FAILURES_DIR = "_failures";
3618
+ /** Ladder stages by open-occurrence count. */
3619
+ type LadderStage = "recorded" | "gate" | "promote";
3620
+ /** Stage for a given open-occurrence count (1 → recorded, 2 → gate, 3+ → promote). */
3621
+ declare function ladderStage(count: number): LadderStage;
3622
+ /** One ledger entry (one occurrence), as read back from disk. */
3623
+ interface FailureEntry {
3624
+ /** Path relative to the data dir (`_failures/2026-06-11_0210-….md`). */
3625
+ readonly relPath: string;
3626
+ readonly key: string;
3627
+ readonly title: string;
3628
+ readonly signal: string;
3629
+ readonly severity: string;
3630
+ readonly status: "open" | "resolved";
3631
+ /** `YYYY-MM-DD` from frontmatter `created` (falls back to the filename). */
3632
+ readonly date: string;
3633
+ /** Related rule (memory slug) named at record time, or null. */
3634
+ readonly rule: string | null;
3635
+ }
3636
+ /** All occurrences sharing a recurrence key, with the derived ladder stage. */
3637
+ interface FailureGroup {
3638
+ readonly key: string;
3639
+ /** OPEN occurrences only — resolved history no longer escalates. */
3640
+ readonly count: number;
3641
+ readonly stage: LadderStage;
3642
+ readonly lastDate: string;
3643
+ /** First non-null rule named across the group's entries. */
3644
+ readonly rule: string | null;
3645
+ readonly titles: readonly string[];
3646
+ readonly entries: readonly FailureEntry[];
3647
+ }
3648
+ interface FailureScan {
3649
+ /** Open groups, most occurrences first (ties: most recent first). */
3650
+ readonly groups: readonly FailureGroup[];
3651
+ readonly totalOpen: number;
3652
+ readonly totalResolved: number;
3653
+ }
3654
+ interface RecordFailureInput {
3655
+ /** Stable kebab-case root-cause key (`[a-z0-9-]`, 3..64 chars). */
3656
+ readonly key: string;
3657
+ /** One-line description of what happened. */
3658
+ readonly what: string;
3659
+ /** Signal class — free short token; conventional values: user_pushback, tool_error, test_failure, cross_check_miss, guard_denied, self_detected. */
3660
+ readonly signal?: string;
3661
+ /** low | medium | high (free token, those are the conventional values). */
3662
+ readonly severity?: string;
3663
+ /** Memory slug of the rule that already covered this (if any). */
3664
+ readonly rule?: string;
3665
+ /** Evidence pointers (paths, links) — recorded as a list in the body. */
3666
+ readonly evidence?: readonly string[];
3667
+ }
3668
+ interface RecordFailureResult {
3669
+ readonly path: string;
3670
+ readonly relPath: string;
3671
+ readonly key: string;
3672
+ /** Open occurrences for this key AFTER this record (i.e. includes it). */
3673
+ readonly count: number;
3674
+ readonly stage: LadderStage;
3675
+ /** Agent-facing one-liner explaining the ladder consequence of this count. */
3676
+ readonly note: string;
3677
+ }
3678
+ /** Validate a recurrence key: stable kebab-case, filename-safe by construction. */
3679
+ declare function isValidFailureKey(key: string): boolean;
3680
+ /**
3681
+ * Append one occurrence to the ledger. Creates `data/_failures/` on first use.
3682
+ * Never overwrites: a same-minute collision for the same key gets a numeric
3683
+ * suffix. Returns the post-write open count + ladder stage for the key so the
3684
+ * caller (agent) can relay "this is the Nth time" in its one-line note.
3685
+ */
3686
+ declare function recordFailure(dataDir: string, input: RecordFailureInput, now?: Date): Promise<RecordFailureResult>;
3687
+ declare function scanFailures(dataDir: string): Promise<FailureScan>;
3688
+ /** Compact, report-ready view: groups needing attention (2+ open occurrences). */
3689
+ interface FailureReportSlice {
3690
+ readonly warnings: readonly {
3691
+ readonly key: string;
3692
+ readonly count: number;
3693
+ readonly stage: LadderStage;
3694
+ readonly rule: string | null;
3695
+ readonly lastDate: string;
3696
+ }[];
3697
+ readonly totalOpen: number;
3698
+ readonly omitted: number;
3699
+ }
3700
+ /** Slice a scan down to what the session-start report shows (stage gate/promote only, capped). */
3701
+ declare function failureReportSlice(scan: FailureScan): FailureReportSlice;
3702
+ /** The fixed recurrence key for write-guard denials (one failure class → one key). */
3703
+ declare const GUARD_DENIAL_KEY = "literal-control-bytes";
3704
+ /**
3705
+ * Record a write-guard denial into the ledger — called by the guard itself, so
3706
+ * counting NEVER depends on the failing agent noticing and self-reporting
3707
+ * (the documented stall mode of self-report-only ledgers). Best-effort and
3708
+ * silent: returns null when skipped (recent same-incident entry, or any
3709
+ * error) — a ledger problem must never affect the deny itself.
3710
+ */
3711
+ declare function recordGuardDenial(dataDir: string, what: string, now?: Date): Promise<RecordFailureResult | null>;
3712
+ /**
3713
+ * Run the failure-ledger CLI. `record` appends one occurrence and reports the
3714
+ * post-write count + ladder stage (so the agent can relay "Nth time"); `list`
3715
+ * prints the grouped open ledger. Results are JSON on stdout.
3716
+ */
3717
+ declare function runFailureCli(argv: readonly string[], dataDir: string, out: (s: string) => void, err: (s: string) => void): Promise<number>;
3718
+
3461
3719
  interface ReindexResult {
3462
3720
  readonly dir: string;
3463
3721
  readonly status: "written" | "unchanged" | "missing";
@@ -4140,12 +4398,22 @@ type index_d_CurateResult = CurateResult;
4140
4398
  declare const index_d_DEFAULT_GAP_WINDOW_DAYS: typeof DEFAULT_GAP_WINDOW_DAYS;
4141
4399
  type index_d_EnsureHooksResult = EnsureHooksResult;
4142
4400
  type index_d_EnsureWorklogResult = EnsureWorklogResult;
4401
+ declare const index_d_FAILURES_DIR: typeof FAILURES_DIR;
4402
+ type index_d_FailureEntry = FailureEntry;
4403
+ type index_d_FailureGroup = FailureGroup;
4404
+ type index_d_FailureReportSlice = FailureReportSlice;
4405
+ type index_d_FailureScan = FailureScan;
4406
+ declare const index_d_GUARD_DENIAL_KEY: typeof GUARD_DENIAL_KEY;
4407
+ declare const index_d_GUARD_WRITE_COMMAND: typeof GUARD_WRITE_COMMAND;
4408
+ declare const index_d_GUARD_WRITE_MATCHER: typeof GUARD_WRITE_MATCHER;
4143
4409
  type index_d_GitPullResult = GitPullResult;
4410
+ type index_d_GuardFinding = GuardFinding;
4144
4411
  declare const index_d_HANDOFF_ARCHIVE_DIR: typeof HANDOFF_ARCHIVE_DIR;
4145
4412
  declare const index_d_HANDOFF_DIR: typeof HANDOFF_DIR;
4146
4413
  type index_d_HandoffCreateResult = HandoffCreateResult;
4147
4414
  type index_d_HandoffSummary = HandoffSummary;
4148
4415
  type index_d_HandoffWriteResult = HandoffWriteResult;
4416
+ type index_d_LadderStage = LadderStage;
4149
4417
  type index_d_NewDecisionResult = NewDecisionResult;
4150
4418
  declare const index_d_OWNERSHIP_SCHEMA: typeof OWNERSHIP_SCHEMA;
4151
4419
  type index_d_OpenDecision = OpenDecision;
@@ -4155,6 +4423,8 @@ type index_d_OwnershipEntry = OwnershipEntry;
4155
4423
  type index_d_OwnershipManifest = OwnershipManifest;
4156
4424
  type index_d_RecallOptions = RecallOptions;
4157
4425
  type index_d_RecentWorklog = RecentWorklog;
4426
+ type index_d_RecordFailureInput = RecordFailureInput;
4427
+ type index_d_RecordFailureResult = RecordFailureResult;
4158
4428
  type index_d_ReindexResult = ReindexResult;
4159
4429
  type index_d_RitualRegistryOptions = RitualRegistryOptions;
4160
4430
  declare const index_d_SESSION_END_COMMAND: typeof SESSION_END_COMMAND;
@@ -4182,6 +4452,7 @@ declare const index_d_aggregateHandoff: typeof aggregateHandoff;
4182
4452
  declare const index_d_applyGlobalSetup: typeof applyGlobalSetup;
4183
4453
  declare const index_d_argvToSlash: typeof argvToSlash;
4184
4454
  declare const index_d_autoReindexMemory: typeof autoReindexMemory;
4455
+ declare const index_d_buildDenyDecision: typeof buildDenyDecision;
4185
4456
  declare const index_d_buildInstallCommand: typeof buildInstallCommand;
4186
4457
  declare const index_d_buildOwnershipManifest: typeof buildOwnershipManifest;
4187
4458
  declare const index_d_buildRegistry: typeof buildRegistry;
@@ -4207,6 +4478,8 @@ declare const index_d_ensureVortexHooks: typeof ensureVortexHooks;
4207
4478
  declare const index_d_ensureWorklogEntry: typeof ensureWorklogEntry;
4208
4479
  declare const index_d_extractNextUp: typeof extractNextUp;
4209
4480
  declare const index_d_extractOpenTasks: typeof extractOpenTasks;
4481
+ declare const index_d_failureReportSlice: typeof failureReportSlice;
4482
+ declare const index_d_findControlChar: typeof findControlChar;
4210
4483
  declare const index_d_formatTokens: typeof formatTokens;
4211
4484
  declare const index_d_formatWindow: typeof formatWindow;
4212
4485
  declare const index_d_gapWindowSinceArg: typeof gapWindowSinceArg;
@@ -4214,12 +4487,15 @@ declare const index_d_globalMemoryPath: typeof globalMemoryPath;
4214
4487
  declare const index_d_globalSettingsHasHook: typeof globalSettingsHasHook;
4215
4488
  declare const index_d_globalSettingsPath: typeof globalSettingsPath;
4216
4489
  declare const index_d_globalStatePath: typeof globalStatePath;
4490
+ declare const index_d_guardWriteDecision: typeof guardWriteDecision;
4217
4491
  declare const index_d_handoffCommand: typeof handoffCommand;
4218
4492
  declare const index_d_inspectGlobalSetup: typeof inspectGlobalSetup;
4219
4493
  declare const index_d_inspectOwnership: typeof inspectOwnership;
4220
4494
  declare const index_d_isInstanceRoot: typeof isInstanceRoot;
4221
4495
  declare const index_d_isNewer: typeof isNewer;
4222
4496
  declare const index_d_isStableUpdate: typeof isStableUpdate;
4497
+ declare const index_d_isValidFailureKey: typeof isValidFailureKey;
4498
+ declare const index_d_ladderStage: typeof ladderStage;
4223
4499
  declare const index_d_logCommand: typeof logCommand;
4224
4500
  declare const index_d_makeBar: typeof makeBar;
4225
4501
  declare const index_d_ownershipManifestPath: typeof ownershipManifestPath;
@@ -4231,23 +4507,30 @@ declare const index_d_queryNpmLatest: typeof queryNpmLatest;
4231
4507
  declare const index_d_readGlobalInstancePointer: typeof readGlobalInstancePointer;
4232
4508
  declare const index_d_readInstalledBaseVersion: typeof readInstalledBaseVersion;
4233
4509
  declare const index_d_recallCommand: typeof recallCommand;
4510
+ declare const index_d_recordFailure: typeof recordFailure;
4234
4511
  declare const index_d_recordGlobalSetupDecline: typeof recordGlobalSetupDecline;
4512
+ declare const index_d_recordGuardDenial: typeof recordGuardDenial;
4235
4513
  declare const index_d_reindexCommand: typeof reindexCommand;
4236
4514
  declare const index_d_renderAgenda: typeof renderAgenda;
4237
4515
  declare const index_d_renderGlobalBlock: typeof renderGlobalBlock;
4238
4516
  declare const index_d_renderSessionStartReport: typeof renderSessionStartReport;
4239
4517
  declare const index_d_renderStatusline: typeof renderStatusline;
4240
4518
  declare const index_d_repairOwnershipManifest: typeof repairOwnershipManifest;
4519
+ declare const index_d_resolveInstanceRoot: typeof resolveInstanceRoot;
4241
4520
  declare const index_d_resolveRepoRoot: typeof resolveRepoRoot;
4242
4521
  declare const index_d_runCurateAccept: typeof runCurateAccept;
4243
4522
  declare const index_d_runCurateCandidates: typeof runCurateCandidates;
4244
4523
  declare const index_d_runCurateDecline: typeof runCurateDecline;
4245
4524
  declare const index_d_runCuratePreview: typeof runCuratePreview;
4525
+ declare const index_d_runFailureCli: typeof runFailureCli;
4526
+ declare const index_d_runGuardCli: typeof runGuardCli;
4246
4527
  declare const index_d_runStatuslineCli: typeof runStatuslineCli;
4247
4528
  declare const index_d_runTemplatesUpdate: typeof runTemplatesUpdate;
4248
4529
  declare const index_d_runVortexCli: typeof runVortexCli;
4249
4530
  declare const index_d_safeSegment: typeof safeSegment;
4531
+ declare const index_d_scanFailures: typeof scanFailures;
4250
4532
  declare const index_d_scanHandoffs: typeof scanHandoffs;
4533
+ declare const index_d_scanToolInput: typeof scanToolInput;
4251
4534
  declare const index_d_serializeSettings: typeof serializeSettings;
4252
4535
  declare const index_d_sessionStartCommand: typeof sessionStartCommand;
4253
4536
  declare const index_d_sniffEffortFromTranscript: typeof sniffEffortFromTranscript;
@@ -4258,7 +4541,7 @@ declare const index_d_validateCuratePayload: typeof validateCuratePayload;
4258
4541
  declare const index_d_vortexCommand: typeof vortexCommand;
4259
4542
  declare const index_d_writeOwnershipManifest: typeof writeOwnershipManifest;
4260
4543
  declare namespace index_d {
4261
- export { type index_d_AgendaReport as AgendaReport, type index_d_AmbientRecallFactoryOptions as AmbientRecallFactoryOptions, type index_d_CatchUpOptions as CatchUpOptions, type index_d_CatchUpResult as CatchUpResult, type index_d_ClaudeSettings as ClaudeSettings, type index_d_CliIo as CliIo, type index_d_CollectAgendaOptions as CollectAgendaOptions, type index_d_CurateAcceptResult as CurateAcceptResult, type index_d_CurateActionKind as CurateActionKind, type index_d_CurateAnyProposal as CurateAnyProposal, type index_d_CurateCandidate as CurateCandidate, type index_d_CurateCandidatesResult as CurateCandidatesResult, type index_d_CurateDeclineResult as CurateDeclineResult, type index_d_CurateOptions as CurateOptions, type index_d_CuratePayload as CuratePayload, type index_d_CuratePayloadValidation as CuratePayloadValidation, type index_d_CuratePreviewResult as CuratePreviewResult, type index_d_CurateResult as CurateResult, index_d_DEFAULT_GAP_WINDOW_DAYS as DEFAULT_GAP_WINDOW_DAYS, type index_d_EnsureHooksResult as EnsureHooksResult, type index_d_EnsureWorklogResult as EnsureWorklogResult, type index_d_GitPullResult as GitPullResult, index_d_HANDOFF_ARCHIVE_DIR as HANDOFF_ARCHIVE_DIR, index_d_HANDOFF_DIR as HANDOFF_DIR, type index_d_HandoffCreateResult as HandoffCreateResult, type index_d_HandoffSummary as HandoffSummary, type index_d_HandoffWriteResult as HandoffWriteResult, type index_d_NewDecisionResult as NewDecisionResult, index_d_OWNERSHIP_SCHEMA as OWNERSHIP_SCHEMA, type index_d_OpenDecision as OpenDecision, type index_d_OpenTask as OpenTask, type index_d_OwnershipDiagnosis as OwnershipDiagnosis, type index_d_OwnershipEntry as OwnershipEntry, type index_d_OwnershipManifest as OwnershipManifest, type index_d_RecallOptions as RecallOptions, type index_d_RecentWorklog as RecentWorklog, type index_d_ReindexResult as ReindexResult, type index_d_RitualRegistryOptions as RitualRegistryOptions, index_d_SESSION_END_COMMAND as SESSION_END_COMMAND, index_d_SESSION_START_COMMAND as SESSION_START_COMMAND, type index_d_SessionStartHookReport as SessionStartHookReport, type index_d_SessionStartReport as SessionStartReport, type index_d_StatuslineData as StatuslineData, type index_d_StatuslineInstallResult as StatuslineInstallResult, type index_d_StatuslineProbes as StatuslineProbes, type index_d_UpdateCheckResult as UpdateCheckResult, type index_d_UpdateFileAction as UpdateFileAction, type index_d_UpdateFileActionKind as UpdateFileActionKind, type index_d_VortexHelpResult as VortexHelpResult, type index_d_VortexInitResult as VortexInitResult, type index_d_VortexPlannedResult as VortexPlannedResult, type index_d_VortexResult as VortexResult, type index_d_VortexSyncResult as VortexSyncResult, type index_d_VortexSyncStep as VortexSyncStep, type index_d_VortexSyncStepId as VortexSyncStepId, type index_d_VortexSyncStepStatus as VortexSyncStepStatus, type index_d_VortexUpdateResult as VortexUpdateResult, type index_d_WorklogAppendResult as WorklogAppendResult, index_d_agendaCommand as agendaCommand, index_d_aggregateHandoff as aggregateHandoff, index_d_applyGlobalSetup as applyGlobalSetup, index_d_argvToSlash as argvToSlash, index_d_autoReindexMemory as autoReindexMemory, index_d_buildInstallCommand as buildInstallCommand, index_d_buildOwnershipManifest as buildOwnershipManifest, index_d_buildRegistry as buildRegistry, index_d_catchUpSessions as catchUpSessions, index_d_checkBaseUpdate as checkBaseUpdate, index_d_collectAgenda as collectAgenda, index_d_collectCarryover as collectCarryover, index_d_collectSessionStartReport as collectSessionStartReport, index_d_collectStatuslineProbes as collectStatuslineProbes, index_d_compareSemver as compareSemver, index_d_computeCurateFingerprint as computeCurateFingerprint, index_d_countUncommitted as countUncommitted, index_d_createAmbientRecaller as createAmbientRecaller, index_d_createHandoffSkeleton as createHandoffSkeleton, index_d_createRitualRegistry as createRitualRegistry, index_d_curateCommand as curateCommand, index_d_decisionCommand as decisionCommand, index_d_detectInterruptedGitOp as detectInterruptedGitOp, index_d_detectWorklogGaps as detectWorklogGaps, index_d_effortMeter as effortMeter, index_d_ensureStatusline as ensureStatusline, index_d_ensureVortexHooks as ensureVortexHooks, index_d_ensureWorklogEntry as ensureWorklogEntry, index_d_extractNextUp as extractNextUp, index_d_extractOpenTasks as extractOpenTasks, index_d_formatTokens as formatTokens, index_d_formatWindow as formatWindow, index_d_gapWindowSinceArg as gapWindowSinceArg, index_d_globalMemoryPath as globalMemoryPath, index_d_globalSettingsHasHook as globalSettingsHasHook, index_d_globalSettingsPath as globalSettingsPath, index_d_globalStatePath as globalStatePath, index_d_handoffCommand as handoffCommand, index_d_inspectGlobalSetup as inspectGlobalSetup, index_d_inspectOwnership as inspectOwnership, index_d_isInstanceRoot as isInstanceRoot, index_d_isNewer as isNewer, index_d_isStableUpdate as isStableUpdate, index_d_logCommand as logCommand, index_d_makeBar as makeBar, index_d_ownershipManifestPath as ownershipManifestPath, index_d_parseAdoptArgs as parseAdoptArgs, index_d_parseSettings as parseSettings, index_d_parseStatuslineInput as parseStatuslineInput, index_d_pruneHandoffs as pruneHandoffs, index_d_queryNpmLatest as queryNpmLatest, index_d_readGlobalInstancePointer as readGlobalInstancePointer, index_d_readInstalledBaseVersion as readInstalledBaseVersion, index_d_recallCommand as recallCommand, index_d_recordGlobalSetupDecline as recordGlobalSetupDecline, index_d_reindexCommand as reindexCommand, index_d_renderAgenda as renderAgenda, index_d_renderGlobalBlock as renderGlobalBlock, index_d_renderSessionStartReport as renderSessionStartReport, index_d_renderStatusline as renderStatusline, index_d_repairOwnershipManifest as repairOwnershipManifest, index_d_resolveRepoRoot as resolveRepoRoot, index_d_runCurateAccept as runCurateAccept, index_d_runCurateCandidates as runCurateCandidates, index_d_runCurateDecline as runCurateDecline, index_d_runCuratePreview as runCuratePreview, index_d_runStatuslineCli as runStatuslineCli, index_d_runTemplatesUpdate as runTemplatesUpdate, index_d_runVortexCli as runVortexCli, index_d_safeSegment as safeSegment, index_d_scanHandoffs as scanHandoffs, index_d_serializeSettings as serializeSettings, index_d_sessionStartCommand as sessionStartCommand, index_d_sniffEffortFromTranscript as sniffEffortFromTranscript, index_d_statuslineCommand as statuslineCommand, index_d_templateDestRelPath as templateDestRelPath, index_d_upsertGlobalBlock as upsertGlobalBlock, index_d_validateCuratePayload as validateCuratePayload, index_d_vortexCommand as vortexCommand, index_d_writeOwnershipManifest as writeOwnershipManifest };
4544
+ export { type index_d_AgendaReport as AgendaReport, type index_d_AmbientRecallFactoryOptions as AmbientRecallFactoryOptions, type index_d_CatchUpOptions as CatchUpOptions, type index_d_CatchUpResult as CatchUpResult, type index_d_ClaudeSettings as ClaudeSettings, type index_d_CliIo as CliIo, type index_d_CollectAgendaOptions as CollectAgendaOptions, type index_d_CurateAcceptResult as CurateAcceptResult, type index_d_CurateActionKind as CurateActionKind, type index_d_CurateAnyProposal as CurateAnyProposal, type index_d_CurateCandidate as CurateCandidate, type index_d_CurateCandidatesResult as CurateCandidatesResult, type index_d_CurateDeclineResult as CurateDeclineResult, type index_d_CurateOptions as CurateOptions, type index_d_CuratePayload as CuratePayload, type index_d_CuratePayloadValidation as CuratePayloadValidation, type index_d_CuratePreviewResult as CuratePreviewResult, type index_d_CurateResult as CurateResult, index_d_DEFAULT_GAP_WINDOW_DAYS as DEFAULT_GAP_WINDOW_DAYS, type index_d_EnsureHooksResult as EnsureHooksResult, type index_d_EnsureWorklogResult as EnsureWorklogResult, index_d_FAILURES_DIR as FAILURES_DIR, type index_d_FailureEntry as FailureEntry, type index_d_FailureGroup as FailureGroup, type index_d_FailureReportSlice as FailureReportSlice, type index_d_FailureScan as FailureScan, index_d_GUARD_DENIAL_KEY as GUARD_DENIAL_KEY, index_d_GUARD_WRITE_COMMAND as GUARD_WRITE_COMMAND, index_d_GUARD_WRITE_MATCHER as GUARD_WRITE_MATCHER, type index_d_GitPullResult as GitPullResult, type index_d_GuardFinding as GuardFinding, index_d_HANDOFF_ARCHIVE_DIR as HANDOFF_ARCHIVE_DIR, index_d_HANDOFF_DIR as HANDOFF_DIR, type index_d_HandoffCreateResult as HandoffCreateResult, type index_d_HandoffSummary as HandoffSummary, type index_d_HandoffWriteResult as HandoffWriteResult, type index_d_LadderStage as LadderStage, type index_d_NewDecisionResult as NewDecisionResult, index_d_OWNERSHIP_SCHEMA as OWNERSHIP_SCHEMA, type index_d_OpenDecision as OpenDecision, type index_d_OpenTask as OpenTask, type index_d_OwnershipDiagnosis as OwnershipDiagnosis, type index_d_OwnershipEntry as OwnershipEntry, type index_d_OwnershipManifest as OwnershipManifest, type index_d_RecallOptions as RecallOptions, type index_d_RecentWorklog as RecentWorklog, type index_d_RecordFailureInput as RecordFailureInput, type index_d_RecordFailureResult as RecordFailureResult, type index_d_ReindexResult as ReindexResult, type index_d_RitualRegistryOptions as RitualRegistryOptions, index_d_SESSION_END_COMMAND as SESSION_END_COMMAND, index_d_SESSION_START_COMMAND as SESSION_START_COMMAND, type index_d_SessionStartHookReport as SessionStartHookReport, type index_d_SessionStartReport as SessionStartReport, type index_d_StatuslineData as StatuslineData, type index_d_StatuslineInstallResult as StatuslineInstallResult, type index_d_StatuslineProbes as StatuslineProbes, type index_d_UpdateCheckResult as UpdateCheckResult, type index_d_UpdateFileAction as UpdateFileAction, type index_d_UpdateFileActionKind as UpdateFileActionKind, type index_d_VortexHelpResult as VortexHelpResult, type index_d_VortexInitResult as VortexInitResult, type index_d_VortexPlannedResult as VortexPlannedResult, type index_d_VortexResult as VortexResult, type index_d_VortexSyncResult as VortexSyncResult, type index_d_VortexSyncStep as VortexSyncStep, type index_d_VortexSyncStepId as VortexSyncStepId, type index_d_VortexSyncStepStatus as VortexSyncStepStatus, type index_d_VortexUpdateResult as VortexUpdateResult, type index_d_WorklogAppendResult as WorklogAppendResult, index_d_agendaCommand as agendaCommand, index_d_aggregateHandoff as aggregateHandoff, index_d_applyGlobalSetup as applyGlobalSetup, index_d_argvToSlash as argvToSlash, index_d_autoReindexMemory as autoReindexMemory, index_d_buildDenyDecision as buildDenyDecision, index_d_buildInstallCommand as buildInstallCommand, index_d_buildOwnershipManifest as buildOwnershipManifest, index_d_buildRegistry as buildRegistry, index_d_catchUpSessions as catchUpSessions, index_d_checkBaseUpdate as checkBaseUpdate, index_d_collectAgenda as collectAgenda, index_d_collectCarryover as collectCarryover, index_d_collectSessionStartReport as collectSessionStartReport, index_d_collectStatuslineProbes as collectStatuslineProbes, index_d_compareSemver as compareSemver, index_d_computeCurateFingerprint as computeCurateFingerprint, index_d_countUncommitted as countUncommitted, index_d_createAmbientRecaller as createAmbientRecaller, index_d_createHandoffSkeleton as createHandoffSkeleton, index_d_createRitualRegistry as createRitualRegistry, index_d_curateCommand as curateCommand, index_d_decisionCommand as decisionCommand, index_d_detectInterruptedGitOp as detectInterruptedGitOp, index_d_detectWorklogGaps as detectWorklogGaps, index_d_effortMeter as effortMeter, index_d_ensureStatusline as ensureStatusline, index_d_ensureVortexHooks as ensureVortexHooks, index_d_ensureWorklogEntry as ensureWorklogEntry, index_d_extractNextUp as extractNextUp, index_d_extractOpenTasks as extractOpenTasks, index_d_failureReportSlice as failureReportSlice, index_d_findControlChar as findControlChar, index_d_formatTokens as formatTokens, index_d_formatWindow as formatWindow, index_d_gapWindowSinceArg as gapWindowSinceArg, index_d_globalMemoryPath as globalMemoryPath, index_d_globalSettingsHasHook as globalSettingsHasHook, index_d_globalSettingsPath as globalSettingsPath, index_d_globalStatePath as globalStatePath, index_d_guardWriteDecision as guardWriteDecision, index_d_handoffCommand as handoffCommand, index_d_inspectGlobalSetup as inspectGlobalSetup, index_d_inspectOwnership as inspectOwnership, index_d_isInstanceRoot as isInstanceRoot, index_d_isNewer as isNewer, index_d_isStableUpdate as isStableUpdate, index_d_isValidFailureKey as isValidFailureKey, index_d_ladderStage as ladderStage, index_d_logCommand as logCommand, index_d_makeBar as makeBar, index_d_ownershipManifestPath as ownershipManifestPath, index_d_parseAdoptArgs as parseAdoptArgs, index_d_parseSettings as parseSettings, index_d_parseStatuslineInput as parseStatuslineInput, index_d_pruneHandoffs as pruneHandoffs, index_d_queryNpmLatest as queryNpmLatest, index_d_readGlobalInstancePointer as readGlobalInstancePointer, index_d_readInstalledBaseVersion as readInstalledBaseVersion, index_d_recallCommand as recallCommand, index_d_recordFailure as recordFailure, index_d_recordGlobalSetupDecline as recordGlobalSetupDecline, index_d_recordGuardDenial as recordGuardDenial, index_d_reindexCommand as reindexCommand, index_d_renderAgenda as renderAgenda, index_d_renderGlobalBlock as renderGlobalBlock, index_d_renderSessionStartReport as renderSessionStartReport, index_d_renderStatusline as renderStatusline, index_d_repairOwnershipManifest as repairOwnershipManifest, index_d_resolveInstanceRoot as resolveInstanceRoot, index_d_resolveRepoRoot as resolveRepoRoot, index_d_runCurateAccept as runCurateAccept, index_d_runCurateCandidates as runCurateCandidates, index_d_runCurateDecline as runCurateDecline, index_d_runCuratePreview as runCuratePreview, index_d_runFailureCli as runFailureCli, index_d_runGuardCli as runGuardCli, index_d_runStatuslineCli as runStatuslineCli, index_d_runTemplatesUpdate as runTemplatesUpdate, index_d_runVortexCli as runVortexCli, index_d_safeSegment as safeSegment, index_d_scanFailures as scanFailures, index_d_scanHandoffs as scanHandoffs, index_d_scanToolInput as scanToolInput, index_d_serializeSettings as serializeSettings, index_d_sessionStartCommand as sessionStartCommand, index_d_sniffEffortFromTranscript as sniffEffortFromTranscript, index_d_statuslineCommand as statuslineCommand, index_d_templateDestRelPath as templateDestRelPath, index_d_upsertGlobalBlock as upsertGlobalBlock, index_d_validateCuratePayload as validateCuratePayload, index_d_vortexCommand as vortexCommand, index_d_writeOwnershipManifest as writeOwnershipManifest };
4262
4545
  }
4263
4546
 
4264
4547
  export { index_d$9 as aiCodingPitfalls, index_d$d as core, index_d$a as dataLint, index_d$5 as decisionLog, index_d$4 as indexGenerator, index_d$2 as linkRewriter, index_d$b as memorySystem, index_d$1 as proactiveCurator, index_d$7 as reportGenerator, index_d$3 as runbooks, index_d as sessionRituals, index_d$c as slashCommands, index_d$8 as toolRules, index_d$6 as worklog };