@vortex-os/base 0.11.0 → 0.12.1

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
  /**
@@ -3371,7 +3481,12 @@ interface StatuslineData {
3371
3481
  /** Reasoning effort level as reported (`effort.level`), or null. */
3372
3482
  readonly effortLevel: string | null;
3373
3483
  readonly transcriptPath: string | null;
3374
- /** Project directory (workspace.current_dir, falling back to cwd). */
3484
+ /**
3485
+ * Project ROOT directory. `workspace.project_dir` first — `current_dir` and
3486
+ * `cwd` FOLLOW the session shell as it `cd`s (measured), which made the bar
3487
+ * show a sibling repo and lose the VortEX line mid-session. The bar's
3488
+ * identity (project name, git, instance line) stays pinned to the project.
3489
+ */
3375
3490
  readonly dir: string | null;
3376
3491
  readonly contextWindowSize: number;
3377
3492
  /** Context used, percent — kept as reported (may be fractional). */
@@ -3432,8 +3547,23 @@ declare function renderStatusline(d: StatuslineData, p: StatuslineProbes, mode?:
3432
3547
  declare function sniffEffortFromTranscript(transcriptPath: string, maxBytes?: number): string | null;
3433
3548
  /** Collect every environment lookup the renderer needs for this input. */
3434
3549
  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;
3550
+ /**
3551
+ * The statusLine command written by `install`.
3552
+ *
3553
+ * The host runs the statusLine command in the session's CURRENT working
3554
+ * directory — which MOVES as the session `cd`s around (measured: the hook cwd
3555
+ * followed the shell into a sibling repo). Anything cwd-relative (bare `npx`
3556
+ * lookup, `./node_modules/...`) therefore silently resolves nothing the moment
3557
+ * the session leaves the project, and the bar just vanishes. So:
3558
+ * - with a local install (`directRoot`): invoke the bin by ABSOLUTE path —
3559
+ * immune to cwd, and ~0.5s faster per refresh than npx (the other observed
3560
+ * disappearing-bar mode: npx latency under load) — with the npx lookup
3561
+ * chained as a fallback for when the repo has moved;
3562
+ * - global-only installs: the npx form alone (cwd-sensitive, but there is no
3563
+ * local path to pin).
3564
+ * Always self-silencing (`|| exit 0`).
3565
+ */
3566
+ declare function statuslineCommand(lite: boolean, directRoot?: string): string;
3437
3567
  interface StatuslineInstallResult {
3438
3568
  readonly status: "installed" | "already-ours" | "kept-existing";
3439
3569
  readonly settingsPath: string;
@@ -3446,7 +3576,7 @@ interface StatuslineInstallResult {
3446
3576
  * statusLine that is not ours is kept (the user owns their bar) unless `force`.
3447
3577
  * Switching full↔lite of our own command counts as ours and is updated.
3448
3578
  */
3449
- declare function ensureStatusline(existing: ClaudeSettings, lite: boolean, force?: boolean): {
3579
+ declare function ensureStatusline(existing: ClaudeSettings, lite: boolean, force?: boolean, directRoot?: string): {
3450
3580
  settings: ClaudeSettings;
3451
3581
  status: StatuslineInstallResult["status"];
3452
3582
  existing?: string;
@@ -3458,6 +3588,139 @@ declare function ensureStatusline(existing: ClaudeSettings, lite: boolean, force
3458
3588
  */
3459
3589
  declare function runStatuslineCli(argv: readonly string[], repoRoot: string, out: (s: string) => void, err: (s: string) => void): Promise<number>;
3460
3590
 
3591
+ /**
3592
+ * Failure ledger (`data/_failures/`) — the evidence store of the
3593
+ * self-improvement loop.
3594
+ *
3595
+ * The problem this solves: behavioral rules live in `data/_memory/`, but a rule
3596
+ * loaded at session start is *passive knowledge* — at action time the model's
3597
+ * active context is full of the task and the rule slips. The documented result
3598
+ * is the same failure recurring despite a registered rule. The fix is not
3599
+ * another rule; it is a LEDGER that makes recurrence countable by a machine,
3600
+ * plus an escalation ladder that turns counts into stronger defenses:
3601
+ *
3602
+ * 1st occurrence → record (append-only file, one per occurrence)
3603
+ * 2nd (rule held) → the rule's write-time gate becomes MANDATORY
3604
+ * 3rd+ → propose promoting to a deterministic guard (hook /
3605
+ * pre-commit / wrapper) — always a PROPOSAL; the user
3606
+ * approves, nothing self-installs
3607
+ *
3608
+ * Design notes:
3609
+ * - One markdown file per occurrence (`YYYY-MM-DD_HHMM-<key>.md`), frontmatter
3610
+ * carries the machine-read fields; the body is for humans. Append-only —
3611
+ * resolving a pattern flips `status` on its entries, never deletes.
3612
+ * - `recurrence_key` is the grouping identity: a stable kebab-case name for
3613
+ * the ROOT CAUSE (e.g. `literal-control-bytes`), not the symptom of the day.
3614
+ * Same cause → same key, that is what makes counting honest.
3615
+ * - Recording is an agent ritual (auto, append-only, one-line note to the
3616
+ * user — AI-RULES "Default behaviors"); deterministic guards may also append
3617
+ * here directly so counting never depends on the failing agent noticing.
3618
+ * - The session-start report surfaces groups at 2+ open occurrences with their
3619
+ * ladder stage, so escalation never depends on human memory either.
3620
+ */
3621
+ /** Directory name under `data/` holding the ledger. */
3622
+ declare const FAILURES_DIR = "_failures";
3623
+ /** Ladder stages by open-occurrence count. */
3624
+ type LadderStage = "recorded" | "gate" | "promote";
3625
+ /** Stage for a given open-occurrence count (1 → recorded, 2 → gate, 3+ → promote). */
3626
+ declare function ladderStage(count: number): LadderStage;
3627
+ /** One ledger entry (one occurrence), as read back from disk. */
3628
+ interface FailureEntry {
3629
+ /** Path relative to the data dir (`_failures/2026-06-11_0210-….md`). */
3630
+ readonly relPath: string;
3631
+ readonly key: string;
3632
+ readonly title: string;
3633
+ readonly signal: string;
3634
+ readonly severity: string;
3635
+ readonly status: "open" | "resolved";
3636
+ /** `YYYY-MM-DD` from frontmatter `created` (falls back to the filename). */
3637
+ readonly date: string;
3638
+ /** Related rule (memory slug) named at record time, or null. */
3639
+ readonly rule: string | null;
3640
+ }
3641
+ /** All occurrences sharing a recurrence key, with the derived ladder stage. */
3642
+ interface FailureGroup {
3643
+ readonly key: string;
3644
+ /** OPEN occurrences only — resolved history no longer escalates. */
3645
+ readonly count: number;
3646
+ readonly stage: LadderStage;
3647
+ readonly lastDate: string;
3648
+ /** First non-null rule named across the group's entries. */
3649
+ readonly rule: string | null;
3650
+ readonly titles: readonly string[];
3651
+ readonly entries: readonly FailureEntry[];
3652
+ }
3653
+ interface FailureScan {
3654
+ /** Open groups, most occurrences first (ties: most recent first). */
3655
+ readonly groups: readonly FailureGroup[];
3656
+ readonly totalOpen: number;
3657
+ readonly totalResolved: number;
3658
+ }
3659
+ interface RecordFailureInput {
3660
+ /** Stable kebab-case root-cause key (`[a-z0-9-]`, 3..64 chars). */
3661
+ readonly key: string;
3662
+ /** One-line description of what happened. */
3663
+ readonly what: string;
3664
+ /** Signal class — free short token; conventional values: user_pushback, tool_error, test_failure, cross_check_miss, guard_denied, self_detected. */
3665
+ readonly signal?: string;
3666
+ /** low | medium | high (free token, those are the conventional values). */
3667
+ readonly severity?: string;
3668
+ /** Memory slug of the rule that already covered this (if any). */
3669
+ readonly rule?: string;
3670
+ /** Evidence pointers (paths, links) — recorded as a list in the body. */
3671
+ readonly evidence?: readonly string[];
3672
+ }
3673
+ interface RecordFailureResult {
3674
+ readonly path: string;
3675
+ readonly relPath: string;
3676
+ readonly key: string;
3677
+ /** Open occurrences for this key AFTER this record (i.e. includes it). */
3678
+ readonly count: number;
3679
+ readonly stage: LadderStage;
3680
+ /** Agent-facing one-liner explaining the ladder consequence of this count. */
3681
+ readonly note: string;
3682
+ }
3683
+ /** Validate a recurrence key: stable kebab-case, filename-safe by construction. */
3684
+ declare function isValidFailureKey(key: string): boolean;
3685
+ /**
3686
+ * Append one occurrence to the ledger. Creates `data/_failures/` on first use.
3687
+ * Never overwrites: a same-minute collision for the same key gets a numeric
3688
+ * suffix. Returns the post-write open count + ladder stage for the key so the
3689
+ * caller (agent) can relay "this is the Nth time" in its one-line note.
3690
+ */
3691
+ declare function recordFailure(dataDir: string, input: RecordFailureInput, now?: Date): Promise<RecordFailureResult>;
3692
+ declare function scanFailures(dataDir: string): Promise<FailureScan>;
3693
+ /** Compact, report-ready view: groups needing attention (2+ open occurrences). */
3694
+ interface FailureReportSlice {
3695
+ readonly warnings: readonly {
3696
+ readonly key: string;
3697
+ readonly count: number;
3698
+ readonly stage: LadderStage;
3699
+ readonly rule: string | null;
3700
+ readonly lastDate: string;
3701
+ }[];
3702
+ readonly totalOpen: number;
3703
+ readonly omitted: number;
3704
+ }
3705
+ /** Slice a scan down to what the session-start report shows (stage gate/promote only, capped). */
3706
+ declare function failureReportSlice(scan: FailureScan): FailureReportSlice;
3707
+ /** The fixed recurrence key for write-guard denials (one failure class → one key). */
3708
+ declare const GUARD_DENIAL_KEY = "literal-control-bytes";
3709
+ /**
3710
+ * Record a write-guard denial into the ledger — called by the guard itself, so
3711
+ * counting NEVER depends on the failing agent noticing and self-reporting
3712
+ * (the documented stall mode of self-report-only ledgers). Best-effort and
3713
+ * silent: returns null when skipped (recent same-incident entry, or any
3714
+ * error) — a ledger problem must never affect the deny itself.
3715
+ */
3716
+ declare function recordGuardDenial(dataDir: string, what: string, now?: Date): Promise<RecordFailureResult | null>;
3717
+ /**
3718
+ * Run the failure-ledger CLI. `record` appends one occurrence and reports the
3719
+ * post-write count + ladder stage (so the agent can relay "Nth time"); `list`
3720
+ * prints the grouped open ledger. Results are JSON on stdout.
3721
+ */
3722
+ declare function runFailureCli(argv: readonly string[], dataDir: string, out: (s: string) => void, err: (s: string) => void): Promise<number>;
3723
+
3461
3724
  interface ReindexResult {
3462
3725
  readonly dir: string;
3463
3726
  readonly status: "written" | "unchanged" | "missing";
@@ -4140,12 +4403,22 @@ type index_d_CurateResult = CurateResult;
4140
4403
  declare const index_d_DEFAULT_GAP_WINDOW_DAYS: typeof DEFAULT_GAP_WINDOW_DAYS;
4141
4404
  type index_d_EnsureHooksResult = EnsureHooksResult;
4142
4405
  type index_d_EnsureWorklogResult = EnsureWorklogResult;
4406
+ declare const index_d_FAILURES_DIR: typeof FAILURES_DIR;
4407
+ type index_d_FailureEntry = FailureEntry;
4408
+ type index_d_FailureGroup = FailureGroup;
4409
+ type index_d_FailureReportSlice = FailureReportSlice;
4410
+ type index_d_FailureScan = FailureScan;
4411
+ declare const index_d_GUARD_DENIAL_KEY: typeof GUARD_DENIAL_KEY;
4412
+ declare const index_d_GUARD_WRITE_COMMAND: typeof GUARD_WRITE_COMMAND;
4413
+ declare const index_d_GUARD_WRITE_MATCHER: typeof GUARD_WRITE_MATCHER;
4143
4414
  type index_d_GitPullResult = GitPullResult;
4415
+ type index_d_GuardFinding = GuardFinding;
4144
4416
  declare const index_d_HANDOFF_ARCHIVE_DIR: typeof HANDOFF_ARCHIVE_DIR;
4145
4417
  declare const index_d_HANDOFF_DIR: typeof HANDOFF_DIR;
4146
4418
  type index_d_HandoffCreateResult = HandoffCreateResult;
4147
4419
  type index_d_HandoffSummary = HandoffSummary;
4148
4420
  type index_d_HandoffWriteResult = HandoffWriteResult;
4421
+ type index_d_LadderStage = LadderStage;
4149
4422
  type index_d_NewDecisionResult = NewDecisionResult;
4150
4423
  declare const index_d_OWNERSHIP_SCHEMA: typeof OWNERSHIP_SCHEMA;
4151
4424
  type index_d_OpenDecision = OpenDecision;
@@ -4155,6 +4428,8 @@ type index_d_OwnershipEntry = OwnershipEntry;
4155
4428
  type index_d_OwnershipManifest = OwnershipManifest;
4156
4429
  type index_d_RecallOptions = RecallOptions;
4157
4430
  type index_d_RecentWorklog = RecentWorklog;
4431
+ type index_d_RecordFailureInput = RecordFailureInput;
4432
+ type index_d_RecordFailureResult = RecordFailureResult;
4158
4433
  type index_d_ReindexResult = ReindexResult;
4159
4434
  type index_d_RitualRegistryOptions = RitualRegistryOptions;
4160
4435
  declare const index_d_SESSION_END_COMMAND: typeof SESSION_END_COMMAND;
@@ -4182,6 +4457,7 @@ declare const index_d_aggregateHandoff: typeof aggregateHandoff;
4182
4457
  declare const index_d_applyGlobalSetup: typeof applyGlobalSetup;
4183
4458
  declare const index_d_argvToSlash: typeof argvToSlash;
4184
4459
  declare const index_d_autoReindexMemory: typeof autoReindexMemory;
4460
+ declare const index_d_buildDenyDecision: typeof buildDenyDecision;
4185
4461
  declare const index_d_buildInstallCommand: typeof buildInstallCommand;
4186
4462
  declare const index_d_buildOwnershipManifest: typeof buildOwnershipManifest;
4187
4463
  declare const index_d_buildRegistry: typeof buildRegistry;
@@ -4207,6 +4483,8 @@ declare const index_d_ensureVortexHooks: typeof ensureVortexHooks;
4207
4483
  declare const index_d_ensureWorklogEntry: typeof ensureWorklogEntry;
4208
4484
  declare const index_d_extractNextUp: typeof extractNextUp;
4209
4485
  declare const index_d_extractOpenTasks: typeof extractOpenTasks;
4486
+ declare const index_d_failureReportSlice: typeof failureReportSlice;
4487
+ declare const index_d_findControlChar: typeof findControlChar;
4210
4488
  declare const index_d_formatTokens: typeof formatTokens;
4211
4489
  declare const index_d_formatWindow: typeof formatWindow;
4212
4490
  declare const index_d_gapWindowSinceArg: typeof gapWindowSinceArg;
@@ -4214,12 +4492,15 @@ declare const index_d_globalMemoryPath: typeof globalMemoryPath;
4214
4492
  declare const index_d_globalSettingsHasHook: typeof globalSettingsHasHook;
4215
4493
  declare const index_d_globalSettingsPath: typeof globalSettingsPath;
4216
4494
  declare const index_d_globalStatePath: typeof globalStatePath;
4495
+ declare const index_d_guardWriteDecision: typeof guardWriteDecision;
4217
4496
  declare const index_d_handoffCommand: typeof handoffCommand;
4218
4497
  declare const index_d_inspectGlobalSetup: typeof inspectGlobalSetup;
4219
4498
  declare const index_d_inspectOwnership: typeof inspectOwnership;
4220
4499
  declare const index_d_isInstanceRoot: typeof isInstanceRoot;
4221
4500
  declare const index_d_isNewer: typeof isNewer;
4222
4501
  declare const index_d_isStableUpdate: typeof isStableUpdate;
4502
+ declare const index_d_isValidFailureKey: typeof isValidFailureKey;
4503
+ declare const index_d_ladderStage: typeof ladderStage;
4223
4504
  declare const index_d_logCommand: typeof logCommand;
4224
4505
  declare const index_d_makeBar: typeof makeBar;
4225
4506
  declare const index_d_ownershipManifestPath: typeof ownershipManifestPath;
@@ -4231,23 +4512,30 @@ declare const index_d_queryNpmLatest: typeof queryNpmLatest;
4231
4512
  declare const index_d_readGlobalInstancePointer: typeof readGlobalInstancePointer;
4232
4513
  declare const index_d_readInstalledBaseVersion: typeof readInstalledBaseVersion;
4233
4514
  declare const index_d_recallCommand: typeof recallCommand;
4515
+ declare const index_d_recordFailure: typeof recordFailure;
4234
4516
  declare const index_d_recordGlobalSetupDecline: typeof recordGlobalSetupDecline;
4517
+ declare const index_d_recordGuardDenial: typeof recordGuardDenial;
4235
4518
  declare const index_d_reindexCommand: typeof reindexCommand;
4236
4519
  declare const index_d_renderAgenda: typeof renderAgenda;
4237
4520
  declare const index_d_renderGlobalBlock: typeof renderGlobalBlock;
4238
4521
  declare const index_d_renderSessionStartReport: typeof renderSessionStartReport;
4239
4522
  declare const index_d_renderStatusline: typeof renderStatusline;
4240
4523
  declare const index_d_repairOwnershipManifest: typeof repairOwnershipManifest;
4524
+ declare const index_d_resolveInstanceRoot: typeof resolveInstanceRoot;
4241
4525
  declare const index_d_resolveRepoRoot: typeof resolveRepoRoot;
4242
4526
  declare const index_d_runCurateAccept: typeof runCurateAccept;
4243
4527
  declare const index_d_runCurateCandidates: typeof runCurateCandidates;
4244
4528
  declare const index_d_runCurateDecline: typeof runCurateDecline;
4245
4529
  declare const index_d_runCuratePreview: typeof runCuratePreview;
4530
+ declare const index_d_runFailureCli: typeof runFailureCli;
4531
+ declare const index_d_runGuardCli: typeof runGuardCli;
4246
4532
  declare const index_d_runStatuslineCli: typeof runStatuslineCli;
4247
4533
  declare const index_d_runTemplatesUpdate: typeof runTemplatesUpdate;
4248
4534
  declare const index_d_runVortexCli: typeof runVortexCli;
4249
4535
  declare const index_d_safeSegment: typeof safeSegment;
4536
+ declare const index_d_scanFailures: typeof scanFailures;
4250
4537
  declare const index_d_scanHandoffs: typeof scanHandoffs;
4538
+ declare const index_d_scanToolInput: typeof scanToolInput;
4251
4539
  declare const index_d_serializeSettings: typeof serializeSettings;
4252
4540
  declare const index_d_sessionStartCommand: typeof sessionStartCommand;
4253
4541
  declare const index_d_sniffEffortFromTranscript: typeof sniffEffortFromTranscript;
@@ -4258,7 +4546,7 @@ declare const index_d_validateCuratePayload: typeof validateCuratePayload;
4258
4546
  declare const index_d_vortexCommand: typeof vortexCommand;
4259
4547
  declare const index_d_writeOwnershipManifest: typeof writeOwnershipManifest;
4260
4548
  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 };
4549
+ 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
4550
  }
4263
4551
 
4264
4552
  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 };