instar 1.3.84 → 1.3.86

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.
@@ -0,0 +1,126 @@
1
+ # Side-Effects Review — Attention API vocabulary compatibility
2
+
3
+ **Version / slug:** `attention-api-vocabulary-compatibility`
4
+ **Date:** `2026-05-29`
5
+ **Author:** `instar-codey`
6
+ **Second-pass reviewer:** `self-audit; subagent not spawned by tool policy`
7
+
8
+ ## Summary of the change
9
+
10
+ This change adds a route-boundary normalizer for Attention Queue status and
11
+ priority vocabulary. Canonical read/store values stay uppercase, while write
12
+ requests may use documented aliases such as `resolved`, `medium`, `body`, and
13
+ `source`. Generated guidance is also corrected to show the required stable item
14
+ id. Files touched include `src/server/attentionApi.ts`, `src/server/routes.ts`,
15
+ the generated guidance templates, and unit/integration/e2e tests.
16
+
17
+ ## Decision-point inventory
18
+
19
+ - `PATCH /attention/:id` — modified — accepts documented aliases before calling
20
+ the existing status updater.
21
+ - `GET /attention?status=...` — modified — accepts status aliases for filtering.
22
+ - `POST /attention` — modified — accepts documented create-field aliases before
23
+ the existing tone-gated create path.
24
+ - Attention topic-flood guard — pass-through — no threshold, coalescing, or
25
+ topic creation behavior is changed.
26
+
27
+ ---
28
+
29
+ ## 1. Over-block
30
+
31
+ The change reduces rejection of legitimate documented request shapes. It does
32
+ not add new block conditions. Unknown statuses and priorities still reject on
33
+ write, which is appropriate because the server cannot safely infer arbitrary
34
+ lifecycle states.
35
+
36
+ ---
37
+
38
+ ## 2. Under-block
39
+
40
+ The alias layer broadens accepted write vocabulary. The main residual risk is an
41
+ operator using an ambiguous word outside the alias set; those values still
42
+ reject. The accepted aliases map only to existing canonical values, so no new
43
+ state can bypass lifecycle handling.
44
+
45
+ ---
46
+
47
+ ## 3. Level-of-abstraction fit
48
+
49
+ The fix belongs at the HTTP route boundary. Internal storage and Telegram topic
50
+ commands already use canonical statuses; external callers and generated
51
+ guidance use friendlier names. Normalizing at the boundary preserves internal
52
+ consistency without forcing every caller to know storage vocabulary.
53
+
54
+ ---
55
+
56
+ ## 4. Signal vs authority compliance
57
+
58
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
59
+
60
+ - [ ] No — this change produces a signal consumed by an existing smart gate.
61
+ - [ ] No — this change has no block/allow surface.
62
+ - [x] Yes — but this is hard-invariant API validation over a finite enum.
63
+ - [ ] Yes, with brittle logic — STOP. Reshape the design.
64
+
65
+ This is not a judgment gate. The route validates and normalizes finite API enum
66
+ values, which is one of the hard-invariant validation cases allowed by the
67
+ principle. It does not inspect message meaning or add a new block authority.
68
+
69
+ ---
70
+
71
+ ## 5. Interactions
72
+
73
+ - **Shadowing:** The normalizer runs before existing `updateAttentionStatus` and
74
+ `createAttentionItem` calls. Canonical values pass through unchanged.
75
+ - **Double-fire:** No additional Telegram send, topic creation, callback, or
76
+ persistence path is added.
77
+ - **Races:** No shared mutable state is introduced; normalization is pure.
78
+ - **Feedback loops:** Internal release-readiness resolution calls that already
79
+ send `resolved` now work against the route instead of failing.
80
+
81
+ ---
82
+
83
+ ## 6. External surfaces
84
+
85
+ The `/attention` write surface becomes more permissive for documented aliases.
86
+ The read surface remains canonical uppercase. Generated AGENTS/CLAUDE guidance
87
+ will include a stable `id` in new installs and migrations. No existing attention
88
+ state is rewritten. No new attention items are created by the verification path.
89
+
90
+ ---
91
+
92
+ ## 7. Rollback cost
93
+
94
+ Rollback is a normal hot-fix revert. There is no data migration. If reverted,
95
+ documented lowercase resolve calls and create aliases would fail again until a
96
+ replacement patch lands.
97
+
98
+ ---
99
+
100
+ ## Conclusion
101
+
102
+ The fix aligns the documented write vocabulary with the canonical read/store
103
+ vocabulary without changing topic creation policy or existing state. The
104
+ three-tier tests cover the compatibility path and keep the topic-facing effects
105
+ stubbed during verification.
106
+
107
+ ---
108
+
109
+ ## Second-pass review (if required)
110
+
111
+ **Reviewer:** `self-audit; subagent not spawned by tool policy`
112
+ **Independent read of the artifact: concur**
113
+
114
+ The compatibility layer is intentionally limited to finite enum and field-name
115
+ aliases. It does not create automatic item ids, because stable ids are part of
116
+ the queue's dedupe discipline; the docs now show that requirement explicitly.
117
+
118
+ ---
119
+
120
+ ## Evidence pointers
121
+
122
+ - Read-only live inspection found 9 existing attention items using statuses
123
+ `OPEN` and `DONE`, priorities `HIGH` and `NORMAL`, and no suppressed-topic log
124
+ present.
125
+ - Focused verification:
126
+ `npx vitest run tests/unit/attention-api-normalization.test.ts tests/integration/attention-route-vocabulary.test.ts tests/e2e/attention-queue-vocabulary-lifecycle.test.ts tests/unit/SeedMigration.test.ts`
@@ -0,0 +1,127 @@
1
+ # Side-Effects Review — Coherence Gate indeterminate summaries
2
+
3
+ **Version / slug:** `coherence-indeterminate-summary`
4
+ **Date:** `2026-05-29`
5
+ **Author:** `instar-codey`
6
+ **Second-pass reviewer:** `self-audit; subagent not spawned by tool policy`
7
+
8
+ ## Summary of the change
9
+
10
+ This change updates `ScopeVerifier` so unbound topic-project alignment is
11
+ represented as `passed: null`, the overall `passed` flag is true only when every
12
+ check truly passed, and the summary reports passed, warning, error, and
13
+ indeterminate counts. It adds unit, integration, and e2e tests for the
14
+ indeterminate path. The decision point touched is the Coherence Gate's
15
+ pre-action warn/block/proceed response.
16
+
17
+ ## Decision-point inventory
18
+
19
+ - `ScopeVerifier.check()` — modified — recommendation policy remains the same,
20
+ while summary and top-level pass reporting now distinguish indeterminate
21
+ checks from passed checks.
22
+ - `checkTopicProjectAlignment()` — modified — missing topic binding is now an
23
+ indeterminate warning instead of a boolean false warning.
24
+
25
+ ---
26
+
27
+ ## 1. Over-block
28
+
29
+ No new block condition is introduced. Unbound topics remain warning-level and do
30
+ not become blockers. A caller that incorrectly treated top-level `passed: true`
31
+ as permission despite `recommendation: "warn"` will now see `passed: false`, but
32
+ that is the intended correction: the check did not actually pass.
33
+
34
+ ---
35
+
36
+ ## 2. Under-block
37
+
38
+ This does not add new blocking coverage. A topic with no binding still warns
39
+ rather than blocks, so an agent can still proceed after verification. Wrong
40
+ project bindings remain error-severity failures and still block.
41
+
42
+ ---
43
+
44
+ ## 3. Level-of-abstraction fit
45
+
46
+ This is at the reporting layer of an existing deterministic gate. The gate
47
+ already owns the pre-action recommendation. The change does not add a parallel
48
+ authority; it makes the existing gate's human-readable and machine-readable
49
+ fields agree.
50
+
51
+ ---
52
+
53
+ ## 4. Signal vs authority compliance
54
+
55
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
56
+
57
+ - [x] No — this change produces a signal consumed by an existing smart gate.
58
+ - [ ] No — this change has no block/allow surface.
59
+ - [ ] Yes — but the logic is a smart gate with full conversational context
60
+ (LLM-backed with recent history or equivalent).
61
+ - [ ] Yes, with brittle logic — STOP. Reshape the design.
62
+
63
+ The existing Coherence Gate remains the authority for warn/block/proceed. This
64
+ change clarifies a structured signal state (`null` means indeterminate) and the
65
+ summary text derived from those signals. It does not introduce an independent
66
+ blocker.
67
+
68
+ ---
69
+
70
+ ## 5. Interactions
71
+
72
+ - **Shadowing:** No route or hook order changes. The same `/coherence/check`
73
+ route calls the same `ScopeVerifier.check()` path.
74
+ - **Double-fire:** No new event or side effect is emitted.
75
+ - **Races:** No persistent state or asynchronous coordination is added.
76
+ - **Feedback loops:** Agents may respond more cautiously because `passed` is now
77
+ false for indeterminate checks, matching the existing warning recommendation.
78
+
79
+ ---
80
+
81
+ ## 6. External surfaces
82
+
83
+ The `/coherence/check` JSON shape changes for unbound topics: the
84
+ topic-project-alignment check returns `passed: null`, and the top-level `passed`
85
+ field is false when any check is indeterminate. The recommendation field remains
86
+ unchanged. No database, file format, credential, network, or third-party
87
+ surface changes are introduced.
88
+
89
+ ---
90
+
91
+ ## 7. Rollback cost
92
+
93
+ Rollback is a normal hot-fix revert. There is no migration and no persistent
94
+ state repair. During rollback propagation, agents would temporarily see the old
95
+ misleading summary for unbound topics again.
96
+
97
+ ---
98
+
99
+ ## Conclusion
100
+
101
+ The change is narrowly scoped to truthful reporting for an existing warning path.
102
+ It keeps the Coherence Gate policy intact while removing an internal
103
+ contradiction that made summaries less trustworthy. The three-tier tests cover
104
+ the core logic, route response, and full server lifecycle.
105
+
106
+ ---
107
+
108
+ ## Second-pass review (if required)
109
+
110
+ **Reviewer:** `self-audit; subagent not spawned by tool policy`
111
+ **Independent read of the artifact: concur**
112
+
113
+ The main risk is API compatibility for callers that assumed `ScopeCheck.passed`
114
+ was always boolean. The route already had contradictory `passed` and
115
+ `recommendation` signals, and the requested contract explicitly uses
116
+ `passed: null` for indeterminate, so the compatibility cost is acceptable and
117
+ tested.
118
+
119
+ ---
120
+
121
+ ## Evidence pointers
122
+
123
+ - Live verification before the source change reproduced the bug: an unbound
124
+ topic check returned `recommendation: "warn"` while the summary still claimed
125
+ all four checks passed.
126
+ - Focused verification after the source change:
127
+ `npx vitest run tests/unit/ScopeVerifier.test.ts tests/integration/coherence-routes.test.ts tests/e2e/coherence-check-indeterminate-lifecycle.test.ts`