Repository navigation
fix(telemetry): the activation-funnel read no longer mints installation_id on a GET (abilityai/trinity-enterprise#545) - #2663
Conversation
…on_id on a GET (Abilityai/trinity-enterprise#545) `GET /api/enterprise/telemetry/funnel` reached the OSS `get_or_create_installation_id`, so on an install whose id was never minted the first admin open of Settings → Activation created the durable identity row from a read path — the get_or_create_*-on-a-read class (ledger 2026-08-05), third occurrence after #1987 and the ent#190 benchmark read. OSS half of the fix: - `services/operator_intake_service.get_installation_id` — the non-minting read twin: the stored id or None; blank/non-string reads as None; a read failure propagates rather than rendering as "not minted". The enterprise funnel read switches to it in the private repo. - The writers' accessor mints through the write-once claim `insert_setting_if_absent` instead of an upsert, so two workers that SELECT-miss together land one id and the loser reads the winner's back — closing the race #1987 recorded as pre-existing. Its docstring in `instance_identity.py` follows. - `ActivationFunnelPanel.vue` renders the footer through the pure `funnelFormat.js` with three honest states — minted, not minted for the backend's explicit null (naming the one writer an operator can reach, the updates opt-in under Settings → General), unavailable for an absent or malformed value — and the touched line's two ink halves move onto the contract's ladder (count-neutral for the raw-colour ratchet). - Tests: nine OSS cases (read twin, read-only store, propagated read failure, writer and reader as one key, the racing claim) and sixteen vitest cases plus a panel-wiring guard; `test_operator_intake.py` registered in tests/registry.json. - Docs: requirements §43.1/§45, the backend architecture entry, the telemetry-sharing and first-time-setup flows, the index row, PRODUCT_EVENTS, a learnings entry (the sentinel belongs on the write sink; a static guard covers what no fixture can), and the CSO diff report (no findings). The enterprise half — the funnel read on the read twin, `installation_id` nullable on the wire, the never-mint suite over a real store — lands through the submodule pointer after its own PR; this commit moves no gitlink. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Enterprise half: Abilityai/trinity-enterprise#570 (draft until this PR is on |
|
merge-train 2026-09-09: not on this train. The read-side rework is right and the tests genuinely bite (I reverted The blank-row self-heal is destroyed, and the function can return db.insert_setting_if_absent(_INSTALLATION_ID_KEY, str(uuid.uuid4()))
return db.get_setting_value(_INSTALLATION_ID_KEY, "") or ""Given a
Reachable via This reads as an oversight rather than a judgement call, because the read twin at A shape that keeps the race-closing claim and the self-heal: new_id = str(uuid.uuid4())
db.insert_setting_if_absent(_INSTALLATION_ID_KEY, new_id)
stored = db.get_setting_value(_INSTALLATION_ID_KEY, "")
if not stored: # blank row: the claim cannot overwrite it
db.set_setting(_INSTALLATION_ID_KEY, new_id)
stored = new_id
return stored( Two things worth tracking while it is open:
Minor: Rides the next train once the self-heal is restored. |
… row again — the claim cannot overwrite one (ent#545 review) The first cut's write-once claim destroyed the pre-ent#545 self-heal: with a stored "" the SELECT-miss fell through to a claim the PRIMARY KEY refuses, and the read-back returned "" — forever — keying every product event, the intake POST and the canary label on the empty string. Reproduced against the real SQLite settings layer (blank row → '' stored, unhealed; whitespace row returned verbatim). - `get_or_create_installation_id` now reads through the twin, claims on a miss, reads back, and — only when the row exists but holds nothing usable (the empty string, whitespace, a non-string: exactly what `get_installation_id` refuses) — heals it through the upsert, the one place `set_setting` is right, so the two accessors agree on what "minted" means. A healthy row is returned verbatim with no write; two workers healing the same corrupt row is last-write-wins, as it always was for that row. - Tests: the corrupt-row heal parametrised over "", " ", None and 42 on the FakeDB (healed IN the store, the read twin agrees, stable afterwards); a healthy row returned verbatim with a store that refuses writes; and the same proof on the REAL settings layer for "" and " " — the shape that found the regression, since a stub that auto-succeeds passes with the bug intact. - The PR body's closing keyword is weakened to `Refs`: this public PR alone leaves the mint-on-read live (its caller is in the submodule), so ent#545 is closed by trinity-enterprise#570's same-repo `Fixes` when the enterprise half lands. `docs/PRODUCT_EVENTS.md` and requirements §43.1 now state the rule with that pointer instead of asserting the fixed state in the present tense. - `funnelFormat.spec.js`: the wiring guard gets a positive anchor on the exact assignment before its two negatives, so it cannot pass vacuously on an absent file. - `tests/registry.json` re-serialised with the file's original ASCII escaping, so the #2618 entry is byte-identical again and the diff is purely additive. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Thanks — the critical is real and is fixed in a77e2fd, verified the way you found it. Before, on the real SQLite settings layer (the first cut): blank row Shape: read through the twin → claim on a miss → read back → heal through the upsert only when the row exists but holds what the read twin refuses ( Tracking items: (1) closing keyword weakened to |
… previous re-serialisation escaped 84 unrelated lines (ent#545 review follow-up) The a77e2fd re-dump used ensure_ascii, but only the #2618 entry carried escapes; the rest of the file is literal UTF-8, so 84 lines changed that this PR never meant to touch. The entry is now inserted by text into dev's bytes: the diff against dev is one new entry and the comma that joins it. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Correction to my comment above: the |
… plumbing (ent#545) The guard asserted the import and the computed call, but nothing tied `installFooter` to the DOM. Replacing the footer span with static text while leaving `const installFooter = computed(...)` intact kept all 16 tests green -- the declared-but-unrendered shape that #2659 is about, one inch from where the guard already looked. Verified both directions: the assertion passes on the branch as-is, and fails when the render is stripped. merge-train: mechanical, per the merge-train note on the PR. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Lts14MGxLdPU5tvxL6CfAo
|
merge-train 2026-09-09: on the train, and merging. The critical is fixed and I proved it the same way it was found rather than reading the diff — splicing the ejected first-cut body back into The frontend half is genuinely wired — One mechanical commit pushed to your branch — expect(panel).toMatch(/\{\{\s*installFooter\.text\s*\}\}/)Verified both directions: green on your branch as-is, red when the render is stripped. Your positive-anchor rewrite was the right instinct — this just carries it the last inch. Revert it freely if you'd rather shape it differently. Three things not blocking the merge, on the record:
Also noted for whoever reads the record later: Merging once your required checks come back green on |
Summary
GET /api/enterprise/telemetry/funnelreached the OSSget_or_create_installation_id, so on an install whose id was never minted the first admin open of Settings → Activation created the durable identity row from a read path — theget_or_create_*-on-a-read class (learnings 2026-08-05), third occurrence after Canary Slack alerts don't say which instance fired them #1987 and the ent#190 benchmark read.services/operator_intake_service.get_installation_idbeside the writer: the stored id orNone; blank / non-string reads asNone; a read failure propagates rather than rendering as "not minted". The enterprise funnel read switches to it in its own PR (landing order below).insert_setting_if_absentinstead of an upsert — two workers that SELECT-miss together land one id and the loser reads the winner's back — closing the SELECT-then-upsert race Canary Slack alerts don't say which instance fired them #1987 recorded as pre-existing.ActivationFunnelPanel.vuerenders the footer through the purefunnelFormat.jswith three honest states: minted; not minted for the backend's explicitnull, naming the one writer an operator can actually reach (the updates opt-in under Settings → General — the wizard's first product event only fires on an empty fleet or?onboarding=1); unavailable for an absent or malformed value. The touched line's two ink halves move onto the contract's ladder, count-neutral for the raw-colour ratchet.Changes
src/backend/services/operator_intake_service.py—get_installation_id(new) and the claim-shape mint;services/instance_identity.pydocstring follows (it had recorded the race as pre-existing).src/frontend/src/components/settings/ActivationFunnelPanel.vue,src/frontend/src/components/settings/funnelFormat.js(new).tests/unit/test_operator_intake.py(+9: read twin, read-only store, propagated read failure, writer and reader as one key, the racing claim),src/frontend/tests/unit/funnelFormat.spec.js(new: the three states, no blank phrase, a panel-wiring guard);tests/registry.jsongains the intake file.docs/memory/architecture/backend.md,feature-flows/telemetry-sharing.md,feature-flows/first-time-setup.md, the flows index,docs/PRODUCT_EVENTS.md, a learnings entry (the never-mint sentinel belongs on the write sink; a static guard covers what no fixture can), and the CSO diff report (no findings).Cross-repo landing order
dev. It moves no gitlink.dev— enterprise CI checks out publicdev, and its suite importsget_installation_id): the funnel read on the read twin,ActivationFunnel.installation_idnullable on the wire,tests/test_545_funnel_never_mints.pyover a real throwaway store, the ent#190 fixture's sentinel moved onto the write sink. Linked in a comment below once opened.chore(enterprise): bump the submodule pointer (fd25b47 -> …)PR ondevafter 2 merges.Until step 3 lands, the panel's not-minted branch is dormant: a pre-bump backend always answers a string, which renders exactly as today.
Test Plan
pytest tests/unit— 15023 passed, 28 skipped; the single red is the pre-existingtest_1920guard trip that only occurs on a clone with the enterprise submodule mounted (registered in the debt inbox; cannot occur on CI)vitest run— 2541 passed including both ratchets;check:tokens;vite build/verify-local, full: backend + agent images built and import-smoked, clean boot with migrations, a real agent healthy on the agent network, integration 70 passed / 13 skipped / 2 registered deselects — passnullwith the key present → the setting stays absent afterwards (no re-mint) → the restore round-trips verbatim; the footer eyeballed in both states/review— no critical findings;/cso --diff— no findingsRefs abilityai/trinity-enterprise#545 — deliberately not a closing keyword: this public PR alone leaves the mint-on-read live (the caller sits in the submodule), so the issue is closed by Abilityai/trinity-enterprise#570 (
Fixes #545there, same repo) when the enterprise half lands.🤖 Generated with Claude Code