its-magic 0.1.2-42 → 0.1.2-43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "its-magic",
3
- "version": "0.1.2-42",
3
+ "version": "0.1.2-43",
4
4
  "description": "its-magic - AI dev team workflow for Cursor.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -1,5 +1,11 @@
1
1
  #!/usr/bin/env python3
2
- """Verify active vs template/scripts/ bytes match for DEC-0063 intake gate modules (BUG-0001)."""
2
+ """Verify active vs template/scripts/ bytes match for DEC-0063 intake gate modules (BUG-0001).
3
+
4
+ Scoped modes (DEC-0073 §10 / US-0090):
5
+ --scope=intake (default) DEC-0063 intake pair table.
6
+ --scope=caveman-compress DEC-0073 caveman input-compression pair table.
7
+ --scope=all union of both tables.
8
+ """
3
9
 
4
10
  from __future__ import annotations
5
11
 
@@ -7,7 +13,6 @@ import argparse
7
13
  import sys
8
14
  from pathlib import Path
9
15
 
10
- # Normative pairs: repo scripts/ (canonical dev) → template/scripts/ (packaged ship path).
11
16
  INTAKE_TEMPLATE_PAIRS: tuple[tuple[str, str], ...] = (
12
17
  ("scripts/intake_evidence_validate.py", "template/scripts/intake_evidence_validate.py"),
13
18
  ("scripts/intake_evidence_lib.py", "template/scripts/intake_evidence_lib.py"),
@@ -16,6 +21,24 @@ INTAKE_TEMPLATE_PAIRS: tuple[tuple[str, str], ...] = (
16
21
  ("scripts/check_intake_template_parity.py", "template/scripts/check_intake_template_parity.py"),
17
22
  )
18
23
 
24
+ # DEC-0073 §10 / US-0090 — Caveman input-compression surface pairs. Contents
25
+ # must be byte-identical between active and template paths; installer delivers
26
+ # template copies (BUG-0003 / DEC-0066).
27
+ CAVEMAN_COMPRESS_PAIRS: tuple[tuple[str, str], ...] = (
28
+ ("scripts/caveman_compress_input.py", "template/scripts/caveman_compress_input.py"),
29
+ ("docs/engineering/context/installer-owned-paths.manifest",
30
+ "template/docs/engineering/context/installer-owned-paths.manifest"),
31
+ ("docs/engineering/runbook.md", "template/docs/engineering/runbook.md"),
32
+ ("docs/engineering/auto-orchestration-reference.md",
33
+ "template/docs/engineering/auto-orchestration-reference.md"),
34
+ )
35
+
36
+ SCOPES: dict[str, tuple[tuple[str, str], ...]] = {
37
+ "intake": INTAKE_TEMPLATE_PAIRS,
38
+ "caveman-compress": CAVEMAN_COMPRESS_PAIRS,
39
+ "all": INTAKE_TEMPLATE_PAIRS + CAVEMAN_COMPRESS_PAIRS,
40
+ }
41
+
19
42
 
20
43
  def main() -> int:
21
44
  p = argparse.ArgumentParser(description=__doc__)
@@ -25,10 +48,17 @@ def main() -> int:
25
48
  default=Path(__file__).resolve().parent.parent,
26
49
  help="Repository root",
27
50
  )
51
+ p.add_argument(
52
+ "--scope",
53
+ choices=sorted(SCOPES.keys()),
54
+ default="intake",
55
+ help="Parity pair table to verify.",
56
+ )
28
57
  args = p.parse_args()
29
58
  root: Path = args.repo
59
+ pairs = SCOPES[args.scope]
30
60
  failed = False
31
- for rel_active, rel_tpl in INTAKE_TEMPLATE_PAIRS:
61
+ for rel_active, rel_tpl in pairs:
32
62
  a = root / rel_active
33
63
  t = root / rel_tpl
34
64
  if not a.is_file() or not t.is_file():
@@ -45,7 +75,7 @@ def main() -> int:
45
75
  failed = True
46
76
  if failed:
47
77
  return 2
48
- print("[INTAKE_TEMPLATE_PARITY_OK]")
78
+ print(f"[INTAKE_TEMPLATE_PARITY_OK] scope={args.scope}")
49
79
  return 0
50
80
 
51
81
 
@@ -1,8 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- """Prepublish / CI guard: installer.sh LF + POSIX-safe startup tokens (US-0084 / AC-2).
3
-
4
- BUG-0008: reject CR bytes in installer-owned-paths.manifest (CRLF breaks POSIX awk section match).
5
- """
2
+ """Prepublish / CI guard: installer.sh LF + POSIX-safe startup tokens (US-0084 / AC-2)."""
6
3
 
7
4
  from __future__ import annotations
8
5
 
@@ -13,10 +10,6 @@ from pathlib import Path
13
10
 
14
11
  ROOT = Path(__file__).resolve().parents[1]
15
12
  INSTALLER_SH = ROOT / "installer.sh"
16
- INSTALLER_MANIFESTS = (
17
- ROOT / "docs" / "engineering" / "context" / "installer-owned-paths.manifest",
18
- ROOT / "template" / "docs" / "engineering" / "context" / "installer-owned-paths.manifest",
19
- )
20
13
 
