@isaacriehm/cairn-core 0.10.3 → 0.10.4

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.
@@ -11,7 +11,13 @@ import type { StatusJson } from "./index.js";
11
11
  * bypass_count > 0 → `⚠ N unattested`
12
12
  * attention_count > 0 → `⚑ N pending` (drafts + baseline findings + drift)
13
13
  * gc_running → `◐ gc`
14
- * task_state != idle → `${task_id} ${task_module}` (or fallbacks)
14
+ * task_state != idle → `<short_id> · <short_title>` capped at 45 chars
15
+ *
16
+ * Task display strips the slug from `task_id` (`TSK-<slug>-<7hex>`
17
+ * → `TSK-<7hex>`) and ellipsis-truncates `task_module` so a 14"
18
+ * MacBook Pro terminal stays inside one row. The full id remains the
19
+ * canonical reference on disk + via the lens — the statusline is for
20
+ * human-glance only.
15
21
  *
16
22
  * Ctx meter is omitted when no payload is supplied. Color thresholds are
17
23
  * keyed on absolute used tokens (not percentage) so a 1M-window Opus
@@ -37,6 +43,21 @@ export interface MissionCursorInput {
37
43
  done: number;
38
44
  total: number;
39
45
  }
46
+ /**
47
+ * Strip the slug from a `TSK-<slug>-<7hex>` id, keeping the prefix +
48
+ * trailing 7-hex hash. Falls back to a generic ellipsis-truncate when
49
+ * the id does not match the canonical shape (defensive — should not
50
+ * happen for ids the server allocates, but external/legacy ids may
51
+ * leak through).
52
+ */
53
+ export declare function shortenTaskId(taskId: string): string;
54
+ /**
55
+ * Compose the task signal segment. Both the id and the module/title
56
+ * are size-bounded; either may be null. Returns null when both are
57
+ * absent so the caller can fall through to a generic `task: <state>`
58
+ * placeholder.
59
+ */
60
+ export declare function renderTaskSegment(taskId: string | null, taskModule: string | null): string | null;
40
61
  export declare function renderMissionSegment(m: MissionCursorInput): string;
41
62
  export declare function renderCtxMeter(ctx: CtxMeterInput): string;
42
63
  export declare function formatStatus(s: StatusJson, ctx?: CtxMeterInput, progress?: ProgressSnapshot | null, nowMs?: number, mission?: MissionCursorInput | null): string;
@@ -1,5 +1,44 @@
1
1
  import { activeEvent, summaryCounterText } from "./event-queue.js";
2
2
  const MISSION_SEGMENT_BUDGET = 40;
