kairos-chain 3.84.0 → 3.87.0

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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +185 -0
  3. data/lib/kairos_mcp/version.rb +1 -1
  4. data/templates/knowledge/design_to_implementation_workflow/design_to_implementation_workflow.md +25 -6
  5. data/templates/knowledge/multi_llm_review_workflow/multi_llm_review_workflow.md +304 -50
  6. data/templates/knowledge/multi_llm_reviewer_evaluation/multi_llm_reviewer_evaluation.md +59 -12
  7. data/templates/skillsets/agent/tools/agent_step.rb +8 -2
  8. data/templates/skillsets/llm_client/lib/llm_client/bedrock_adapter.rb +17 -1
  9. data/templates/skillsets/llm_client/skillset.json +1 -1
  10. data/templates/skillsets/llm_client/test/test_bedrock_adapter_timeout.rb +57 -0
  11. data/templates/skillsets/minimum_nomic/bin/run_gm.rb +178 -10
  12. data/templates/skillsets/model_provenance/hooks/observer.rb +413 -0
  13. data/templates/skillsets/model_provenance/hooks/transcript_reader.rb +238 -0
  14. data/templates/skillsets/model_provenance/lib/model_provenance/observation_store.rb +135 -0
  15. data/templates/skillsets/model_provenance/lib/model_provenance.rb +6 -0
  16. data/templates/skillsets/model_provenance/plugin/hooks.json +58 -0
  17. data/templates/skillsets/model_provenance/skillset.json +18 -0
  18. data/templates/skillsets/model_provenance/test/fixture_builder.rb +100 -0
  19. data/templates/skillsets/model_provenance/test/test_hook_command.rb +41 -0
  20. data/templates/skillsets/model_provenance/test/test_observation_store.rb +134 -0
  21. data/templates/skillsets/model_provenance/test/test_observer.rb +366 -0
  22. data/templates/skillsets/model_provenance/test/test_transcript_reader.rb +193 -0
  23. data/templates/skillsets/multi_llm_review/config/multi_llm_review.yml +123 -64
  24. data/templates/skillsets/multi_llm_review/lib/multi_llm_review/persona_assembly.rb +23 -2
  25. data/templates/skillsets/multi_llm_review/lib/multi_llm_review/provenance_binding.rb +110 -0
  26. data/templates/skillsets/multi_llm_review/lib/multi_llm_review/review_serializer.rb +2 -0
  27. data/templates/skillsets/multi_llm_review/skillset.json +1 -1
  28. data/templates/skillsets/multi_llm_review/test/test_provenance_binding.rb +227 -0
  29. data/templates/skillsets/multi_llm_review/tools/multi_llm_review.rb +3 -3
  30. data/templates/skillsets/multi_llm_review/tools/multi_llm_review_collect.rb +23 -2
  31. metadata +15 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ebfc6fe1ff6c901c620512c56c698f6dca7bd058143e611547864a0a5460e29
4
- data.tar.gz: caa3229fcb55a9f057a88be84a7a7694e514aff6e9b31ec5a8796d5e1ca93138
3
+ metadata.gz: eac563609de17554382bdd2a4c2a42b21040fd60f43c4702eea153eeb5d5806b
4
+ data.tar.gz: 0cbb9994501dc8bdf9333e13f15bd25bc5c45e68f83abf1066e860606bc1c18a
5
5
  SHA512:
6
- metadata.gz: 91588bb7de5f9f211409c77e90ba688432415dae81a142341481201ea412d2769d597ed1d10382a726b7ef301fbfdda77439bfa7f27e870102a296f520957656
7
- data.tar.gz: a7a9bd001776163b148e690508f6aa6f44639f01974f00da552f5264676f37f4a25a286c9acb6e502edd6c77f07f9c5de2afd963a6053a89a8d0999721bf55a4
6
+ metadata.gz: 4f41031abdbec48d77ed711a114a8be271321b4afee36e4a7b081550437afbf82b8a0a2aa91eba23fa3422873f8e5032202a00dc51a4cbb5758b72370a60d1dc
7
+ data.tar.gz: f0d09276a3259622de795ec1f7522e2b78af9c80c6934aa809195755f3fa8938d53996fbd1ab226e0884a5348383b92baf320a3c6c94e9d82ad94689d35cba87
data/CHANGELOG.md CHANGED
@@ -4,6 +4,191 @@ All notable changes to the `kairos-chain` gem will be documented in this file.
4
4
 
