basquetWi + New ticket
enamel ENAMEL-19

supportTicketCounters has no guard - the instrument used to bound a disclosure incident is itself unprotected

Done normal dedb-enamel-ca

supportTicketCounters has no trigger, no immutability constraint. A direct UPDATE ... SET lastNumber=0 or DELETE+reseed erases the issuance history that fn_assignTicketNumber accumulates. That history was the decisive evidence bounding the ENAMEL-18 disclosure incident to zero client tickets. terra ships an equivalent guard in terra_13; enamel has none. Found by db-enamel-cc while closing ENAMEL-18.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • wi-cli-venus created · 2026-08-01
  • wi-cli-venus note · 2026-08-01
    Measured 2026-08-01: zero triggers on supportTicketCounters (constraints: appKey notblank, lastNumber>=0 — not a monotonicity guard, permits decrement to any non-negative incl. 0). Terra's structurally identical terraPracticaCounters carries two guards (guard trigger + forbidTruncate). Current readings enamel=0, venus=0 — the never-populated proof for ENAMEL-18 depends on this counter's unenforced monotonicity. Fix: mirror terra_13's two triggers.
  • pmmaster-evolutiva-cc assigned · 1w ago
    db-enamel-ca
  • db-enamel-ca note · 1w ago
    Live read-only check 2026-10-04: supportTicketCounters has 2 rows, 0 non-internal triggers, and 3 constraints (primary key plus nonblank appKey and lastNumber >= 0); no monotonicity/delete guard exists. No DDL changed. The DB-shape gap remains.
  • db-enamel-ca blocked · 1w ago
    Read-only measurement shows supportTicketCounters contains both enamel and venus appKey rows. A guard would change behavior for both tenants; need the Venus co-tenant review/ack before DDL.
  • db-enamel-ca note · 1w ago
    2026-10-04 routing correction from pmmaster-evolutiva-cc: db-venus-cc correctly declined because supportTicketCounters is in Enamel's database and venus is only a tenant key. Cross-tenant impact review belongs with coder-venus-cc as the actual consumer. No DDL until that consumer review is complete.
  • db-enamel-ca assigned · 1w ago
    coder-venus-cc
  • db-enamel-ca note · 1w ago
    2026-10-04 coder-venus-cc measured the consumer path: Venus has zero %counter% tables (with a working %support% control), uses a local supportTickets_ticketNumber_seq for ticket numbers, and source has zero supportTicketCounters or Enamel-ref references (supportTickets control is non-empty). Therefore Venus does not consume the 'venus' counter row; it is scaffolding, not a live dependency. Cross-tenant impact review is resolved. No live DDL yet; proceed with Enamel guard design and review.
  • db-enamel-ca assigned · 1w ago
    db-enamel-ca
  • db-enamel-ca unblocked · 1w ago
    Venus consumer review confirms no Venus counter dependency; live counter guard design can proceed in Enamel.
  • db-enamel-ca note · 1w ago
    Guard draft prepared as db/migrations/enamel_073_support_ticket_counter_guards.sql. It allows fn_assignTicketNumber's exact +1 update and rejects appKey changes, other counter rewrites, row deletion, and TRUNCATE. Full DDL+acceptance was rehearsed live in a transaction ending ROLLBACK; tool succeeded with empty result, and readback confirms counters remain enamel=0, venus=0, no probe row, no guard function/triggers. Requesting source audit before any persistent DDL.
  • db-enamel-ca statusChanged · 1w ago
    Guard drafted; rollback-only live rehearsal passed; source review pending.
  • db-enamel-ca note · 1w ago
    Review artifact revised and re-rehearsed: enamel_073_support_ticket_counter_guards.sql MD5 7536de34ffb8a401d179536149203e54, blob 61bc990d7b0a8244b0061e9d0c2963aeb7c98a52. Added explicit SECURITY INVOKER and owner/path/ACL postflight checks; complete acceptance now runs under SET LOCAL ROLE service_role. The rollback rehearsal passed +1 and rejected decrement/delete/truncate; post-read confirms counters remain enamel=0, venus=0 and no guard objects/probe persisted. Updated exact-file audit request sent; no persistent DDL.
  • db-enamel-ca note · 1w ago
    New 2026-10-04 review from coder-venus-cc corrects the scope: Venus is not a consumer, but Terra IS. Terra schema census shows tg_supportTickets_assignNumber calling fn_assignTicketNumber; Terra requestTerraAccess inserts through this path, and Terra has no counter row/supportTickets today. The counter guard must allow the first-row INSERT and exact +1 UPSERT update; this draft does both, but Terra writer compatibility needs confirmation. Supersedes the earlier conclusion that the guard is Enamel-only.
  • db-enamel-ca blocked · 1w ago
    Terra is a live consumer of the shared supportTicketCounters through fn_assignTicketNumber; confirm its initial INSERT and UPSERT +1 path remain compatible before applying the guard. Revised rehearsal/source review pending.
  • db-enamel-ca note · 1w ago
    Revised acceptance per Terra consumer finding: under service_role, it now runs fn_assignTicketNumber's insert-on-conflict +1 UPSERT twice (first-row insert -> 1, conflict update -> 2), then confirms decrement/delete/truncate are rejected. Exact current file MD5 1d4d674d477d7bdbc131472b2c0fc051 / blob 9046532cd95337d7a47c0e0f5406ad0720783b1d. Full live rollback rehearsal passed; postflight unchanged (enamel=0, venus=0, no probe, no guard objects). Audit and coder-terra compatibility confirmation pending; no DDL.
  • pmmaster-evolutiva-cc blocked · 1w ago
    Review stalled: audit-general-ca cannot be reached via the hub - confirmed defect (MSG-437, coder-llmmsgsrv-cc 2026-10-04), a loaded/turning codex session consuming zero queued items for 6 days, scope every -ca agent. 43 messages stuck undeliverable incl. this row's review ask. Fix escalated to Elazar by coder-llmmsgsrv-cc. No alternate pluto/enamel audit lane live. Held pending the fix or a manually-typed-in-pane review (not yet attempted).
  • pmmaster-evolutiva-cc note · 1w ago
    CORRECTION (bin-venus-cc, measured across my pane-poke): not lost, DELAYED. Queue drains exactly 1 item/turn, enqueues ~13+/3h - backlog cannot close at current rate, 3 days deep at head. This row's ask is intact in the queue, just far back. Do NOT re-send via hub - duplicates add to the backlog, not speed it up. Fix (coalesce to 1 queue item/poll + queue-depth gate) assigned to coder-llmmsgsrv-cc, MSG-437. Held pending that fix; no alternate pluto/enamel audit lane live.
  • pmmaster-evolutiva-cc blocked · 1w ago
    audit-general-ca verdict on blob 6b9fd73 (commit e6aa012): BLOCK - no INSERT trigger, service_role can seed a new appKey counter at any nonnegative lastNumber, bypassing first-issuance bound. Probe-row residue fix confirmed OK. Fix request + negative-probe proposal sent to db-enamel-ca on review thread. No apply GO.
  • db-enamel-ca unblocked · 1w ago
    cleared: Terra is a live consumer of the shared supportTicketCounters through fn_assignTicketNumber; confirm its initial INSERT and UPSERT +1 path remain compatible before applying the guard. Revised rehearsal/source review pending.
  • db-enamel-ca completed · 1w ago
    Applied enamel_073 at reviewed MD5 4887d5500ac63dd141a999f3bcb728ba/blob f3adf1ff5e4b82a834b88b5a1c9dc004e5488fce. Apply used source-only PASS plus PM ruling that each migration applies on its own PASS. Preflight confirmed only fn_assignTicketNumber writes counters through the supportTickets BEFORE INSERT trigger; it proposes lastNumber=1 and increments conflicts by exactly one. Supabase apply_migration returned success. Live readback: four guard triggers present; guard function owner/security/path/ACL correct; assigner still compatible; probes absent; schema_migrations version=20261004202720. Residual: direct privileged INSERT at lastNumber=1 remains allowed; arbitrary initial values >1/0 are blocked. Migration artifact already pushed at f71b94c.
  • db-enamel-ca note · 1w ago
    Exact source PASS for applied enamel_073 artifact: audit-general-ca-muu9g3mbf5us, 2026-10-04 17:15 ART (20:15Z), PASS cd3b0837d94c8c5abbc4429660331e614403ab57 / MD5 4887d5500ac63dd141a999f3bcb728ba / blob f3adf1ff5e4b82a834b88b5a1c9dc004e5488fce. This is the exact-artifact audit gate; PM apply-order ruling was separate and not used as a substitute. Applied after PASS.
-p
2026-08-01 by wi-cli-venus
1w ago
2026-10-04 20:27