3
+ const TASK_SEGMENT_BUDGET = 45;
4
+ /**
5
+ * Strip the slug from a `TSK-<slug>-<7hex>` id, keeping the prefix +
6
+ * trailing 7-hex hash. Falls back to a generic ellipsis-truncate when
7
+ * the id does not match the canonical shape (defensive — should not
8
+ * happen for ids the server allocates, but external/legacy ids may
9
+ * leak through).
10
+ */
11
+ export function shortenTaskId(taskId) {
12
+ const m = taskId.match(/^TSK-.+-([0-9a-f]{7})$/);
13
+ if (m && m[1] !== undefined)
14
+ return `TSK-${m[1]}`;
15
+ return taskId.length > 14 ? `${taskId.slice(0, 13)}…` : taskId;
16
+ }
17
+ /**
18
+ * Compose the task signal segment. Both the id and the module/title
19
+ * are size-bounded; either may be null. Returns null when both are
20
+ * absent so the caller can fall through to a generic `task: <state>`
21
+ * placeholder.
22
+ */
23
+ export function renderTaskSegment(taskId, taskModule) {
24
+ const id = taskId !== null && taskId.length > 0 ? shortenTaskId(taskId) : null;
25
+ const sep = " · ";
26
+ if (id !== null && taskModule !== null && taskModule.length > 0) {
27
+ const moduleBudget = Math.max(8, TASK_SEGMENT_BUDGET - id.length - sep.length);
28
+ const mod = taskModule.length > moduleBudget
29
+ ? `${taskModule.slice(0, moduleBudget - 1)}…`
30
+ : taskModule;
31
+ return `${id}${sep}${mod}`;
32
+ }
33
+ if (id !== null)
34
+ return id;
35
+ if (taskModule !== null && taskModule.length > 0) {
36
+ return taskModule.length > TASK_SEGMENT_BUDGET
37
+ ? `${taskModule.slice(0, TASK_SEGMENT_BUDGET - 1)}…`
38
+ : taskModule;
39
+ }
40
+ return null;
41
+ }
3
42
  export function renderMissionSegment(m) {
4
43
  const counter = `(${m.done}/${m.total})`;
5
44
  const fixed = ` · ${m.phase_id} ${counter}`;
@@ -100,12 +139,9 @@ function renderSignal(s, progress, nowMs = Date.now()) {
100
139
  if (s.gc_running)
101
140
  return "◐ gc";
102
141
  if (s.task_state !== "idle") {
103
- if (s.task_id && s.task_module)
104
- return `${s.task_id} ${s.task_module}`;
105
- if (s.task_id)
106
- return s.task_id;
107
- if (s.task_module)
108
- return s.task_module;
142
+ const seg = renderTaskSegment(s.task_id ?? null, s.task_module ?? null);
143
+ if (seg !== null)
144
+ return seg;
109
145
  return `task: ${s.task_state}`;
110
146
  }
111
147
  // Roll-up from the session-cumulative counters. Persists across the
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/status-line/format.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA2CnE,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAM,UAAU,oBAAoB,CAAC,CAAqB;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC;IACzC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,QAAQ,IAAI,OAAO,EAAE,CAAC;IAC5C,gDAAgD;IAChD,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5E,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACzF,OAAO,KAAK,IAAI,GAAG,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,WAAW,GAAG,UAAU,CAAC;AAC/B,MAAM,WAAW,GAAG,gBAAgB,CAAC;AACrC,MAAM,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AI,CAAC,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,mBAAmB,IAAI,CAAC,CAAC,CAAC;IACpD,IAAI,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,CAAa,EACb,GAAmB,EACnB,QAAkC,EAClC,QAAgB,IAAI,CAAC,GAAG,EAAE,EAC1B,OAAmC;IAEnC,MAAM,KAAK,GAAa,CAAC,SAAS,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,EAAE,QAAQ,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC;IACxD,IAAI,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,OAAO;QAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,IAAI,GAAG;QAAE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isaacriehm/cairn-core",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "description": "Cairn core — state + context layer. Curated `.cairn/ground/` (decisions, §INV invariants, canonical-map, brand, quality-grades), MCP server, init wizard, hook runners, sensors, GC drift sweep.",
5
5
  "author": "Isaac Riehm",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "simple-git": "^3.36.0",
40
40
  "yaml": "^2.8.4",
41
41
  "zod": "^4.4.3",
42
- "@isaacriehm/cairn-state": "0.10.3"
42
+ "@isaacriehm/cairn-state": "0.10.4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/cli-progress": "^3.11.6",
@@ -1,47 +1,28 @@
1
1
  # Cairn — read this on every session
2
2
 
3
- This project is **adopted by [Cairn](https://github.com/isaacriehm/cairn)** —
4
- a state + context-loading layer for AI coding agents. The `.cairn/`
5
- directory at the project root carries decisions, invariants, brand,
6
- canonical-map, and sensor configuration that govern code changes
7
- here.
8
-
9
- ## If the Cairn plugin is NOT installed
10
-
11
- Run an availability probe at session start:
12
-
13
- - Check whether any `mcp__plugin_cairn_cairn__cairn_*` MCP tools are
14
- visible in your tool list (or whether the `cairn-direction` /
15
- `cairn-attention` skills are listed).
16
- - If **none** are visible, the operator is missing the plugin. On the
17
- operator's first reply this session, surface:
18
-
19
- > This repo is adopted by Cairn but the Cairn plugin isn't installed
20
- > in your Claude Code yet. Install it once per machine:
21
- >
22
- > ```
23
- > /plugin marketplace add isaacriehm/cairn
24
- > /plugin install cairn@isaacriehm-cairn
25
- > ```
26
- >
27
- > Then `/exit` and reopen Claude Code. Cairn will auto-bootstrap this
28
- > clone (wire git hooks, load ground state) on the next session.
29
-
30
- Don't continue with code changes until the plugin is present —
31
- source mutations without Cairn skip attestation and bypass the
32
- decisions/invariants the project enforces.
33
-
34
- ## If the Cairn plugin IS installed
35
-
36
- The plugin's SessionStart hook injects ground-state context, the
37
- `cairn-direction` skill tightens code-change requests, and the
38
- `cairn-attention` skill drains pending DEC drafts. Defer to those
39
- surfaces; this file is a fallback for the plugin-absent case.
40
-
41
- ## Why this file exists
42
-
43
- Plain Claude Code on a teammate's clone doesn't auto-discover Cairn.
44
- Without this rule file, opening a Cairn-adopted repo without the
45
- plugin gets a generic "Hey what's up?" reply with no signal that the
46
- project has decisions/invariants in scope. This file primes Claude
47
- to advise the install, regardless of plugin state.
3
+ This project is adopted by [Cairn](https://github.com/isaacriehm/cairn).
4
+ The `.cairn/` directory carries decisions, invariants, brand, canonical-map,
5
+ and sensor configuration that govern code changes here.
6
+
7
+ ## Plugin probe
8
+
9
+ If you cannot see `mcp__plugin_cairn_cairn__cairn_*` MCP tools or the
10
+ `cairn-direction` / `cairn-attention` skills, the operator is missing
11
+ the plugin. Surface on the first reply:
12
+
13
+ > Cairn plugin not installed. Run once per machine:
14
+ >
15
+ > ```
16
+ > /plugin marketplace add isaacriehm/cairn
17
+ > /plugin install cairn@isaacriehm-cairn
18
+ > ```
19
+ >
20
+ > Then `/exit` and reopen. Auto-bootstrap fires on the next session.
21
+
22
+ Do not continue code changes until the plugin is present — source
23
+ mutations without Cairn skip attestation and bypass the
24
+ decisions/invariants the project enforces.
25
+
26
+ When the plugin IS installed, defer entirely to its SessionStart
27
+ context block, `cairn-direction`, and `cairn-attention` surfaces.
28
+ This file is the fallback for the plugin-absent case.