5
5
  This project follows [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [3.87.0] - 2026-09-24
8
+
9
+ ### Added — `model_provenance` SkillSet: which model actually answered
10
+
11
+ Claude Code re-runs a request on another model when a safety classifier flags it
12
+ (from Opus 5.5 and the Fable models: biology → Opus 5, cyber → Opus 4.8) and the
13
+ session then stays on that model. The operator is told once in the main session and
14
+ not at all for subagents, and the model that took over reads the same system prompt
15
+ naming the model it replaced, so its account of itself cannot be trusted. Observed
16
+ on 2026-09-24: an audit subagent answered 90 of 102 records on `claude-opus-5`, with
17
+ nothing in its output saying so.
18
+
19
+ `model_provenance` is hooks only (no MCP tools, no core change). It derives the
20
+ answering model from what the harness recorded — per-response `message.model` and
21
+ the transcript's `fallback` marker — never from what a model says:
22
+
23
+ - **PostModelSwitch** records every model change; on `source: "auto"` it tells the
24
+ model which model it now is.
25
+ - **SubagentStop** records the subagent's latest run. A run starts only at a message
26
+ from the coordinator or a peer; Skill bodies (`turnCompanion` records) and the
27
+ agent's own task notifications are not resumes.
28
+ - **Stop** reads every finished response not yet reported — main transcript and every
29
+ subagent transcript, recursively — and shows one `[model_provenance] …` line per
30
+ affected transcript, including transcripts it could not read and subagents still
31
+ running. All observer state commits in one rename after the report is composed.
32
+
33
+ The transcript reader lives in `hooks/`; `lib/` exposes only the append-only
34
+ observation store. The projected command guards itself when neither
35
+ `KAIROS_DATA_DIR` nor `CLAUDE_PROJECT_DIR` is set (silent under Codex, a visible
36
+ non-blocking error elsewhere). Install: `kairos-chain skillset install
37
+ <gem>/templates/skillsets/model_provenance`, then re-project. Design:
38
+ `docs/model_provenance/`.
39
+
40
+ ### Changed — `multi_llm_review` 0.11.0: persona seats can record the observed model
41
+
42
+ `orchestrator_reviews[]` entries take an optional `agent_id` (the id the Agent tool
43
+ returned for that persona's subagent). When any persona carries one, collect
44
+ resolves it through `model_provenance`'s store and the seat records
45
+ `model_source`, `model_observed`, `model_divergence` and `binding:
46
+ caller_declared`, with each persona's observation in its `persona_rows` entry. A
47
+ persona is divergent when any observed response came from a model other than the
48
+ declared persona model; the seat is observed only when every persona's observation
49
+ is complete. Without any `agent_id` the record is exactly as before.
50
+
51
+ ### Changed — review roster: Opus 5 → Opus 5.5, Fable 5 → Fable 5.1
52
+
53
+ The rotating frontier slot is `claude-opus-5-5` (label `claude_cli_opus5.5`) and
54
+ the reserve slot `claude-fable-5-1`. Opus 5.5 is the one model that runs at medium
55
+ when effort is omitted, so the explicit `high` in `effort_map` is what keeps it at
56
+ high. L1 `multi_llm_review_workflow` 3.14.0 → 3.15.0: prescriptive text only;
57
+ measurements and history that name Opus 5 or Fable 5 stay as written.
58
+
59
+ ## [3.86.0] - 2026-09-21
60
+
61
+ ### Changed — multi-LLM review: a per-round check for which review you are in
62
+
63
+ Templates only: L1 `multi_llm_review_workflow` 3.13.0 → 3.14.0. No library code,
64
+ no config.
65
+
66
+ **The rule.** § Step -1 gains rule 7: classify each round's findings by CATEGORY,
67
+ not only by the (a)/(b)/(c) severity that rule 1 and § Convergence Rules already
68
+ require. Structural gaps ("this cannot work") and fix correctness ("the fix is
69
+ wrong") are design-review categories; missing wiring ("this does not work") is an
70
+ implementation-review category. When a design loop's findings have moved to the
71
+ implementation category, the design review is over — freeze, hand the rest to the
72
+ implementation queue, and do not dispatch another round.
73
+
74
+ **Why it is new.** The content is not new; the *step* is. `multi_llm_reviewer_
75
+ evaluation` § Bug Category Differentiation Across Rounds and this document's
76
+ § Convergence Curve have both described the progression for months, as
77
+ observations. Nothing told an orchestrator to perform the check each round, so a
78
+ loop could run eight rounds without anyone asking which review it was in.
79
+
80
+ **The loop that paid for it.** GenomicsChain service (2.5) provenance anchoring,
81
+ 2026-09-20/21, 8 rounds, orchestrator Opus 5. Rounds 1–4 exhausted the
82
+ design-category findings — the record contract, the verifier's readability, the
83
+ proof TTL, the packaging. Rounds 5–8 then spent four rounds on a single
84
+ implementation-category class (a malformed bundle outgrading an honest one, in
85
+ the adapter's reading of broken input) and produced +102 lines of design against
86
+ +271 of code and +397 of tests, while the reviewed artifact grew 56 KB → 180 KB.
87
+
88
+ Two things about that are worth keeping. First, the orchestrator's (a)/(b)/(c)
89
+ trend table looked healthy the whole time — blocking rows 15 → 12 → 8 → 7 → 7 →
90
+ 9 → 10 → 6, density 26.7 → 3.3 per 100 KB — because the findings *were*
91
+ narrowing. Severity and category are different axes, and only one of them was
92
+ being read. Second, the surface grew because rule 2 was being broken: the code
93
+ sat under an `APPENDIX (advisory only — findings against these never block)`
94
+ header, the seats honoured it (round 8's codex labelled two of its three findings
95
+ "Advisory under the appendix rule") and the orchestrator treated them as blocking
96
+ anyway. Rule 2 exists to collapse the claim surface; a surface that grows every
97
+ round is the tell that it is not being kept.
98
+
99
+ The loop ended on the operator's observation, not on any recorded signal: *the
100
+ adapter is an implementation problem, and a design review that runs tests has
101
+ stopped being a design review.*
102
+
103
+ **Also recorded in § Experimental Data**, because the same loop dropped them: the
104
+ ≤5 fixes-per-round cap (rule 3) ran at 7/6/6/6, the pre-flight falsifier (rule 4)
105
+ was skipped for three consecutive rounds, the per-round
106
+ `reviewer_evaluation_observation_<reviewer>_<date>` records (§ L2 Save Points)
107
+ were never written, and no seat was asked for a closure verdict on its own
108
+ prior-round P0s (§ Convergence Rules). A loop that drops five of this document's
109
+ rules at once is not a loop that ran out of rules to follow.
110
+
111
+ Records (GenomicsChain_SkillSets): L2 `decision_design_frozen_prov_anchoring_20260921`,
112
+ `reviewer_evaluation_observation_prov_anchoring_loop_20260921`, and the round
113
+ records `review_r5_…` through `review_r8_prov_anchoring_v0_1_9_20260921`.
114
+
115
+ ## [3.85.0] - 2026-09-06
116
+
117
+ ### Changed — multi-LLM review: high effort by default, gpt-6-astra seats, gpt-5.5 retires
118
+
119
+ Templates only: `multi_llm_review/config/multi_llm_review.yml`, L1
120
+ `multi_llm_review_workflow` 3.12.0 → 3.13.0. No library code.
121
+
122
+ **Effort.** Every seat that has an effort control now runs at `high`, at every
123
+ complexity level, so `effort_map` is a constant rather than a function of complexity.
124
+ Claude CLI takes `--effort high`, codex takes `-c model_reasoning_effort=high`, Cursor
125
+ takes nothing — `cursor_adapter` builds no effort flag, so a value set for a cursor
126
+ entry would be recorded and never sent. Both the roster defaults and `effort_map` are
127
+ set, because `effort_map` overrides the roster per dispatch and an entry left at
128
+ `medium` would be silently raised. `high` rather than `xhigh`/`max` because it is the
129
+ ceiling the two providers share (Claude CLI accepts low/medium/high/xhigh/max, codex
130
+ accepts minimal/low/medium/high), and a roster split across incomparable settings is
131
+ worth less than a lower common one.
132
+
133
+ This supersedes the 2026-04-29 default-effort policy. That policy rested on one
134
+ low-vs-high measurement — 8.35 vs 8.16 — taken on the Opus 4.6 / 4.7 generation, on
135
+ none of the models now in the roster. It was not re-measured, so the supersession is a
136
+ judgement and a later measurement could reverse it. Cost is measured and rises:
137
+ gpt-6-astra spent 8,274 tokens at high against 3,150 at its default on one identical
138
+ one-line prompt.
139
+
140
+ **Roster.** `codex_gpt6-astra` replaces `codex_gpt5.6-sol`, verified before the swap
141
+ through the flags `codex_adapter` actually builds. `codex_gpt5.5` retires in the same
142
+ edit and is not replaced: it had been commented out of the instance roster since
143
+ 2026-07-30 "for round R10 only" and never restored, so the calibrated
144
+ cross-generation anchor role had already lapsed for five weeks. Codex now holds one
145
+ slot and it is uncalibrated. Roster 5 → 4, so `convergence_rule` moves 3/5 → 3/4 and
146
+ `convergence_rule_after_exclusion` 3/4 → 2/3, both on the same ceil(N × 0.6) basis and
147
+ both reference figures rather than gates. Three calibration warnings are recorded in
148
+ the L1: the 138-run seat profile is gpt-5.6-sol's and does not transfer; that corpus
149
+ was gathered at medium effort; and it was gathered on a 5-seat roster.
150
+
151
+ ### Fixed — three documents called the APPROVE ratio the closing condition
152
+
153
+ A round closes on the exhaustion of (a)+(b) findings, declared by the operator, with
154
+ new (a)+(b) P0 = 0 as the machine-side signal. The tooling has said so since v0.7
155
+ INV-R2 named the field `reference_verdict` and v0.10.1 renamed `convergence` to
156
+ `vote_tally`. Three documents had not caught up, and they are the ones actually read.
157
+
158
+ L1 `multi_llm_reviewer_evaluation` 1.5 → 1.6. § Convergence Rule (Updated) stated
159
+ `3/4 APPROVE = proceed to next step` and `4/4 APPROVE = merge-ready` with no note that
160
+ the ratio is a reference value — while L1 `multi_llm_review_workflow` names this very
161
+ section as the normative detail it defers to. The document saying "the ratio is not
162
+ the primary close" pointed at a document saying it was. The closing condition is now
163
+ stated first, the one blocking rule (any (a)/(b) REJECT) is separated from the
164
+ reference figures, and the two facts that make the ratio unusable as a criterion sit
165
+ in the section: Codex went 24 of 24 reviews without APPROVE on one design loop, and
166
+ both 2026-08 threads closed by (a)+(b) exhaustion without reaching their ratio.
167
+
168
+ L1 `design_to_implementation_workflow` 1.1 → 1.2. `merge gate: 3/3 APPROVE =
169
+ merge-ready` and `Merge criteria: 3/3 APPROVE with 0 FAIL` replaced by the closing
170
+ condition; the anti-pattern list gains reading an APPROVE count as the closing
171
+ condition, naming this document as having carried it. The reviewer lineup written here
172
+ ("3 reviewers: Opus 4.6 + Codex GPT-5.4 + Composer-2") is deleted rather than
173
+ corrected — it had been wrong since 2026-04-19, and a roster copied into a second
174
+ document goes stale silently.
175
+
176
+ `agent` SkillSet: the bundle handed to reviewers opened "aggregate per the convergence
177
+ rule below" followed by the bare ratio. The heading no longer calls it a convergence
178
+ rule, a Closing condition section states what actually closes a round, and the ratio
179
+ is labelled "Reference ratio (recorded, never sufficient on its own)".
180
+
181
+ Surviving uses of "merge gate" name the stage and its reviewer lineup, not a ratio,
182
+ and stay.
183
+
184
+ **Not reviewed by multi-LLM review**, at the operator's explicit instruction — the
185
+ change is a seat swap plus wording, and a round would have cost hours. Verification is
186
+ this agent's own and is not an independent judgement: YAML load of both configs, the
187
+ three CLI invocations run for real (gpt-6-astra and both Claude models answered at
188
+ high, with the model echoed back), `ruby -c` on `agent_step.rb`, multi_llm_review 556
189
+ runs / 1,809 assertions and agent 21 checks, all passing. No test asserts the reviewer
190
+ prompt wording, so that one line is unguarded.
191
+
7
192
  ## [3.84.0] - 2026-09-03
8
193
 
9
194
  ### Fixed — agent: second field-defect bundle (D5-b, D6, exit-record housekeeping), real-process worker tests
@@ -1,4 +1,4 @@
1
1
  module KairosMcp
2
- VERSION = "3.84.0"
2
+ VERSION = "3.87.0"
3
3
  CHANGELOG_URL = "https://github.com/masaomi/KairosChain_2026/blob/main/CHANGELOG.md"
4
4
  end
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: design_to_implementation_workflow
3
3
  description: "Full-lifecycle workflow for complex features: design review, self-review, implementation review, and final merge gate. Derived from Service Grant + Attestation Nudge experiments."
4
- version: "1.1"
4
+ version: "1.2"
5
5
  tags:
6
6
  - workflow
7
7
  - implementation
@@ -31,7 +31,8 @@ different bugs.
31
31
  │ v0.2 ──→ Multi-LLM Review R2 ──→ Fix ──→ v0.3 │
32
32
  │ (fix correctness) │
33
33
  │ │
34
- │ Convergence: 0 FAIL, 2/3+ APPROVE │
34
+ │ Closes on: new (a)+(b) P0 = 0, operator declares freeze │
35
+ │ (APPROVE ratio is a reference figure, not the gate) │
35
36
  ├─────────────────────────────────────────────────────────────┤
36
37
  │ IMPLEMENTATION PHASE │
37
38
  │ │
@@ -48,7 +49,7 @@ different bugs.
48
49
  │ (missing wiring, fail-open, integration gaps) │
49
50
  │ │
50
51
  │ Final Multi-LLM Review + Persona Assembly │
51
- │ (merge gate: 3/3 APPROVE = merge-ready) │
52
+ │ (closes the same way; ratio stays a reference figure) │
52
53
  └─────────────────────────────────────────────────────────────┘
53
54
  ```
54
55
 
@@ -76,8 +77,15 @@ different bugs.
76
77
  - Output: Complete design document with pseudocode
77
78
 
78
79
  #### Multi-LLM Review Rounds
79
- - **3 reviewers**: Claude Opus 4.6 + Codex GPT-5.4 + Composer-2
80
- - **Convergence criteria**: 0 FAIL, 2/3+ APPROVE
80
+ - **Reviewers**: the roster in `multi_llm_review/config/multi_llm_review.yml`,
81
+ which is where the count and the models live. The "3 reviewers: Opus 4.6 +
82
+ Codex GPT-5.4 + Composer-2" written here until 2026-09-06 had been wrong since
83
+ 2026-04-19 and is not restated, because a roster copied into a second document
84
+ goes stale silently
85
+ - **Closing condition**: new (a)+(b) P0 = 0, carryover P0s counted separately
86
+ with a closure verdict on each, and the freeze declared by the operator. The
87
+ APPROVE ratio the tool reports is a recorded reference value — see L1
88
+ `multi_llm_review_workflow` § Convergence Rules
81
89
  - **Typical rounds**: 2-3 for Tier 3 complexity
82
90
  - **Convergence curve**:
83
91
  - R1: Structural gaps — "this is missing" (existence)
@@ -148,7 +156,11 @@ Claude Persona Assembly (4 personas):
148
156
  - Safety-critical components
149
157
  - NOT for intermediate rounds (diminishing returns)
150
158
 
151
- **Merge criteria**: 3/3 APPROVE with 0 FAIL. Codex APPROVE is the strongest signal (see `multi_llm_reviewer_evaluation`).
159
+ **Merge criteria**: new (a)+(b) P0 = 0, with the freeze declared by the operator.
160
+ A Codex APPROVE is the strongest *reference* signal (see
161
+ `multi_llm_reviewer_evaluation`), and it is not a gate: Codex went 24 of 24
162
+ reviews without reaching APPROVE on one design loop, so a merge waiting on it
163
+ would never have merged.
152
164
 
153
165
  ## Effort Level Selection
154
166
 
@@ -192,6 +204,9 @@ Reviewer 側 (Opus 4.7) は effort-independent なので high が天井。xhigh/
192
204
 
193
205
  ## Convergence Data
194
206
 
207
+ Observed outcomes of past loops, not criteria. The APPROVE counts below record
208
+ what those particular rounds happened to reach; they are not what closed them.
209
+
195
210
  ### Service Grant (Tier 3, 2026-03-18)
196
211
  - Design: v1.0 → v1.4, 3 review rounds, 3 LLMs
197
212
  - Design review findings: R1: 8 P0/P1, R2: 2 FAIL + 28 CONCERN, R3: 0 FAIL
@@ -207,6 +222,10 @@ Reviewer 側 (Opus 4.7) は effort-independent なので high が天井。xhigh/
207
222
 
208
223
  ## Anti-Patterns
209
224
 
225
+ - **Reading an APPROVE count as the closing condition.** It is a recorded
226
+ reference value; a round closes on new (a)+(b) P0 = 0 with the freeze declared
227
+ by the operator. This document itself carried the mistake until v1.2, in the
228
+ strongest available wording ("merge gate: 3/3 APPROVE = merge-ready")
210
229
  - Implementing Phase 2+ when Phase 1 prerequisites aren't met
211
230
  - Using agent team for implementation (context fragmentation)
212
231
  - Skipping self-review (misses cheap P0 fixes)