instar 1.3.1104 → 1.3.1105

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.
@@ -106,7 +106,7 @@ export function parseSafeYaml(input) {
106
106
  if (seqLines.length > 0 && seqLines.length === childLines.filter((l) => l.trim()).length) {
107
107
  const arr = [];
108
108
  for (const sl of seqLines) {
109
- const item = sl.replace(/^\s*-\s+/, '').trim();
109
+ const item = stripInlineComment(sl.replace(/^\s*-\s+/, '').trim()).trim();
110
110
  const v = parseScalar(item);
111
111
  if (typeof v !== 'string' && typeof v !== 'number' && typeof v !== 'boolean') {
112
112
  return { ok: false, error: `unsupported sequence item at "${key}"` };
@@ -139,8 +139,43 @@ export function parseSafeYaml(input) {
139
139
  }
140
140
  return { ok: true, data };
141
141
  }
142
+ /**
143
+ * Strip a YAML inline comment from a scalar value.
144
+ *
145
+ * YAML starts a comment at a `#` that is at the start of the value or preceded
146
+ * by whitespace, and never inside a quoted scalar. Before this existed, the
147
+ * parser kept the whole rest of the line, so
148
+ *
149
+ * approved: true # operator preapproval, topic 11960
150
+ *
151
+ * parsed as the STRING `"true # operator preapproval, topic 11960"`, and every
152
+ * gate testing `data.approved === true` silently concluded the spec was NOT
153
+ * approved. The comment that RECORDED the approval was what voided it.
154
+ *
155
+ * Deliberately conservative — a `#` not preceded by whitespace is part of the
156
+ * value (`url: http://host/p#frag`), and a `#` inside quotes is content.
157
+ */
158
+ function stripInlineComment(raw) {
159
+ let inStr = null;
160
+ for (let i = 0; i < raw.length; i++) {
161
+ const ch = raw[i];
162
+ if (inStr) {
163
+ if (ch === inStr)
164
+ inStr = null;
165
+ continue;
166
+ }
167
+ if (ch === '"' || ch === "'") {
168
+ inStr = ch;
169
+ continue;
170
+ }
171
+ if (ch === '#' && (i === 0 || /\s/.test(raw[i - 1]))) {
172
+ return raw.slice(0, i).replace(/\s+$/, '');
173
+ }
174
+ }
175
+ return raw;
176
+ }
142
177
  function parseInlineValue(raw) {
143
- const trimmed = raw.trim();
178
+ const trimmed = stripInlineComment(raw.trim()).trim();
144
179
  if (trimmed.startsWith('!')) {
145
180
  return { ok: false, error: 'YAML tags are not permitted' };
146
181
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SafeYaml.js","sourceRoot":"","sources":["../../src/core/SafeYaml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,SAAS,GAAG,IAAI,CAAC;AAYvB;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAc;IAEd,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACtE,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC7C,CAAC;IACD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAC7B,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,gCAAgC,EAAE,CAAC;IACtF,CAAC;IACD,0EAA0E;IAC1E,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,EAAE,CAAC;QAC9B,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC7C,CAAC;IACD,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,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a0c6ef9ba2bda876b509d1c0bfebe450da3708cd5a5d627d6cb836012d58",
5
- "packageVersion": "1.3.1104",
5
+ "packageVersion": "1.3.1105",
6
6
  "guards": [
7
7
  {
8
8
  "ref": "docs/canonical-migration-contracts.json",
@@ -1,5 +1,5 @@
1
1
  {
2
- "sha256": "df7bf3346549230693cf23ef0a622e04298755308c8d142bf96014a87804d9e2",
2
+ "sha256": "15077c901800bcc841ad958a8a3268c271e7022484597215ee31c85c02f7ebbe",
3
3
  "registrySha256": "5413a0c6ef9ba2bda876b509d1c0bfebe450da3708cd5a5d627d6cb836012d58",
4
- "packageVersion": "1.3.1104"
4
+ "packageVersion": "1.3.1105"
5
5
  }
@@ -2,5 +2,5 @@
2
2
  "sha256": "5413a0c6ef9ba2bda876b509d1c0bfebe450da3708cd5a5d627d6cb836012d58",
3
3
  "articleCount": 82,
4
4
  "generatedFrom": "docs/STANDARDS-REGISTRY.md",
5
- "packageVersion": "1.3.1104"
5
+ "packageVersion": "1.3.1105"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.1104",
3
+ "version": "1.3.1105",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-08-01T18:31:54.310Z",
5
- "instarVersion": "1.3.1104",
4
+ "generatedAt": "2026-08-01T18:38:43.377Z",
5
+ "instarVersion": "1.3.1105",
6
6
  "entryCount": 202,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "generatedFrom": "source-tree",
4
4
  "registrySha256": "5413a0c6ef9ba2bda876b509d1c0bfebe450da3708cd5a5d627d6cb836012d58",
5
- "packageVersion": "1.3.1104",
5
+ "packageVersion": "1.3.1105",
6
6
  "guards": [
7
7
  {
8
8
  "ref": "docs/canonical-migration-contracts.json",
@@ -1,5 +1,5 @@
1
1
  {
2
- "sha256": "df7bf3346549230693cf23ef0a622e04298755308c8d142bf96014a87804d9e2",
2
+ "sha256": "15077c901800bcc841ad958a8a3268c271e7022484597215ee31c85c02f7ebbe",
3
3
  "registrySha256": "5413a0c6ef9ba2bda876b509d1c0bfebe450da3708cd5a5d627d6cb836012d58",
4
- "packageVersion": "1.3.1104"
4
+ "packageVersion": "1.3.1105"
5
5
  }
@@ -2,5 +2,5 @@
2
2
  "sha256": "5413a0c6ef9ba2bda876b509d1c0bfebe450da3708cd5a5d627d6cb836012d58",
3
3
  "articleCount": 82,
4
4
  "generatedFrom": "docs/STANDARDS-REGISTRY.md",
5
- "packageVersion": "1.3.1104"
5
+ "packageVersion": "1.3.1105"
6
6
  }
@@ -0,0 +1,49 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ A spec whose approval was documented on the `approved:` line was silently unapproved. The frontmatter parser did not strip YAML inline comments, so
9
+
10
+ ```yaml
11
+ approved: true # operator authenticated preapproval, topic 11960, 2026-07-11
12
+ ```
13
+
14
+ parsed as the **string** `"true # operator authenticated preapproval, topic 11960, 2026-07-11"`. Every consumer testing `data.approved === true` — `StageTransitionValidator` above all — correctly concluded the flag was not `true` and refused the transition with `APPROVED_FLAG_MISSING`, on a file that visibly reads `approved: true`. The comment that recorded the approval was what voided it.
15
+
16
+ This adds `stripInlineComment()` in `src/core/SafeYaml.ts`, applied at **both** sites that interpret a scalar: `parseInlineValue` (`key: value # note`) and the block-sequence item path (`- item # note`). The identical defect existed in both; fixing only the one that surfaced would have left the class half-open.
17
+
18
+ The stripping is deliberately conservative, following the YAML rule rather than a looser one: a `#` begins a comment only at value-start or when preceded by whitespace, and never inside quotes. So `url: http://host/page#section` and `title: "sharp # sign"` are untouched. An earlier sketch cut at the first `#` unconditionally, which would have silently truncated URLs — that boundary is now the explicitly-tested half of the change.
19
+
20
+ Ordering note: the strip runs *before* the tag / anchor / flow-sequence checks in `parseInlineValue`, so `tags: [a, b] # note` no longer fails the `endsWith(']')` test and fall through to being read as a plain string. It cannot shadow the security rejections, because a value that *starts* with `!`, `&` or `*` is unaffected by comment-stripping.
21
+
22
+ Measured on `main` (53c2140b): 559 specs carry frontmatter, 522 carry an `approved:` line, and **9 of those carry an inline comment on it** — 1.7%. Those nine are not a random sample; they are the specs whose approvals were documented most carefully, which is what makes the failure mode worth closing at the parser rather than by hand-editing nine files.
23
+
24
+ ## What to Tell Your User
25
+
26
+ Nothing changes in how you work with me, and there is nothing for you to do.
27
+
28
+ If you have ever approved a design document by marking it approved and writing a short note on the same line saying who approved it and when, that note quietly cancelled the approval. The part of me that checks for approvals read the whole line as text instead of reading the yes-or-no answer, so it decided the document was never approved. The document said approved on screen and the checker disagreed, which made it look like nothing was wrong anywhere.
29
+
30
+ Nine documents were sitting in that state. They were not a random nine out of the five hundred that carry an approval mark. They were the ones where somebody took the trouble to record who approved it and when, which is the careful thing to do and was exactly what broke them.
31
+
32
+ That is now fixed, so those approvals count again and any future one written the same way will work. A note written next to a setting no longer swallows the setting.
33
+
34
+ ## Summary of New Capabilities
35
+
36
+ | Capability | How to Use |
37
+ |-----------|-----------|
38
+ | An approval marked with an explanatory note on the same line now counts as a real approval | Nothing to do — write the note however reads best, it no longer cancels the setting |
39
+ | Notes written beside any setting in a document header are ignored rather than swallowing the value | Nothing to do — applies to every setting, not only approvals |
40
+
41
+ ## Evidence
42
+
43
+ - **The bug, reproduced against the shipped parser before fixing:** loading `parseSafeYaml` from the installed dist and parsing `docs/specs/audit-convergence-enforcement.md` returned `approved` as `typeof string`, with `=== true` false, so the gate's verdict was `APPROVED_FLAG_MISSING`.
44
+ - **The fix, proved end-to-end on that same real file:** `approved` now parses as `true` (`typeof boolean`), with `approved-by` and `approved-date` intact — it passes the approved-flag gate it previously failed.
45
+ - **Test falsification, not assumption:** 13 new cases in `tests/unit/SafeYaml-inline-comments.test.ts`. Reverting `src/core/SafeYaml.ts` to its pre-change state and re-running gives **8 failed / 5 passed**. The 5 that pass either way are the conservative guards (URL fragment, `#` in double quotes, `#` in single quotes, `#` with no preceding space, no-comment values) — they prove existing behaviour is unchanged, and a test that passed without the fix would have proved nothing.
46
+ - **Every downstream consumer re-run green:** `StageTransitionValidator` (53), `ProjectRoundRunner` (27), `PlanDocParser` (9), `ProjectAutoAdvancePoller` (10), `convergence-gate-consistency` (23), `projects-advance-mergebase-wiring` (5), `spec-review-publish` (11) — **138 passed, 0 failed**.
47
+ - **`npx tsc --noEmit`** — clean.
48
+
49
+ Known limitation, flagged rather than fixed: escaped quotes inside a quoted scalar (`desc: 'it''s # here'`) would mis-track quote state. `parseScalar` already does no escape processing — it slices the outer quotes verbatim — so this is a pre-existing property of the deliberately narrow schema, not a regression, and no spec in the tree uses that shape.
@@ -0,0 +1,180 @@
1
+ # Side-Effects Review — YAML inline comments in frontmatter values
2
+
3
+ **Version / slug:** `safeyaml-inline-comments`
4
+ **Date:** `2026-08-01`
5
+ **Author:** `Echo (instar-dev agent)`
6
+ **Second-pass reviewer:** `not required (Tier 1)`
7
+
8
+ ## Summary of the change
9
+
10
+ `src/core/SafeYaml.ts` did not strip YAML inline comments, so `approved: true # operator
11
+ preapproval, topic 11960` parsed as the STRING `"true # operator preapproval, topic 11960"`
12
+ rather than the boolean `true`. Every consumer testing `data.approved === true` therefore
13
+ concluded the spec was NOT approved — on a file that visibly reads `approved: true`. This
14
+ adds one helper, `stripInlineComment`, applied at the two sites where a scalar is
15
+ interpreted: `parseInlineValue` (`key: value # note`) and the block-sequence item path
16
+ (`- item # note`). Files touched: `src/core/SafeYaml.ts` (+39 LOC incl. its explanatory
17
+ comment) and a new `tests/unit/SafeYaml-inline-comments.test.ts` (13 cases).
18
+
19
+ ## Decision-point inventory
20
+
21
+ The parser itself makes no policy decision — it produces the values that decision points
22
+ read. It is upstream of three consumers, all pass-through here:
23
+
24
+ - `StageTransitionValidator` (`data.approved !== true` → `APPROVED_FLAG_MISSING`) — pass-through — receives a boolean where it previously received a string; its own logic is unchanged.
25
+ - `PlanDocParser` — pass-through — no approval surface; reads plan frontmatter.
26
+ - `ProjectRoundRunner` — pass-through — reads convergence/round frontmatter.
27
+
28
+ ---
29
+
30
+ ## 1. Over-block
31
+
32
+ **What legitimate inputs does this change reject that it shouldn't?**
33
+
34
+ None — the change removes characters from a value, it never rejects a document. The
35
+ equivalent risk is *over-stripping*: silently truncating a value that legitimately contains
36
+ `#`. Two concrete shapes were identified and are explicitly preserved:
37
+
38
+ - `url: http://host/page#section` — a `#` with no preceding whitespace is part of the value. Truncating here would corrupt a URL to `http://host/page` with no error.
39
+ - `title: "sharp # sign"` and `title: 'sharp # sign'` — a `#` inside quotes is content.
40
+
41
+ Both are covered by tests that pass before AND after the change (regression guards).
42
+
43
+ ---
44
+
45
+ ## 2. Under-block
46
+
47
+ **What failure modes does this still miss?**
48
+
49
+ - **Escaped quotes inside quoted scalars.** `desc: 'it''s # not a comment'` — the scanner treats the doubled `''` as close-then-open and would mis-track quote state. The pre-existing `parseScalar` does no escape processing either (it slices the outer quotes verbatim), so this is a pre-existing limitation of the narrow schema, not a new one. No spec in the tree uses escaped quotes in frontmatter.
50
+ - **A `#` preceded by a tab inside an otherwise unquoted value** is treated as a comment start (`/\s/` matches tab). That matches YAML.
51
+ - **Multi-line block scalars (`|`, `>`)** are untouched: comments are not stripped from block-scalar bodies. That is correct — inside a block scalar, `#` is literal content.
52
+
53
+ ---
54
+
55
+ ## 3. Level-of-abstraction fit
56
+
57
+ Correct layer. This is a **primitive** (a parser producing values), not a detector and not
58
+ an authority. The alternative placements are both worse: fixing it in
59
+ `StageTransitionValidator` would patch one consumer and leave `PlanDocParser` and
60
+ `ProjectRoundRunner` mis-parsing the same files, and fixing it at each call site would be
61
+ the "fixing one instance of a class is not fixing the class" anti-pattern. The fix belongs
62
+ where the value is produced, which is why both scalar-producing sites in the parser are
63
+ patched rather than only the one that surfaced the bug.
64
+
65
+ ---
66
+
67
+ ## 4. Signal vs authority compliance
68
+
69
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
70
+
71
+ - [x] No — this change has no block/allow surface.
72
+
73
+ The parser holds no blocking authority. It returns `Record<string, unknown>` and every
74
+ caller wraps it in its own schema validator. The change makes an existing authority
75
+ (`StageTransitionValidator`) receive *correct input*; it does not add, move, or weaken any
76
+ authority. Notably it does not make the gate more permissive in spirit — the gate's rule
77
+ ("frontmatter must carry `approved: true`") is unchanged, and a spec without an approval
78
+ flag is still refused exactly as before.
79
+
80
+ ---
81
+
82
+ ## 4b. Judgment-point check (Judgment Within Floors standard)
83
+
84
+ No new static heuristic at a competing-signals decision point. There are no competing live
85
+ signals here: "where does a YAML comment begin?" is an **enumerable invariant** fixed by the
86
+ YAML specification (a `#` at value-start or preceded by whitespace, outside quotes), not a
87
+ judgement call that varies with context. It is named directly in the helper's doc comment.
88
+
89
+ ---
90
+
91
+ ## 5. Interactions
92
+
93
+ - **Shadowing:** `stripInlineComment` runs FIRST in `parseInlineValue`, before the tag (`!`), anchor (`&`/`*`), flow-sequence (`[...]`) and flow-map (`{...}`) checks. This ordering is deliberate and was verified: a trailing comment after a flow sequence (`tags: [a, b] # note`) would otherwise fail the `endsWith(']')` test and be mis-parsed as a plain string. It cannot shadow the security rejections — a value that *starts* with `!`, `&` or `*` is unaffected by comment-stripping, so tags and anchors are still rejected.
94
+ - **Double-fire:** none. The helper is pure, has no side effects, and is called exactly once per scalar.
95
+ - **Races:** none. Pure function, no shared or persistent state.
96
+ - **Feedback loops:** none. Parsing does not feed back into any system that parses.
97
+
98
+ ---
99
+
100
+ ## 6. External surfaces
101
+
102
+ - **Other agents on the same machine:** no. Parsing is per-process and in-memory.
103
+ - **Install base:** yes, but only in the corrective direction — nine specs on `main` (of 522 carrying an `approved:` line) currently mis-parse and will begin parsing correctly. No spec can be depending on its approval flag being silently ignored.
104
+ - **External systems:** none.
105
+ - **Persistent state:** none written. The parser reads files and returns values; it never writes.
106
+ - **Timing / runtime conditions:** none.
107
+ - **Operator surface (Mobile-Complete Operator Actions):** no operator-facing actions added or touched.
108
+
109
+ ---
110
+
111
+ ## 6b. Operator-surface quality
112
+
113
+ No operator surface — not applicable. No dashboard renderer, approval page, or grant/secret
114
+ form is touched by this change.
115
+
116
+ ---
117
+
118
+ ## 7. Multi-machine posture (Cross-Machine Coherence)
119
+
120
+ **machine-local BY DESIGN**, and the reason is that there is no state to place: this is a
121
+ pure function over a string, evaluated independently on whichever machine happens to read
122
+ the file. The *inputs* (spec files) are already replicated by git, so every machine parses
123
+ identical bytes and — after this change — reaches identical values. Before the change every
124
+ machine also agreed, on the wrong answer; the change makes them agree on the right one.
125
+
126
+ Explicitly: it emits **no** user-facing notices (no one-voice gating needed), holds **no**
127
+ durable state (nothing to strand on topic transfer), and generates **no** URLs (nothing to
128
+ survive a machine boundary).
129
+
130
+ ---
131
+
132
+ ## 8. Rollback cost
133
+
134
+ - **Hot-fix release:** revert the commit, ship as the next patch. The change is one file plus one test file.
135
+ - **Data migration:** none. No persistent state is written or migrated.
136
+ - **Agent state repair:** none. No agent needs notifying or resetting.
137
+ - **User visibility:** during a rollback window the nine affected specs would return to reading as unapproved — i.e. back to today's behaviour. No new regression is introduced by rolling back.
138
+
139
+ Honest total: pure code change, revert-and-patch, no cleanup.
140
+
141
+ ## Conclusion
142
+
143
+ The review changed the shape of the fix twice. First, the initial patch touched only
144
+ `parseInlineValue`; the level-of-abstraction question surfaced that block-sequence items
145
+ carry the identical defect, so the second call site was added and tested. Second, the
146
+ over-block question forced the conservative rule to be stated precisely — an early sketch
147
+ stripped from the first `#` unconditionally, which would have silently truncated
148
+ `http://host/page#section`. That is now the explicitly-tested boundary.
149
+
150
+ The one residual limitation is escaped quotes inside quoted scalars (§2), which is
151
+ pre-existing in `parseScalar` and unreached by any spec in the tree. Flagged, not fixed —
152
+ widening escape handling is a larger change to the narrow-schema trade-off and does not
153
+ belong in a Tier-1 fix.
154
+
155
+ Clear to ship.
156
+
157
+ ---
158
+
159
+ ## Second-pass review (if required)
160
+
161
+ **Reviewer:** not required — Tier 1 (39 LOC, one file, no decision-point surface, no
162
+ persistent state, revert-and-patch rollback).
163
+
164
+ ---
165
+
166
+ ## Evidence pointers
167
+
168
+ - `tests/unit/SafeYaml-inline-comments.test.ts` — 13 cases; 8 fail against the pre-change parser, 5 (the conservative guards) pass both before and after. Falsification run: source reverted via `git stash`, suite re-run, 8 failed / 5 passed confirmed.
169
+ - Downstream consumers re-run green: `StageTransitionValidator` (53), `ProjectRoundRunner` (27), `PlanDocParser` (9), `ProjectAutoAdvancePoller` (10), `convergence-gate-consistency` (23), `projects-advance-mergebase-wiring` (5), `spec-review-publish` (11) — 138 passed, 0 failed.
170
+ - `npx tsc --noEmit` — clean.
171
+ - End-to-end on the real blocked file: `docs/specs/audit-convergence-enforcement.md` now yields `approved: true` (boolean) with `approved-by` and `approved-date` intact, so it passes the approved-flag gate it previously failed.
172
+
173
+ ---
174
+
175
+ ## Class-Closure Declaration (display-only mirror)
176
+
177
+ No agent-authored-artifact defect — not applicable. The defect is in ordinary source
178
+ (`src/core/SafeYaml.ts`), not in an LLM prompt, hook, config, skill, or standards text, and
179
+ the change adds no self-triggered controller (no loop, monitor, sentinel, reaper, scheduler,
180
+ or recovery path — the helper is a pure string function with no scheduling surface).