instar 1.3.85 → 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`