Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7073,7 +7073,7 @@ The webview cannot import from `src/` (it is loaded as a plain script into a `de

> ✅ **SHIPPED (2026-07-30, PR #81).** `scripts/quality/lens_coverage.py` drives the shipped `lens parse --json` — not a second `ast` walk — so the number cannot drift from what the Steps view actually renders. Measured against the de-identified estate: 388 files · 145 handlers · 1,423 rows · **0 parse refusals**; editable share **42.0%**, fully-typed handlers **14.5%** (21/145), median opaque rows/handler **3**. Full result and the pre-registered decision rule are recorded on PR #81.
>
> ⚠️ **The pre-registered rule fired 🔴 RED, and the RED prescription was *not* adopted** — both triggers landed exactly on their boundaries (B = 14.5% missed the 15% floor by 0.5pp; median opaque = 3 hit `≥ 3` exactly), while A = 42.0% sat mid-AMBER. The AMBER prescription (breadth before depth) was taken instead, on the argument that the opacity is *mechanical* — comment-only rows (28%) plus helper delegation (41.8%) are ~70% of the opaque mass and both are addressable within the projection model. **This override was a delegated judgment call, never explicitly ratified by the owner**; treat it as open if the next measurement does not move. See #240 (comment-only rows) and ADR 0089 Phase D (helper descent).
> ⚠️ **The pre-registered rule fired 🔴 RED, and the RED prescription was *not* adopted** — both triggers landed exactly on their boundaries (B = 14.5% missed the 15% floor by 0.5pp; median opaque = 3 hit `≥ 3` exactly), while A = 42.0% sat mid-AMBER. The AMBER prescription (breadth before depth) was taken instead, on the argument that the opacity is *mechanical* — comment-only rows (28%) plus helper delegation (41.8%) are ~70% of the opaque mass and both are addressable within the projection model. **This override was a delegated judgment call, never explicitly ratified by the owner**; treat it as open if the next measurement does not move. See **#248** (comment-only rows — [ADR 0076](adr/0076-typed-action-vocabulary-action-list-lens.md) Amendment A, ratified 2026-07-30). ⚠️ **The other half of that "~70% of the opaque mass" argument no longer stands:** helper delegation was to be addressed by ADR 0089 Phase D, which the owner **declined 2026-07-30 as too risky** (ADR 0076 Amendment B) — and its 41.8% was a heuristic superset whose real yield may be negative. So the breadth-before-depth case now rests on comment-only rows alone; re-measure before assuming the number moves.

**Cluster:** IDE & Authoring. **Priority:** P1 — this number decides how much further Steps-view investment is justified. **Verdict:** build (cheap, reproducible). **Severity:** none (measurement).

Expand Down
28 changes: 22 additions & 6 deletions docs/adr/0076-typed-action-vocabulary-action-list-lens.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ADR 0076 — Typed action vocabulary + structured action-list lens over Python Handlers

**Status:** Accepted (2026-07-10) — ratified by the owner 2026-07-10; the PLAN-8 lanes may build. Gating rule: **phase 1 (the vocabulary) requires only the #26-amendment merge; phases 2–3 require this ADR Accepted.** In practice phase 1 builds after Acceptance anyway — its v1 roster is fixed by §2 and MULTISESSION-PLAN-8 bundles it with phase 2a in one lane. **Amendment A — ACCEPTED, ratified by the owner 2026-07-30 and IN FORCE:** a `note` row kind so comment-only rows stop projecting as opaque `code`, superseding ADR 0106 §5 (L); §3's enum and §4's ladder read as amended, and BACKLOG #248 is the build. **Amendment B — still PROPOSED and NOT ratified:** ADR 0089 Phase D "helper descent" is specified and priced but **not buildable**; its yield is unmeasured and may be negative, and its three §B.4 preconditions are unmet. Do not read A's ratification as covering B.
**Status:** Accepted (2026-07-10) — ratified by the owner 2026-07-10; the PLAN-8 lanes may build. Gating rule: **phase 1 (the vocabulary) requires only the #26-amendment merge; phases 2–3 require this ADR Accepted.** In practice phase 1 builds after Acceptance anyway — its v1 roster is fixed by §2 and MULTISESSION-PLAN-8 bundles it with phase 2a in one lane. **Amendment A — ACCEPTED, ratified by the owner 2026-07-30 and IN FORCE:** a `note` row kind so comment-only rows stop projecting as opaque `code`, superseding ADR 0106 §5 (L); §3's enum and §4's ladder read as amended, and BACKLOG #248 is the build. **Amendment B — ⛔ DECLINED by owner ruling 2026-07-30 (too risky):** ADR 0089 Phase D "helper descent" is **not adopted and not to be built** — aliasing across duplicate call sites has no solution in any ADR, and the yield is unmeasured and may be negative. The specification is retained so the decline is auditable, not as a plan; reopening needs a **new** amendment. The better lever, explicitly not declined, is teaching Phase A the `msg["X"] = v` subscript form — it widens what is editable without touching the row shape.
**Deciders:** owner + IDE/DX working group
**Related:** BACKLOG **#222** (this build), **#26 amendment** (the narrow carve-out this ADR operates under), **#221** (sibling IDE-polish lane), the deep-research findings ([`docs/research/ide-low-code-options.md`](../research/ide-low-code-options.md) — verified precedents: InterSystems low-code custom editors, Kaoto/Karavan/AWS Workflow Studio, Iguana annotations, Corepoint action-lists), ADR 0007/0033/0014 (the sanctioned config-as-data GUIs), ADR 0072 (traced dry-run — the live values rendered beside action rows), ADR 0010/0043 (`db_lookup`/`fhir_lookup` — the sanctioned read-only lookups the lens renders as DBSelect-style rows), ADR 0035 (IDE workspace-trust — `lens` CLI calls are exec-gated like every CLI call), CLAUDE.md §9 (PHI), §12 (the amended bright line).
Plan: [`docs/releases/MULTISESSION-PLAN-8.md`](../releases/MULTISESSION-PLAN-8.md) (L2 builds phases 1+2a; L3 builds phase 2b; L4 = phase 3, owner-gated).
Expand Down Expand Up @@ -363,12 +363,28 @@ New residual: pragma notes are visible but read-only, an intentional and documen
- **AC-N6** — WHEN a construct is unrecognized, THE SYSTEM SHALL emit a `code` row; a whole-file refusal
SHALL occur only on `ast.parse` failure → unchanged ladder assertion, re-run over the note corpus.

## Amendment B (PROPOSED, 2026-07-30) — ADR 0089 Phase D "helper descent"
## Amendment B (DECLINED, 2026-07-30) — ADR 0089 Phase D "helper descent"

> **Status of this amendment: PROPOSED — owner-gated, not ratified, not buildable.** Amendment A above
> is independent of this one and does not depend on it. This section exists so the grammar change Phase
> D implies is specified and priced *before* anyone builds it, per §2's amendment rule; it is not a
> licence to start.
> **Status of this amendment: ⛔ DECLINED by owner ruling 2026-07-30 — too risky.** The grammar
> widening described below is **not adopted**, and **ADR 0089 Phase D is not to be built**. Amendment A
> above is independent of this one, was ratified separately, and is unaffected.
>
> **This is a decline-by-design, not a deferral.** The specification is kept — not as a plan, but so the
> decline is auditable and so the next session that reads ADR 0089 §Phase D and thinks "265 delegating
> call-sites is the biggest remaining win" finds the reasoning already done. The case against it is
> §B.1 (aliasing has no solution in any ADR: two call sites of one helper produce identical child spans,
> `expect_src` matches both, and an edit to one silently rewrites the other) and §B.2 (the yield is
> unmeasured and may be **negative** — the shipped sample helper writes exclusively in the unrecognized
> `msg["X"] = v` form, so descending it returns six opaque rows and zero editable ones).
>
> **What is NOT declined, and is the better lever:** teaching Phase A the `ast.Assign`-to-`ast.Subscript`
> form (`msg["X"] = v`). It converts writes into editable rows **without touching the row shape at all**,
> is on no phase list, and may move the coverage number further than descent for a fraction of the risk.
> §B.4 precondition 2 already argued this; the decline promotes it from precondition to recommendation.
>
> **Reopening requires a new amendment**, not a reading of this one. Any future proposal must first
> answer §B.1's aliasing question and produce the §B.4(1) measurement — a real per-helper editable-share
> number, not the `218/522` heuristic superset.

ADR 0089 §2 names Phase D — "descend into same-module helper functions … projecting each `_fn(msg, …)`
call as an expandable group whose rows are the helper body's recognized actions, edited in place
Expand Down
20 changes: 20 additions & 0 deletions docs/adr/0089-recognition-first-lens-native-idioms.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@ When a `msg.set` value (or a computed local) is a recognizable transform of a fi
`for i in range(1, msg.count_segments("SEG")+1)` → **For each SEG segment** (segment id editable) (111); `for x in msg.groups()/segments()` → native iteration (24, already recognized — keep); `if current_environment() in (...)` → **Environment gate** (44); `if <field cond>` → **When field …** condition (206); `if <regex>.search(...)` → **Filter/guard** (36); `return None` → **Filter (drop)** row (150). Control rows may stay structure-only (read-only header) where the body is what's edited, but the *header operands* (segment id, environment list, field path) should be editable where unambiguous.

### Phase D — helper descent (265 delegating call-sites + the writes inside them)

> ⛔ **DECLINED by owner ruling 2026-07-30 — too risky. Do not build this phase.** Phase D is a
> *grammar* widening under [ADR 0076](0076-typed-action-vocabulary-action-list-lens.md) §2, so it was
> specified and priced as **ADR 0076 Amendment B** and declined there; read that amendment before
> re-proposing anything in this section. Two findings killed it: **aliasing** — two call sites of the
> same helper produce identical child row spans, `expect_src` matches both, and an edit to one silently
> rewrites the other, which no ADR addresses — and **yield**, which is unmeasured and may be *negative*:
> `msg["X"] = v` is not recognized (only `msg.set(...)` is), and the shipped sample helper
> `samples/config/_demo_oru_transforms.py` writes exclusively in that form, so descending it returns six
> opaque rows and zero editable ones.
>
> **The "265 delegating call-sites" figure below is a statement-scan count and is not a yield estimate.**
> Descent makes nothing editable by itself — it replaces opaque delegating rows with helper-body rows
> whose editability is whatever Phases A–C already achieve *inside* helpers.
>
> **Better lever, not declined:** teach Phase A the `ast.Assign`-to-`ast.Subscript` form (`msg["X"] = v`).
> It converts writes into editable rows without touching the row shape, and is on no phase list.
>
> The paragraph below is the original Phase D text, retained unchanged for the record.

Handlers delegate to `_`-prefixed helper functions (`_msh(msg)`, `_pid(msg)`); the bulk of the 1,283 native writes live **inside** those helpers, invisible when you open the calling Handler. To satisfy "see *everything* editable," the lens must **descend into same-module helper functions** — projecting each `_fn(msg, …)` call as an expandable group whose rows are the helper body's recognized actions, edited in place (rewrites target the helper's own line span). This is the largest structural lever and the highest-risk (cross-function byte-stable rewrite); it ships after A–C prove the recognition rules.

### Phase E — compute chains (688 computed locals; partial by design)
Expand Down
Loading
Loading