21
14
  FORBIDDEN_TOKENS = (
22
15
  "set -euo",
@@ -39,17 +32,6 @@ def main() -> int:
39
32
  file=sys.stderr,
40
33
  )
41
34
  return 1
42
- for man in INSTALLER_MANIFESTS:
43
- if not man.is_file():
44
- continue
45
- mdata = man.read_bytes()
46
- if b"\r" in mdata:
47
- print(
48
- f"guard_installer_publish: CR/LF (\\r) bytes found in {man.relative_to(ROOT)} — "
49
- "use LF only (.gitattributes *.manifest; BUG-0008).",
50
- file=sys.stderr,
51
- )
52
- return 1
53
35
  text = data.decode("utf-8", errors="replace")
54
36
  for token in FORBIDDEN_TOKENS:
55
37
  if token in text:
@@ -0,0 +1,141 @@
1
+ ---
2
+ description: "Caveman mode (US-0089) — optional response-side terse voice, default off"
3
+ globs: ["**/*"]
4
+ ---
5
+
6
+ # Caveman mode (US-0089)
7
+
8
+ This rule composes an optional **response-side** terse / imperative assistant
9
+ voice. It is **default off**. When `CAVEMAN_MODE` is unset or `0`, this rule
10
+ adds **zero** behavioral change and the assistant responds exactly as it did
11
+ pre-US-0089.
12
+
13
+ Inspired by JuliusBrussee/caveman (MIT). External reference only; not vendored.
14
+
15
+ ## Scratchpad gate (authoritative across subagent spawns)
16
+
17
+ Read the merged scratchpad (`.cursor/scratchpad.md`, then optional
18
+ `.cursor/scratchpad.local.md` overrides per **DEC-0055**) for these keys:
19
+
20
+ - `CAVEMAN_MODE=0|1` — default `0`. Absence is equivalent to `0`.
21
+ - `CAVEMAN_LEVEL=lite|full|ultra` — default empty.
22
+ - With `CAVEMAN_MODE=0`: inert regardless of value.
23
+ - With `CAVEMAN_MODE=1` and `CAVEMAN_LEVEL` empty: treat as `full`
24
+ (mid-tier default, matching upstream reference).
25
+ - With `CAVEMAN_MODE=1` and a listed level: apply that level.
26
+ - With `CAVEMAN_MODE=1` and any other non-empty value: fail closed with
27
+ deterministic reason code `CAVEMAN_LEVEL_UNKNOWN` and fall back to
28
+ pre-US-0089 voice (no terseness applied) while continuing the turn.
29
+ - `CAVEMAN_COMPRESS_INPUT=0|1` — **reserved for US-0090**; inert in US-0089;
30
+ no behavior until the compression story ships.
31
+ - `CAVEMAN_FILE_SCOPE=` — **reserved for US-0090**; inert in US-0089; no
32
+ behavior until the compression story ships.
33
+
34
+ Scratchpad values are **authoritative across subagent spawns**. Session
35
+ toggle phrases (see below) are overlays for the current conversation only
36
+ and do NOT persist across a fresh subagent context.
37
+
38
+ ## Literal-region invariant (9-zone hard MUST)
39
+
40
+ When `CAVEMAN_MODE=1`, the following output regions remain **byte-literal**
41
+ (no abbreviation, no rewording, no casing change). This rule is phrased as
42
+ **MUST**, not SHOULD:
43
+
44
+ 1. **Fenced code blocks** — both plain triple-backtick blocks and CODE
45
+ REFERENCE blocks of the form `startLine:endLine:filepath`. Content, line
46
+ numbers, filepath, language tags, and whitespace preserved.
47
+ 2. **File / path strings** — anything matching
48
+ `` `[\w./-]+\.(md|py|ps1|sh|json|mdc|ts|tsx|js|jsx|yml|yaml|toml|ini|env|example|manifest)` ``
49
+ or enclosed in backticks that points to a repo path. Preserve extension
50
+ and case.
51
+ 3. **AC checklist items** — bullets of form `- [ ]` or `- [x]` and their
52
+ entire text (AC-1..AC-N).
53
+ 4. **Reason codes** — `ALL_CAPS_WITH_UNDERSCORES` tokens such as
54
+ `PHASE_CONTEXT_ISOLATION_VIOLATION`, `RUNTIME_PROOF_MISSING`,
55
+ `AUTO_RESUME_ERROR`, `AUTO_SCHEDULER_CONFLICT`, `REMOTE_TARGET_UNKNOWN`,
56
+ `CAVEMAN_LEVEL_UNKNOWN`, `INTAKE_PERSISTENCE_BLOCKED`.
57
+ 5. **IDs** — `US-xxxx`, `DEC-xxxx`, `R-xxxx`, `BUG-####`, `S0xxx`, `T-xxx`.
58
+ 6. **Contract markers** — `[BUG_VALIDATION_OK]`,
59
+ `[INTAKE_EVIDENCE_VALIDATION_OK]`, `[SCRATCHPAD_PAIR_OK]`,
60
+ `[ARTIFACT_ORDERING_ANCHOR_AMBIGUOUS]`, `[CODEBASE_MAP_OK]`, and siblings.
61
+ 7. **Strict-proof tuple fields** — `orchestrator_run_id`, `runtime_proof_id`,
62
+ `proof_hash`, `proof_issued_at`, `proof_ttl_seconds`, `phase_id`, `role`
63
+ (DEC-0038).
64
+ 8. **Isolation evidence fields** — `fresh_context_marker`, `evidence_ref`,
65
+ `timestamp` (DEC-0029).
66
+ 9. **Commit / git refs** — quoted `git commit` messages, branch names, SHAs,
67
+ `HEAD`, tag names.
68
+
69
+ Forbidden "garbling" examples (never permitted even under `ultra`): dropping
70
+ the `US-` prefix from an ID, lowercasing a reason code, collapsing a fenced
71
+ code block into a bullet, truncating a path mid-filename, abbreviating a
72
+ proof hash.
73
+
74
+ ## Non-suppressible gate vocabulary (inherited from US-0088)
75
+
76
+ Caveman voice MUST NOT remove or abbreviate the following gate tokens — they
77
+ render byte-literal even under `CAVEMAN_LEVEL=ultra`:
78
+
79
+ - `decision_gate`
80
+ - `error`
81
+ - `pause`
82
+ - `loop_max`
83
+ - `blocked`
84
+ - `missing input`
85
+ - `[BUG_VALIDATION_OK]`
86
+ - `[INTAKE_EVIDENCE_VALIDATION_OK]`
87
+ - `[SCRATCHPAD_PAIR_OK]`
88
+
89
+ ## Operator toggle phrases (canonical set)
90
+
91
+ | Phrase | Effect |
92
+ |--------|--------|
93
+ | `caveman on` | Enable Caveman voice for the session (overlay). Effective from the next assistant turn. |
94
+ | `caveman off` | Disable Caveman voice for the session (overlay). Effective from the next assistant turn. |
95
+ | `stop caveman` | Alias for `caveman off`. |
96
+ | `normal mode` | Alias for `caveman off`. |
97
+ | `caveman: lite|full|ultra` | Set level for the session (implies `caveman on`). Effective from the next assistant turn. Accepts the three literal tokens `caveman: lite`, `caveman: full`, `caveman: ultra`. |
98
+
99
+ Determinism rules:
100
+
101
+ - Scratchpad `CAVEMAN_MODE` / `CAVEMAN_LEVEL` are **authoritative across
102
+ subagent spawns**; session toggles are overlays for the current
103
+ conversation only and do NOT persist across a fresh subagent context.
104
+ - Within a session, the **last explicit toggle wins**.
105
+ - A mid-turn toggle applies **from the next turn onward**; current-turn
106
+ machine-verifiable artifacts (gate messages, reason codes, strict-proof
107
+ tuples, isolation-evidence fields) remain literal regardless of the
108
+ toggle.
109
+ - Ambiguous phrases (`be caveman-lite`, `quiet caveman`, `cave man off`,
110
+ etc.) are **not recognized** — only the exact literal matches above fire.
111
+
112
+ ## Composition (non-substitution) with TOKEN_PROFILE
113
+
114
+ `TOKEN_PROFILE` controls context breadth. `CAVEMAN_MODE` controls reply
115
+ voice. Neither substitutes for the other; setting one does not change the
116
+ other. Combine freely.
117
+
118
+ ## Default-off invariant
119
+
120
+ With `CAVEMAN_MODE=0` or absent, this rule adds zero behavioral change:
121
+ existing command strings, gate ordering, spawn-only phrasing (BUG-0006),
122
+ contract-test token lists, `AUTO_QUIET` non-suppressible vocabulary
123
+ (US-0088), user-visible ID metadata (US-0071), strict-proof tuples
124
+ (DEC-0038), and isolation evidence fields (DEC-0029) all remain unchanged.
125
+
126
+ ## Non-goals (US-0089)
127
+
128
+ - No input-side file compression. `CAVEMAN_COMPRESS_INPUT` and
129
+ `CAVEMAN_FILE_SCOPE` are documented no-ops here; US-0090 owns that
130
+ vertical.
131
+ - No change to `TOKEN_PROFILE` (DEC-0035 / US-0080), context packs, archive
132
+ policy, or phase-context slimming.
133
+ - No rewrite of canonical artifacts (`docs/product/backlog.md`,
134
+ `docs/product/acceptance.md`, `docs/engineering/state.md` schema,
135
+ `docs/engineering/decisions.md`, DEC files).
136
+ - No new npm / Python dependencies. No `package.json` edit.
137
+ - No vendor plugin install. No package-manager install recipe is surfaced;
138
+ the JuliusBrussee/caveman reference is documentation-only.
139
+ - No change to spawn-only orchestration (US-0048 / DEC-0029 / BUG-0006),
140
+ strict runtime proof (DEC-0038), `AUTO_QUIET` non-suppressible list
141
+ (US-0088), or US-0071 visible-metadata rules.