From db0dc2980ec22a4c01c03fc91827afb10d46f4c3 Mon Sep 17 00:00:00 2001 From: Lucas Tavano Date: Fri, 13 Nov 2026 20:59:30 -0300 Subject: [PATCH 1/4] Preserve observed contracts in pipeline, eligibility, revision and field reviews --- docs/provenance.md | 2 +- docs/source-review.md | 8 +- evals/fixtures/engineering-pairs/README.md | 24 ++++ evals/fixtures/engineering-pairs/boundary.txt | 1 + evals/fixtures/engineering-pairs/cases.json | 132 ++++++++++++++++++ .../engineering-pairs/discoveries.json | 32 +++++ evals/fixtures/engineering-pairs/holdout.exs | 11 ++ .../fixtures/engineering-pairs/operation.exs | 28 ++++ evals/fixtures/engineering-pairs/replay.py | 58 ++++++++ evals/fixtures/engineering-pairs/request.txt | 1 + evals/results/2026-11-13-domain-ab.md | 31 ++++ evals/results/2026-11-13-engineering-ab.md | 107 ++++++++++++++ priv/library/skills/accessibility/SKILL.md | 2 + .../skills/commercial-eligibility/SKILL.md | 1 + priv/library/skills/data-pipelines/SKILL.md | 1 + priv/library/skills/revision-lineage/SKILL.md | 1 + 16 files changed, 435 insertions(+), 5 deletions(-) create mode 100644 evals/fixtures/engineering-pairs/README.md create mode 100644 evals/fixtures/engineering-pairs/boundary.txt create mode 100644 evals/fixtures/engineering-pairs/cases.json create mode 100644 evals/fixtures/engineering-pairs/discoveries.json create mode 100644 evals/fixtures/engineering-pairs/holdout.exs create mode 100644 evals/fixtures/engineering-pairs/operation.exs create mode 100644 evals/fixtures/engineering-pairs/replay.py create mode 100644 evals/fixtures/engineering-pairs/request.txt create mode 100644 evals/results/2026-11-13-domain-ab.md create mode 100644 evals/results/2026-11-13-engineering-ab.md diff --git a/docs/provenance.md b/docs/provenance.md index 86e973d..6f7fd76 100644 --- a/docs/provenance.md +++ b/docs/provenance.md @@ -154,7 +154,7 @@ documentation or source of the version named; no passage is reproduced. The review added `pipelines.md`, `architecture.md`, `library-authoring.md` and `agent-loop.md`, expanded `code-shape.md` with the anti-pattern vocabulary, and added the `data-pipelines` workflow for flows of many items, whose CI namesake -`pipeline-design` now points to it. +`pipeline-design` now points to it. A later [paired engineering exercise](../evals/results/2026-11-13-engineering-ab.md) contributed the distinction between records examined and records changed in a paged repair. ## Refactoring workflows in 0.8 diff --git a/docs/source-review.md b/docs/source-review.md index fcbfd1a..f9a1d25 100644 --- a/docs/source-review.md +++ b/docs/source-review.md @@ -18,14 +18,14 @@ are not packaged. “Original workflow” means the historical authored material | Code | [`abstraction-layers`](../priv/library/skills/abstraction-layers/SKILL.md) | `stratified-design` | elixir-antipatterns | A reader can follow the business intent without chasing a chain of one-line wrappers or decoding transport mechanics. | | Code | [`module-design`](../priv/library/skills/module-design/SKILL.md) | `organizar-modulos` | elixir-antipatterns | Each public module name predicts its responsibility, and exported operations form a coherent promise to consumers. | | Code | [`code-consolidation`](../priv/library/skills/code-consolidation/SKILL.md) | `consolidar-codigo` | elixir-antipatterns | The resulting API names the common concept and leaves meaningful differences visible at call sites. | -| Domains | [`revision-lineage`](../priv/library/skills/revision-lineage/SKILL.md) | `versoes-e-rastreabilidade` + `assets-e-imagens` | original workflows; shared contract | Viewing never selects; every revision, pointer and derived artifact carries an identifier that survives regeneration and migration. | +| Domains | [`revision-lineage`](../priv/library/skills/revision-lineage/SKILL.md) | `versoes-e-rastreabilidade` + `assets-e-imagens` | original workflows; shared contract | Viewing never selects; every revision, pointer and derived artifact carries an identifier that survives regeneration and migration. Distinguish a change of published selection from recovery into a separately owned editable copy. | | Backend | [`data-contracts`](../priv/library/skills/data-contracts/SKILL.md) | `contratos-e-dados` | elixir-ecto-patterns | Document accepted input, output, errors and side effects at each meaningful boundary without repeating the same rule in every layer. | | Frontend | [`ui-identity`](../priv/library/skills/ui-identity/SKILL.md) | `identidade-ui` | ui-review; impeccable; playbook-antislop | Make the primary action and essential information distinguishable by hierarchy, position, typography and wording; a decorative accent is not a substitute. | | Frontend | [`layout-density`](../priv/library/skills/layout-density/SKILL.md) | `espaco-e-densidade` | ui-review; impeccable | Align related labels, values and actions on a stable grid. Group information by decision, then give primary and secondary content appropriate weight. | | Frontend | [`navigation-ux`](../priv/library/skills/navigation-ux/SKILL.md) | `ux-e-navegacao` | ui-review; impeccable | Make the next meaningful action discoverable at each step without hiding context or creating an endless wizard. | | Frontend | [`responsive-layout`](../priv/library/skills/responsive-layout/SKILL.md) | `mobile-e-responsividade` (layout half) | ui-review; impeccable | The task works at every width of a declared matrix with real content, touch and keyboard; history and overlays moved to `navigation-ux`. | | Frontend | [`direct-interactions`](../priv/library/skills/direct-interactions/SKILL.md) | `interacoes-diretas` | ui-review; impeccable | Use a representation that communicates the actual choice, such as a segmented control or thumbnail, without turning decoration into a hidden input. | -| Frontend | [`accessibility`](../priv/library/skills/accessibility/SKILL.md) | `acessibilidade` | ui-review; WCAG 2.2 | Provide correct heading/landmark order, labels and programmatic relationships that match the visible task. | +| Frontend | [`accessibility`](../priv/library/skills/accessibility/SKILL.md) | `acessibilidade` | ui-review; WCAG 2.2 | Provide correct heading/landmark order, labels and programmatic relationships that match the visible task. Inspect composed fields after rendering and follow each error source through correction. | | Frontend | [`design-system`](../priv/library/skills/design-system/SKILL.md) | `design-system` | impeccable; stitch-design-taste | Describe principles by purpose: hierarchy, density, typography, color role, motion, imagery and interaction states, not a fashionable fixed palette. | | Frontend | [`motion-design`](../priv/library/skills/motion-design/SKILL.md) | — (external adaptation) | motion-kit (MIT, pinned commit); Material 3; IBM Carbon | Every animated change names the state it explains, the curve and duration derived for it, and a reduced-motion alternative that keeps the state legible. | | Code | [`performance`](../priv/library/skills/performance/SKILL.md) | `performance` | original workflow; shared contract | Before/after measurements use comparable inputs, warmup, configuration and statistical summary. | @@ -36,10 +36,10 @@ are not packaged. “Original workflow” means the historical authored material | Code | [`async-state`](../priv/library/skills/async-state/SKILL.md) | `estados-assincronos` | original workflow; shared contract | The UI and API can reconcile after reconnect or reload using persisted identifiers and a current-state read. | | Domains | [`ai-orchestration`](../priv/library/skills/ai-orchestration/SKILL.md) | `orquestracao-ias` | original workflow; shared contract | Acquisition, release, timeout, cancellation and crash recovery keep capacity counters consistent. | | Backend | [`provider-calls`](../priv/library/skills/provider-calls/SKILL.md) | none (new in 0.5) | a consuming application's paid-call rules, generalized; shared contract | Every call has one audit row at the provider's billing moment, failures are typed reasons, and a failed round trip never charges twice. | -| Backend | [`data-pipelines`](../priv/library/skills/data-pipelines/SKILL.md) | none (new in 0.7) | Elixir, Ecto, GenStage, Flow and Broadway documentation; shared contract | Every stage is bounded, a duplicate delivery produces one effect, and a poisoned item leaves the flow with a record without blocking the rest. | +| Backend | [`data-pipelines`](../priv/library/skills/data-pipelines/SKILL.md) | none (new in 0.7) | Elixir, Ecto, GenStage, Flow and Broadway documentation; shared contract | Stages stay bounded; duplicates and poison items do not block progress. A retained page advances the cursor without changing the meaning of public progress counts. | | Domains | [`notifications`](../priv/library/skills/notifications/SKILL.md) | `notificacoes-e-bots` | original workflow; shared contract | A source event has stable identity through delivery so duplicate callbacks/retries do not create unexplained sends. | | Domains | [`integration-setup`](../priv/library/skills/integration-setup/SKILL.md) | `setup-integracoes` | original workflow; shared contract | The UI and backend use one readiness contract with specific reasons, not several booleans with conflicting meanings. | -| Domains | [`commercial-eligibility`](../priv/library/skills/commercial-eligibility/SKILL.md) | `elegibilidade-comercial` | original workflow; shared contract | A single domain rule answers whether the exact offer can be produced, sold and fulfilled at its destination. | +| Domains | [`commercial-eligibility`](../priv/library/skills/commercial-eligibility/SKILL.md) | `elegibilidade-comercial` | original workflow; shared contract | A single domain rule answers whether the exact offer can be produced, sold and fulfilled at its destination. Trace all included components separately from unselected siblings. | | Domains | [`metrics-costs`](../priv/library/skills/metrics-costs/SKILL.md) | `metricas-e-custos` | original workflow; shared contract | A metric definition states numerator, denominator, unit, period, source and exclusions so two screens mean the same thing. | | Domains | [`operational-alerts`](../priv/library/skills/operational-alerts/SKILL.md) | `alertas-operacionais` | original workflow; shared contract | Repeated events for one active issue update a stable alert rather than flooding the operator. | | Domains | [`simulation-isolation`](../priv/library/skills/simulation-isolation/SKILL.md) | `simulacao-e-producao` | original workflow; shared contract | Simulation cannot reach real orders, payments, messages or provider writes through a hidden common code path. | diff --git a/evals/fixtures/engineering-pairs/README.md b/evals/fixtures/engineering-pairs/README.md new file mode 100644 index 0000000..79660fc --- /dev/null +++ b/evals/fixtures/engineering-pairs/README.md @@ -0,0 +1,24 @@ +# Offline engineering behavior checks + +These synthetic modules are small models of historical application contracts. +They are evaluator artifacts, not application code or shipped agent guidance. +Use Python 3 and Elixir on PATH: + +```sh +python3 evals/fixtures/engineering-pairs/replay.py +``` + +The replay runs each recorded output in a separate Elixir process. For each +primary case, `cases.json` contains the participant brief, independently held +assertions, design criteria, modules actually returned and SHA-256 hashes of +the full original answers, including the omitted prose. The executable checks +do not score readability, dependency direction or deployment recommendations. +The accompanying report records that separate inspection. + +For the discovery case, copy only `operation.exs` as `job.exs` and +`boundary.txt` as `recording.md` into each participant directory. +`request.txt` is the participant brief. Keep `holdout.exs`, `cases.json`, +`discoveries.json` and the grader outside those directories. A is the control; +B additionally receives the canonical shared contract and data-pipelines +workflow. The follow-up used the same files, brief and oracle after a focused workflow change. A recorded answer can fail an oracle: a successful replay means +the original verdict was reproduced, not that every answer passed. diff --git a/evals/fixtures/engineering-pairs/boundary.txt b/evals/fixtures/engineering-pairs/boundary.txt new file mode 100644 index 0000000..924d99c --- /dev/null +++ b/evals/fixtures/engineering-pairs/boundary.txt @@ -0,0 +1 @@ +Support and accounting agree on these words: a manual mark only recorded an operator decision. A posting made by the system is already authoritative even if its link disappeared. A ledger entry that later reversed still represents a real movement; entries imported from old statements are also real. Duties do not allow the cleanup to change such history. The database may change between discovery and applying a write; use the current stored row. No numeric assumption beyond unique integer record IDs has been specified. diff --git a/evals/fixtures/engineering-pairs/cases.json b/evals/fixtures/engineering-pairs/cases.json new file mode 100644 index 0000000..5682c5d --- /dev/null +++ b/evals/fixtures/engineering-pairs/cases.json @@ -0,0 +1,132 @@ +{ + "data-contracts": { + "brief": "The batch-request changeset has an internal count limit of 4 in Limits.max/0; Batch.submit/1 uses this module and returns :accepted or {:error, :too_many}. A view currently repeats the number in wording; views may depend on Batch only. Deliver all three small modules Limits, Batch and View. The public view function View.hint/0 returns \"Up to 4 entries\" today. The product still promises four, but maintaining the number in two places caused a regression. Accept any list of entries, including an empty list.", + "oracle": "Unique numeric owner; facade accessor consumed by the hint; actual boundary +/-1 plus changing owner must move both consumers.", + "checks": "assert Batch.submit([]) == :accepted\nassert Batch.submit([1,2,3,4]) == :accepted\nassert Batch.submit([1,2,3,4,5]) == {:error,:too_many}\nassert View.hint() == \"Up to 4 entries\"", + "answer_sha256": { + "a": "d49a32939dc82430d3a4e8688ba6b0a2447c1e90a9f60e0375c8125d20a94aa8", + "b": "b0c5b49bcca82491b18beb7d71ffe3f1dc3e4f92dbdfe953b534090a1c200174" + }, + "returned_modules": { + "a": "defmodule Limits do\n def max, do: 4\nend\n\ndefmodule Batch do\n def max_entries, do: Limits.max()\n\n def submit(entries) when is_list(entries) do\n if length(entries) <= max_entries() do\n :accepted\n else\n {:error, :too_many}\n end\n end\nend\n\ndefmodule View do\n def hint, do: \"Up to #{Batch.max_entries()} entries\"\nend\n", + "b": "defmodule Limits do\n def max, do: 4\nend\n\ndefmodule Batch do\n def max_entries, do: Limits.max()\n\n def submit(entries) when is_list(entries) do\n if length(entries) <= max_entries() do\n :accepted\n else\n {:error, :too_many}\n end\n end\nend\n\ndefmodule View do\n def hint do\n \"Up to #{Batch.max_entries()} entries\"\n end\nend\n" + } + }, + "migration-compatibility": { + "brief": "We are midway through introducing a stable reference into a snapshot. Old readers require the :label field. New readers use :ref when available, otherwise can obtain an optional reference from the linked source. Some old rows have lost their source; some are supported platform records for which a ref does not exist by design. A runner must survive mixed data and restarts, and cannot discard snapshot fields from the previous version. Implement Upgrade.row(snapshot, linked_ref, kind) -> {outcome, snapshot} for :ordinary or :platform records; outcomes are :updated, :unchanged or :unresolved. Write a brief deployment/rollback decision for whether the dual reader can be retired today. No production inventory or rollout evidence is supplied.", + "oracle": "Preserve unknown/legacy fields; idempotent no overwrite; unresolved orphan not fabricated, platform exempt; require writer rollout/backfill reconciliation with unresolved handled before destructive cutoff.", + "checks": "assert Upgrade.row(%{label: \"old\", other: 5},7,:ordinary) == {:updated,%{label: \"old\", other: 5,ref: 7}}\nassert Upgrade.row(%{ref: 9,label: \"v\"},7,:ordinary) == {:unchanged,%{ref: 9,label: \"v\"}}\nassert Upgrade.row(%{label: \"x\"},nil,:ordinary) == {:unresolved,%{label: \"x\"}}\nassert Upgrade.row(%{label: \"x\"},nil,:platform) == {:unchanged,%{label: \"x\"}}\nassert Upgrade.row(%{ref: nil},7,:ordinary) == {:updated,%{ref: 7}}", + "answer_sha256": { + "a": "0f9a45ffb76e56774e03394c8a0e311290c95097a2f3db09c12b793bdaf63419", + "b": "1f78d8a9b79f1a7dc122f322764c9eed09d024bce44121640811868202e3af90" + }, + "returned_modules": { + "a": "defmodule Upgrade do\n @moduledoc false\n\n @type outcome :: :updated | :unchanged | :unresolved\n @type kind :: :ordinary | :platform\n\n @spec row(map(), term(), kind()) :: {outcome(), map()}\n def row(snapshot, linked_ref, kind)\n when is_map(snapshot) and kind in [:ordinary, :platform] do\n case {Map.get(snapshot, :ref), kind, linked_ref} do\n {nil, :ordinary, nil} ->\n {:unresolved, snapshot}\n\n {nil, :ordinary, ref} ->\n {:updated, Map.put(snapshot, :ref, ref)}\n\n _ ->\n {:unchanged, snapshot}\n end\n end\nend\n", + "b": "defmodule Upgrade do\n @type kind :: :ordinary | :platform\n @type outcome :: :updated | :unchanged | :unresolved\n\n @spec row(map(), term() | nil, kind()) :: {outcome(), map()}\n def row(snapshot, linked_ref, kind)\n when is_map(snapshot) and kind in [:ordinary, :platform] do\n cond do\n Map.get(snapshot, :ref) != nil ->\n {:unchanged, snapshot}\n\n kind == :platform ->\n {:unchanged, snapshot}\n\n is_nil(linked_ref) ->\n {:unresolved, snapshot}\n\n true ->\n {:updated, Map.put(snapshot, :ref, linked_ref)}\n end\n end\nend\n" + } + }, + "provider-calls": { + "brief": "A mail relay sometimes rejects the connection for hours. Three tries within one minute lose messages. Status calls can establish a pre-delivery failure, a permanent refusal, confirmed delivery, or an ambiguous result after submission. This provider has no deduplication API. Re-granting a resource to the same person later is a legitimate new event, even when the audit key (recipient plus resource) repeats. The approved outage budget is five total attempts; delay after each of the first four attempts is 1, 10, 60 or 360 minutes. Deliver Relay.next(status, attempt, seen_audit_key?) as a policy for an existing job, returning {:retry_in, seconds}, :complete, :failed or :reconcile. Status is :temporary_before_send, :permanent, :delivered, or :unknown_after_send. Indicate what the worker must store or do with ambiguous results.", + "oracle": "Transient schedule seconds and finite stop; no uncertain resend; repeats of audit keys cannot blanket suppress a new event; permanent/confirmed are terminal.", + "checks": "for seen <- [true,false] do\n assert Enum.map(1..4, &Relay.next(:temporary_before_send,&1,seen)) == [{:retry_in,60},{:retry_in,600},{:retry_in,3600},{:retry_in,21600}]\n assert Relay.next(:temporary_before_send,5,seen) == :failed\n assert Relay.next(:permanent,1,seen) == :failed\n assert Relay.next(:delivered,1,seen) == :complete\n assert Relay.next(:unknown_after_send,2,seen) == :reconcile\nend", + "answer_sha256": { + "a": "6f4b0cc6e6ca9d75719371f93737696b07e570ba8e8558c383fda7b1754e1cc9", + "b": "2c1d853437f56b6c9d989b365b7fa927ef8d62936d1cc326cc68d0f4db5b68ec" + }, + "returned_modules": { + "a": "defmodule Relay do\n @retry_delays {60, 600, 3_600, 21_600}\n\n @type status ::\n :temporary_before_send\n | :permanent\n | :delivered\n | :unknown_after_send\n\n @spec next(status(), 1..5, boolean()) ::\n {:retry_in, pos_integer()} | :complete | :failed | :reconcile\n def next(status, attempt, _seen_audit_key?)\n when is_integer(attempt) and attempt >= 1 and attempt <= 5 do\n case status do\n :temporary_before_send when attempt < 5 ->\n {:retry_in, elem(@retry_delays, attempt - 1)}\n\n :temporary_before_send ->\n :failed\n\n :permanent ->\n :failed\n\n :delivered ->\n :complete\n\n :unknown_after_send ->\n :reconcile\n end\n end\nend\n", + "b": "defmodule Relay do\n @type status ::\n :temporary_before_send | :permanent | :delivered | :unknown_after_send\n\n @type decision :: {:retry_in, pos_integer()} | :complete | :failed | :reconcile\n\n @retry_delays_seconds {60, 600, 3_600, 21_600}\n\n @spec next(status(), 1..5, boolean()) :: decision()\n def next(status, attempt, seen_audit_key?)\n when status in [\n :temporary_before_send,\n :permanent,\n :delivered,\n :unknown_after_send\n ] and\n is_integer(attempt) and attempt >= 1 and attempt <= 5 and\n is_boolean(seen_audit_key?) do\n case status do\n :delivered ->\n :complete\n\n :permanent ->\n :failed\n\n :unknown_after_send ->\n :reconcile\n\n :temporary_before_send when attempt < 5 ->\n {:retry_in, elem(@retry_delays_seconds, attempt - 1)}\n\n :temporary_before_send ->\n :failed\n end\n end\nend\n" + } + }, + "data-pipelines": { + "brief": "An old batch conversion walks records sorted by strictly increasing integer id. Convert a manually marked :settled item into :waived only when the ledger has no recorded transfer, even a refunded one. Bank-marked items must stay settled even if the charge link vanished. A retained item still matches the current read predicate, so a worker asking only for the first N qualifying records can loop. Implement Walk.page(rows, after_id, limit) yielding {ids_to_convert, next_cursor}; rows are {id, status, manual?, evidence}, evidence one of :none, :settled, :refunded, :legacy. Fetch the next limit manually marked settled candidates by id (the query applies both predicates); on a nonempty page return the highest examined candidate ID even if no IDs may be converted, else :done. State the update condition that avoids overwriting another actor after paging and how a restarting worker makes progress.", + "oracle": "Page includes retained rows; monotonic progression on all-retained page, bounded sorted window, protects bank/ledger provenance; apply guarded updates and advance checkpoint only after durable success.", + "checks": "rows=[{7,:settled,true,:none},{2,:settled,true,:legacy},{1,:settled,false,:none},{5,:settled,true,:refunded},{4,:settled,true,:settled},{6,:waived,true,:none}]\nrows=Enum.sort_by(rows,&elem(&1,0))\nassert Walk.page(rows,0,2) == {[],4}\nassert Walk.page(rows,4,2) == {[7],7}\nassert Walk.page(rows,7,2) == {[],:done}\nassert Walk.page([{1,:settled,true,:none},{2,:settled,true,:none},{3,:settled,true,:none}],0,2) == {[1,2],2}", + "answer_sha256": { + "a": "3ffdd03fd1d4e8b71c86cd19bc769bed2eb7c7f1d351928f73276fd7cb0da54b", + "b": "525a806241b5fd89652f93c79cc4d103d602049644e2c8eaaeb1da8b575dd497" + }, + "returned_modules": { + "a": "defmodule Walk do\n @type evidence :: :none | :settled | :refunded | :legacy\n @type row :: {integer(), atom(), boolean(), evidence()}\n\n @spec page([row()], integer(), pos_integer()) ::\n {[integer()], integer() | :done}\n def page(rows, after_id, limit)\n when is_integer(after_id) and is_integer(limit) and limit > 0 do\n candidates =\n rows\n |> Stream.filter(fn\n {id, :settled, true, _evidence} -> id > after_id\n _ -> false\n end)\n |> Enum.take(limit)\n\n case candidates do\n [] ->\n {[], :done}\n\n _ ->\n {reversed_ids, cursor} =\n Enum.reduce(candidates, {[], after_id}, fn\n {id, :settled, true, :none}, {ids, _cursor} ->\n {[id | ids], id}\n\n {id, :settled, true, _evidence}, {ids, _cursor} ->\n {ids, id}\n end)\n\n {Enum.reverse(reversed_ids), cursor}\n end\n end\nend\n", + "b": "defmodule Walk do\n @type evidence :: :none | :settled | :refunded | :legacy\n @type row :: {integer(), atom(), boolean(), evidence()}\n\n @spec page(Enumerable.t(), integer() | nil, pos_integer()) ::\n {[integer()], integer() | :done}\n def page(rows, after_id, limit)\n when (is_nil(after_id) or is_integer(after_id)) and\n is_integer(limit) and limit > 0 do\n {reversed_ids, cursor} =\n rows\n |> Stream.filter(fn {id, status, manual?, _evidence} ->\n (is_nil(after_id) or id > after_id) and\n status == :settled and manual? == true\n end)\n |> Stream.take(limit)\n |> Enum.reduce({[], :done}, fn {id, :settled, true, evidence},\n {ids, _cursor} ->\n ids = if evidence == :none, do: [id | ids], else: ids\n {ids, id}\n end)\n\n {Enum.reverse(reversed_ids), cursor}\n end\nend\n" + } + }, + "abstraction-layers": { + "brief": "Simplify a single toggle operation that mixes a decision about an existing connection, saving it, and post-success effects. A minimal harness injects callbacks through a map. Preserve Link.toggle(a,b,ops): ops.lookup.(a,b) yields nil or a record. If nil, ops.insert.(a,b) returns {:ok,row} or {:error,reason}; only on success call ops.notice.(a,b) then ops.broadcast.(a,b), and return {:ok,:on}. Otherwise call ops.delete.(record) once and return {:ok,:off}; the existing delete path ignores its return value, and performs no notifications. Keep this to one module; make the top-level operation easier to read without changing its contract.", + "oracle": "Separate decision from lower-level persistence/announcement; unchanged result and ordered effects on successful create, error create and failed delete.", + "checks": "for {record,insert,answer,trace} <- [{nil,{:ok,:new},{:ok,:on},[:lookup,:insert,:notice,:broadcast]},{nil,{:error,:collision},{:error,:collision},[:lookup,:insert]},{:old,:unused,{:ok,:off},[:lookup,:delete]}] do\n Process.put(:events,[])\n f=fn k -> Process.put(:events,Process.get(:events)++[k]) end\n ops=%{lookup: fn :a,:b -> f.(:lookup); record end,insert: fn :a,:b -> f.(:insert); insert end,notice: fn :a,:b -> f.(:notice) end,broadcast: fn :a,:b -> f.(:broadcast) end,delete: fn :old -> f.(:delete); {:error,:stale} end}\n assert Link.toggle(:a,:b,ops) == answer\n assert Process.get(:events) == trace\nend", + "answer_sha256": { + "a": "b3ad142cb77d8f8b2c5da732bb17da10c30c679c58daf47fa7d3a1265cfe4793", + "b": "7c4787bc22a24cb7a036976c41269eba63955ada98a02491f1092987a87acf60" + }, + "returned_modules": { + "a": "defmodule Link do\n def toggle(a, b, ops) do\n case ops.lookup.(a, b) do\n nil ->\n turn_on(a, b, ops)\n\n record ->\n ops.delete.(record)\n {:ok, :off}\n end\n end\n\n defp turn_on(a, b, ops) do\n case ops.insert.(a, b) do\n {:ok, _row} ->\n ops.notice.(a, b)\n ops.broadcast.(a, b)\n {:ok, :on}\n\n {:error, reason} ->\n {:error, reason}\n end\n end\nend\n", + "b": "defmodule Link do\n def toggle(a, b, ops) do\n case ops.lookup.(a, b) do\n nil -> turn_on(a, b, ops)\n record -> turn_off(record, ops)\n end\n end\n\n defp turn_on(a, b, ops) do\n case ops.insert.(a, b) do\n {:ok, _row} ->\n ops.notice.(a, b)\n ops.broadcast.(a, b)\n {:ok, :on}\n\n {:error, reason} ->\n {:error, reason}\n end\n end\n\n defp turn_off(record, ops) do\n ops.delete.(record)\n {:ok, :off}\n end\nend\n" + } + }, + "module-design": { + "brief": "A storage adapter imports CatalogTile just to build the existing disk key, yet the catalogue already needs the adapter for public URLs. The codebase has a downward dependency rule: Storage must not depend on CatalogTile. There are no external callers of the historical key/subdirectory helpers. Deliver minimal replacements for both modules. The facade contracts that must survive are CatalogTile.url(%{slug: \"a\"}) -> \"/assets/tiles/a.svg\", and Storage.upload(\"a\", writer) -> whatever writer.(\"tiles/a.svg\") returns. Existence checks and seed jobs need one canonical key derived from a plain slug at Storage.key/1. The adapter's public_url/1 simply prefixes \"/assets/\".", + "oracle": "Storage owns key; catalog reads simple key without reverse dependency or duplicate builder; existing read and write paths use identical stored key and pass through writer result.", + "checks": "for s <- [\"a\",\"z-9\"] do\n k=\"tiles/\"<>s<>\".svg\"\n assert Storage.key(s)==k\n assert CatalogTile.url(%{slug: s})==\"/assets/\"<>k\n assert Storage.upload(s,fn key -> {:saved,key} end)=={:saved,k}\nend", + "answer_sha256": { + "a": "c5a77e94100ebb7bf330943986285695e4465d714ec68a983e4c7f9da99fbba3", + "b": "a0fbf015c3d49a6d63c9925495eaeef3c86e654c14417845cd031dd29d21079c" + }, + "returned_modules": { + "a": "defmodule Storage do\n def key(slug), do: \"tiles/#{slug}.svg\"\n\n def upload(slug, writer), do: writer.(key(slug))\n\n def public_url(key), do: \"/assets/\" <> key\nend\n\ndefmodule CatalogTile do\n def url(%{slug: slug}) do\n slug\n |> Storage.key()\n |> Storage.public_url()\n end\nend\n", + "b": "defmodule Storage do\n def key(slug) when is_binary(slug), do: \"tiles/\" <> slug <> \".svg\"\n\n def upload(slug, writer), do: writer.(key(slug))\n\n def public_url(key), do: \"/assets/\" <> key\nend\n\ndefmodule CatalogTile do\n def url(%{slug: slug}) do\n slug\n |> Storage.key()\n |> Storage.public_url()\n end\nend\n" + } + }, + "code-consolidation": { + "brief": "Three entry points have local copies of the normalization of a person's display name. Registration.clean/1 and Profile.clean/1 return a value; Account.change/1 accepts a map of changes and must touch :name only if present; account changes also include unrelated :title which explicitly retains surrounding blanks. PersonLabel already owns the validation of display names. Deliver the four small modules (include only relevant functions). Consolidate normalization there, preserving nil, all internal spacing and the spelling of a name. Leading/trailing whitespace is not intentional.", + "oracle": "One named domain owner, all three callers, nil, original internal spaces, no insertion of missing change and no alteration of unrelated fields.", + "checks": "for v <- [nil,\" L N\t\",\"\t\",\"One\"] do\n w=if is_nil(v), do: nil, else: String.trim(v)\n assert Registration.clean(v)==w\n assert Profile.clean(v)==w\n assert Account.change(%{name: v,title: \" X \"})==%{name: w,title: \" X \"}\nend\nassert Account.change(%{title: \" x \"})==%{title: \" x \"}", + "answer_sha256": { + "a": "906440bb502dbd87080982eaa646a95e38684469ee521197f3f8b9f99f2268fc", + "b": "c0d2c9ac93e469b0dd0a34ac55d213c88c827eff6b54e3b476e817204a2df6d1" + }, + "returned_modules": { + "a": "defmodule PersonLabel do\n def normalize(nil), do: nil\n def normalize(name) when is_binary(name), do: String.trim(name)\nend\n\ndefmodule Registration do\n def clean(name), do: PersonLabel.normalize(name)\nend\n\ndefmodule Profile do\n def clean(name), do: PersonLabel.normalize(name)\nend\n\ndefmodule Account do\n def change(changes) when is_map(changes) do\n case changes do\n %{name: name} -> %{changes | name: PersonLabel.normalize(name)}\n _ -> changes\n end\n end\nend\n", + "b": "defmodule PersonLabel do\n def normalize(nil), do: nil\n def normalize(name) when is_binary(name), do: String.trim(name)\nend\n\ndefmodule Registration do\n def clean(name), do: PersonLabel.normalize(name)\nend\n\ndefmodule Profile do\n def clean(name), do: PersonLabel.normalize(name)\nend\n\ndefmodule Account do\n def change(changes) when is_map(changes) do\n case Map.fetch(changes, :name) do\n {:ok, name} -> Map.put(changes, :name, PersonLabel.normalize(name))\n :error -> changes\n end\n end\nend\n" + } + }, + "house-patterns": { + "brief": "A narrow style guard rejected Panel.refresh/4. The written local rule is one pipeline stage per line and a raw value at the start; a pipeline may be kept across multiple dependent transformations. Existing modules follow this. Current intended behavior: if requested == state.current, return state; otherwise start with state, then call put_current(requested), then invoke load.(updated_state). The injected put_current/2 helper sets :current using Map.put/3; it is passed as the third argument, and load as the fourth. Write the corrected Panel.refresh(state, requested, put_current, load) and keep the guard's pattern visible. No other style changes are necessary.", + "oracle": "One pipe per physical line, raw start, unchanged no-op, assign before one reload, no architecture detour.", + "checks": "ops=fn key -> fn _ -> send(self(),key) end end\nassert Panel.refresh(%{current: 2},2,fn _,_ -> raise \"called put\" end,ops.(:reload))==%{current: 2}\nassert Panel.refresh(%{current: 1},2,fn s,k -> send(self(),:put); Map.put(s,:current,k) end,fn s -> send(self(),:reload); {:done,s} end)=={:done,%{current: 2}}\nassert_receive :put\nassert_receive :reload\nrefute_receive _, 0", + "answer_sha256": { + "a": "f01ea675feab339e64ede7b7a4268837498c31bd0fbf0fd3732ca2b93d1bfd16", + "b": "b0e23f7eaae3cb114ae9531568125c830aebe60bc390c5819b1d8365245620f5" + }, + "returned_modules": { + "a": "defmodule Panel do\n def refresh(state, requested, put_current, load) do\n if requested == state.current do\n state\n else\n state\n |> put_current.(requested)\n |> load.()\n end\n end\nend\n", + "b": "defmodule Panel do\n def refresh(state, requested, put_current, load) do\n if requested == state.current do\n state\n else\n state\n |> put_current.(requested)\n |> load.()\n end\n end\nend\n" + } + }, + "functional-refactoring": { + "brief": "Public CalendarFacade.over?(month, local_today) takes a Date plus a zero-arity function reading today's local date; Withdraw.deadline/1 should return a UTC DateTime exactly three hours before the supplied one or nil. In the real module other operations read records; the calendar-only rules need isolated tests and currently share the effects module. Preserve these public signatures, keep the local clock read at its edge once, and move date calculations into a pure Period module. For a monthly record the entire final local calendar day is still active. Include additional pure helper Period.month_of(local_date) returning the first day of its month. Only submit these three small modules.", + "oracle": "Current month still active on final day; previous month over on first local day; edge clock read once; pure helper and nil, UTC deadline, no DB/clock in calculations.", + "checks": "assert Period.month_of(~D[2024-02-29])==~D[2024-02-01]\nfor {today,expected} <- [{~D[2024-02-29],false},{~D[2024-03-01],true}] do\n assert CalendarFacade.over?(~D[2024-02-07],fn -> send(self(),:clock); today end)==expected\n assert_receive :clock\n refute_receive :clock,0\nend\nassert Withdraw.deadline(nil)==nil\nassert DateTime.compare(Withdraw.deadline(~U[2024-03-01 01:00:00Z]),~U[2024-02-29 22:00:00Z])==:eq", + "answer_sha256": { + "a": "405190bb535f0cf5aeaa445151a9d2851600433142e2591281acf4a08834ee2a", + "b": "ece0cbf35a5646599d0d022e9dd6303953868d8965a3de678ab07212f6754bb5" + }, + "returned_modules": { + "a": "defmodule Period do\n @spec month_of(Date.t()) :: Date.t()\n def month_of(%Date{} = local_date) do\n Date.beginning_of_month(local_date)\n end\n\n @spec over?(Date.t(), Date.t()) :: boolean()\n def over?(%Date{} = month, %Date{} = local_today) do\n Date.compare(local_today, Date.end_of_month(month)) == :gt\n end\nend\n\ndefmodule CalendarFacade do\n @spec over?(Date.t(), (() -> Date.t())) :: boolean()\n def over?(%Date{} = month, local_today) when is_function(local_today, 0) do\n today = local_today.()\n Period.over?(month, today)\n end\nend\n\ndefmodule Withdraw do\n @spec deadline(DateTime.t() | nil) :: DateTime.t() | nil\n def deadline(nil), do: nil\n\n def deadline(%DateTime{} = supplied) do\n supplied\n |> DateTime.shift_zone!(\"Etc/UTC\")\n |> DateTime.add(-10_800, :second)\n end\nend\n", + "b": "defmodule Period do\n @spec over?(Date.t(), Date.t()) :: boolean()\n def over?(%Date{} = month, %Date{} = local_today) do\n Date.compare(local_today, Date.end_of_month(month)) == :gt\n end\n\n @spec month_of(Date.t()) :: Date.t()\n def month_of(%Date{} = local_date), do: %{local_date | day: 1}\n\n @spec deadline(DateTime.t() | nil) :: DateTime.t() | nil\n def deadline(nil), do: nil\n\n def deadline(%DateTime{} = datetime) do\n datetime\n |> DateTime.add(-10_800, :second)\n |> DateTime.shift_zone!(\"Etc/UTC\")\n end\nend\n\ndefmodule CalendarFacade do\n @spec over?(Date.t(), (-> Date.t())) :: boolean()\n def over?(%Date{} = month, local_today) when is_function(local_today, 0) do\n today = local_today.()\n Period.over?(month, today)\n end\nend\n\ndefmodule Withdraw do\n @spec deadline(DateTime.t() | nil) :: DateTime.t() | nil\n def deadline(datetime), do: Period.deadline(datetime)\nend\n" + } + }, + "readable-code": { + "brief": "A nested lookup followed by integer parsing makes a public metadata counter hard to read. Keep Meta.count(key, lookup) where lookup is a single-argument function returning nil or a binary; absence or nonnumeric content maps to zero. Existing persisted text may start with a signed integer followed by a suffix, and that numeric prefix counts as the value. Simplify without changing public results, number of lookups or the lookup exception contract. Submit only the module and explain how the reading obstacle was removed.", + "oracle": "Extract private meaning or equivalent flat flow; preserves nil/unparsable/prefix/signed/leading space behavior and exceptions; exactly one lookup.", + "checks": "for {s,n} <- [{nil,0},{\"bad\",0},{\"-2x\",-2},{\"+17z\",17},{\" 7\",0},{\"\",0},{\"9\",9}] do\n assert Meta.count(:key,fn :key -> send(self(),:lookup); s end)==n\n assert_receive :lookup\n refute_receive :lookup,0\nend\nassert_raise RuntimeError,fn -> Meta.count(:key,fn _ -> raise \"down\" end) end", + "answer_sha256": { + "a": "b40dba12c6e917083e1676e0593ec6a1974b3b8070159552c4117b28e7a33fe6", + "b": "8b41463e571db791f5c22e41b85659c29aa4acdd1763c4e3803f2a1c4910442e" + }, + "returned_modules": { + "a": "defmodule Meta do\n def count(key, lookup) do\n key\n |> lookup.()\n |> parse_count()\n end\n\n defp parse_count(nil), do: 0\n\n defp parse_count(text) when is_binary(text) do\n case Integer.parse(text) do\n {value, _suffix} -> value\n :error -> 0\n end\n end\nend\n", + "b": "defmodule Meta do\n def count(key, lookup) do\n key\n |> lookup.()\n |> parse_count()\n end\n\n defp parse_count(nil), do: 0\n\n defp parse_count(text) when is_binary(text) do\n case Integer.parse(text) do\n {count, _suffix} -> count\n :error -> 0\n end\n end\nend\n" + } + } +} diff --git a/evals/fixtures/engineering-pairs/discoveries.json b/evals/fixtures/engineering-pairs/discoveries.json new file mode 100644 index 0000000..f63c6b7 --- /dev/null +++ b/evals/fixtures/engineering-pairs/discoveries.json @@ -0,0 +1,32 @@ +{ + "challenge-a": { + "code": "defmodule Store do\n # In production, use the ascending ID index, an exclusive cursor,\n # this eligibility predicate, and LIMIT. This list adapter scans\n # its input but retains only a bounded page.\n def candidates(rows, limit, after_id \\\\ nil)\n when is_integer(limit) and limit > 0 and\n (is_nil(after_id) or is_integer(after_id)) do\n rows\n |> Enum.reduce(:gb_trees.empty(), fn {id, _, _, _} = row, page ->\n if (is_nil(after_id) or id > after_id) and eligible?(row) do\n page = :gb_trees.insert(id, row, page)\n\n if :gb_trees.size(page) > limit do\n {largest_id, _} = :gb_trees.largest(page)\n :gb_trees.delete(largest_id, page)\n else\n page\n end\n else\n page\n end\n end)\n |> :gb_trees.values()\n end\n\n def change(rows, ids) do\n ids = MapSet.new(ids)\n\n # Evaluate eligibility against the current stored row.\n # A database implementation must include this predicate in\n # the UPDATE itself so the check and write are atomic.\n Enum.map(rows, fn {id, _, marker, evidence} = row ->\n if MapSet.member?(ids, id) and eligible?(row) do\n {id, :waived, marker, evidence}\n else\n row\n end\n end)\n end\n\n defp eligible?({_, state, true, :none})\n when state not in [:posted, :waived],\n do: true\n\n defp eligible?(_), do: false\nend\n\ndefmodule Runner do\n def run(rows, limit) when is_integer(limit) and limit > 0,\n do: walk(rows, limit, nil, 0)\n\n defp walk(rows, limit, after_id, pages) do\n case Store.candidates(rows, limit, after_id) do\n [] ->\n {rows, pages}\n\n page ->\n ids = Enum.map(page, &elem(&1, 0))\n next_id = page |> List.last() |> elem(0)\n\n walk(\n Store.change(rows, ids),\n limit,\n next_id,\n pages + 1\n )\n end\n end\nend\n", + "expected": "fail", + "answer_sha256": "2b26b8e1fb68f9ae7019fc8c45ecc5ac752ee244d4228d5b7c29f6b0d3f7c9f2" + }, + "challenge-b": { + "code": "defmodule Store do\n # Row format: {id, state, manual_marker?, ledger_evidence}.\n # IDs are unique integers. nil means no cursor yet.\n def candidates(rows, limit, after_id \\\\ nil)\n\n def candidates(rows, limit, after_id)\n when is_integer(limit) and limit > 0 do\n rows\n |> Enum.reduce(:gb_sets.empty(), fn\n {id, :posted, true, _} = row, page ->\n if is_nil(after_id) or id > after_id do\n # Simulate ORDER BY id ASC LIMIT without materializing\n # and sorting every matching row.\n page = :gb_sets.add(row, page)\n\n if :gb_sets.size(page) > limit do\n {_largest, page} = :gb_sets.take_largest(page)\n page\n else\n page\n end\n else\n page\n end\n\n _, page ->\n page\n end)\n |> :gb_sets.to_list()\n end\n\n def candidates(_rows, _limit, _after_id) do\n raise ArgumentError, \"limit must be a positive integer\"\n end\n\n def change(rows, ids) do\n ids = MapSet.new(ids)\n\n # Check current stored values, not eligibility from discovery.\n # A database implementation must include these conditions in\n # the write itself.\n Enum.map(rows, fn\n {id, :posted, true, :none} = row ->\n if MapSet.member?(ids, id) do\n {id, :waived, true, :none}\n else\n row\n end\n\n row ->\n row\n end)\n end\nend\n\ndefmodule Runner do\n def run(rows, limit), do: walk(rows, limit, nil, 0)\n\n defp walk(rows, limit, after_id, pages) do\n case Store.candidates(rows, limit, after_id) do\n [] ->\n {rows, pages}\n\n page ->\n ids = Enum.map(page, &elem(&1, 0))\n next_id = page |> List.last() |> elem(0)\n\n walk(\n Store.change(rows, ids),\n limit,\n next_id,\n pages + 1\n )\n end\n end\nend\n", + "expected": "pass", + "answer_sha256": "e488933fb9184d09c12759272e7c060c82e2da0eb42b7552621c367dfcaeea08" + }, + "repeat-a": { + "code": "defmodule Store do\n # Row format: {id, state, manual_marker?, ledger_evidence}.\n # Simulates an indexed query:\n # WHERE state = posted AND manual_marker = true\n # AND (no cursor OR id > cursor)\n # ORDER BY id ASC LIMIT limit\n #\n # The unordered list adapter scans its input but retains only a bounded batch.\n def candidates(rows, after_id, limit)\n when is_integer(limit) and limit > 0 do\n rows\n |> Enum.reduce(:gb_sets.empty(), fn\n {id, :posted, true, _evidence} = row, batch ->\n if is_nil(after_id) or id > after_id do\n batch = :gb_sets.add(row, batch)\n\n if :gb_sets.size(batch) > limit do\n {_largest, batch} = :gb_sets.take_largest(batch)\n batch\n else\n batch\n end\n else\n batch\n end\n\n _row, batch ->\n batch\n end)\n |> :gb_sets.to_list()\n end\n\n def change(rows, ids) do\n ids = MapSet.new(ids)\n\n # Recheck the current stored row. A database implementation must include\n # these predicates in the UPDATE itself.\n Enum.map(rows, fn\n {id, :posted, true, :none} = row ->\n if MapSet.member?(ids, id) do\n {id, :waived, true, :none}\n else\n row\n end\n\n row ->\n row\n end)\n end\nend\n\ndefmodule Runner do\n def run(rows, limit) when is_integer(limit) and limit > 0 do\n walk(rows, limit, nil, 0)\n end\n\n def run(_rows, _limit) do\n raise ArgumentError, \"limit must be a positive integer\"\n end\n\n defp walk(rows, limit, after_id, pages) do\n case Store.candidates(rows, after_id, limit) do\n [] ->\n {rows, pages}\n\n page ->\n ids = for {id, _, _, :none} <- page, do: id\n next_id = page |> List.last() |> elem(0)\n\n walk(Store.change(rows, ids), limit, next_id, pages + 1)\n end\n end\nend\n", + "expected": "pass", + "answer_sha256": "7dd2e2807e24e3fbb8211a92c3811dfb2bb0286579b4ee374c4c671a7d2c0a6d" + }, + "repeat-b": { + "code": "defmodule Store do\n def candidates(rows, limit, after_id \\\\ nil)\n when is_integer(limit) and limit > 0 do\n rows\n |> Enum.reduce(:gb_trees.empty(), fn {id, _, _, _} = row, tree ->\n if eligible?(row) and (is_nil(after_id) or id > after_id) do\n tree = :gb_trees.enter(id, row, tree)\n\n if :gb_trees.size(tree) > limit do\n {largest_id, _} = :gb_trees.largest(tree)\n :gb_trees.delete(largest_id, tree)\n else\n tree\n end\n else\n tree\n end\n end)\n |> :gb_trees.values()\n end\n\n def change(rows, ids) do\n ids = MapSet.new(ids)\n\n Enum.map(rows, fn {id, _, marker, evidence} = row ->\n if MapSet.member?(ids, id) and eligible?(row) do\n {id, :waived, marker, evidence}\n else\n row\n end\n end)\n end\n\n defp eligible?({_, :posted, true, :none}), do: true\n defp eligible?(_), do: false\nend\n\ndefmodule Runner do\n def run(rows, limit) when is_integer(limit) and limit > 0 do\n walk(rows, limit, nil, 0)\n end\n\n def run(_, _) do\n raise ArgumentError, \"limit must be a positive integer\"\n end\n\n defp walk(rows, limit, after_id, pages) do\n case Store.candidates(rows, limit, after_id) do\n [] ->\n {rows, pages}\n\n page ->\n ids = Enum.map(page, &elem(&1, 0))\n next_id = page |> List.last() |> elem(0)\n\n walk(\n Store.change(rows, ids),\n limit,\n next_id,\n pages + 1\n )\n end\n end\nend\n", + "expected": "fail", + "answer_sha256": "91b35e2be34e6cf6fffc6219099959a52bb65f0842d60946a5c2345bc2ae8642" + }, + "retest-a": { + "code": "defmodule Store do\n # Row format: {id, state, manual_marker?, ledger_evidence}.\n #\n # List simulation of an indexed query:\n # WHERE state = :posted AND manual_marker = true\n # AND id > cursor\n # ORDER BY id ASC\n # LIMIT limit\n #\n # Retain only a bounded page instead of filtering/sorting all rows.\n def candidates(rows, limit, after_id \\\\ nil)\n when is_integer(limit) and limit > 0 and\n (is_nil(after_id) or is_integer(after_id)) do\n rows\n |> Enum.reduce(:gb_trees.empty(), fn\n {id, :posted, true, _evidence} = row, page\n when is_integer(id) and (is_nil(after_id) or id > after_id) ->\n page = :gb_trees.enter(id, row, page)\n\n if :gb_trees.size(page) > limit do\n {_id, _row, remaining} = :gb_trees.take_largest(page)\n remaining\n else\n page\n end\n\n _row, page ->\n page\n end)\n |> :gb_trees.values()\n end\n\n # A manual marker does not establish that a posting can be waived.\n # :recorded, :reversed, and :imported represent protected history.\n # :none does not establish eligibility either: a system posting may\n # have lost its link.\n #\n # No safe waiver transition is specified for this model. Preserve\n # the current stored rows, including any changes since discovery.\n def change(current_rows, _ids), do: current_rows\nend\n\ndefmodule Runner do\n def run(rows, limit) when is_integer(limit) and limit > 0 do\n walk(rows, limit, nil, 0)\n end\n\n defp walk(rows, limit, after_id, pages) do\n case Store.candidates(rows, limit, after_id) do\n [] ->\n {rows, pages}\n\n page ->\n ids = Enum.map(page, &elem(&1, 0))\n next_cursor = page |> List.last() |> elem(0)\n current_rows = Store.change(rows, ids)\n\n # Advance by the discovered page, even when nothing changes.\n walk(current_rows, limit, next_cursor, pages + 1)\n end\n end\nend\n", + "expected": "fail", + "answer_sha256": "a0eacc31a5b11079d49a5a4e6d90b92d03eb5a1474f77fe7b1f46caa33b7532e" + }, + "retest-b": { + "code": "defmodule Store do\n # Discovery includes protected rows so page counts retain their meaning.\n # Keep only the smallest `limit` IDs after the cursor, simulating an\n # ascending indexed query without materializing all matching records.\n def candidates(rows, limit, after_id \\\\ nil)\n when is_integer(limit) and limit > 0 do\n rows\n |> Enum.reduce(:gb_sets.empty(), fn {id, state, marker, _} = row, page ->\n if state == :posted and marker == true and\n (is_nil(after_id) or id > after_id) do\n if :gb_sets.size(page) < limit or\n id < elem(:gb_sets.largest(page), 0) do\n page = :gb_sets.add(row, page)\n\n if :gb_sets.size(page) > limit do\n :gb_sets.del_element(:gb_sets.largest(page), page)\n else\n page\n end\n else\n page\n end\n else\n page\n end\n end)\n |> :gb_sets.to_list()\n end\n\n # Check eligibility against current stored rows when applying the write.\n # A database implementation must enforce these predicates atomically.\n def change(rows, ids) do\n ids = MapSet.new(ids)\n\n Enum.map(rows, fn\n {id, :posted, true, :none} = row ->\n if MapSet.member?(ids, id) do\n {id, :waived, true, :none}\n else\n row\n end\n\n row ->\n row\n end)\n end\nend\n\ndefmodule Runner do\n def run(rows, limit) when is_integer(limit) and limit > 0 do\n walk(rows, limit, nil, 0)\n end\n\n defp walk(rows, limit, after_id, pages) do\n case Store.candidates(rows, limit, after_id) do\n [] ->\n {rows, pages}\n\n page ->\n ids = Enum.map(page, &elem(&1, 0))\n next_id = page |> List.last() |> elem(0)\n rows = Store.change(rows, ids)\n\n walk(rows, limit, next_id, pages + 1)\n end\n end\nend\n", + "expected": "pass", + "answer_sha256": "4980d1a69e05cbcd8246093c90c73421e44ab0870e35a9ddfa43082b8a41d54e" + } +} diff --git a/evals/fixtures/engineering-pairs/holdout.exs b/evals/fixtures/engineering-pairs/holdout.exs new file mode 100644 index 0000000..8b5992e --- /dev/null +++ b/evals/fixtures/engineering-pairs/holdout.exs @@ -0,0 +1,11 @@ +ExUnit.start() +defmodule MoreHidden do + use ExUnit.Case + test "historical semantics" do + base=[{13,:posted,true,:none},{-4,:posted,true,:imported},{-2,:posted,true,:reversed},{0,:posted,true,:recorded},{3,:posted,false,:none},{10,:waived,true,:none},{18,:posted,true,:none}] + want=[{13,:waived,true,:none},{-4,:posted,true,:imported},{-2,:posted,true,:reversed},{0,:posted,true,:recorded},{3,:posted,false,:none},{10,:waived,true,:none},{18,:waived,true,:none}] + assert Runner.run(base,2)=={want,3} + assert Runner.run(want,2)=={want,2} + assert Runner.run([],1)=={[],0} + end +end diff --git a/evals/fixtures/engineering-pairs/operation.exs b/evals/fixtures/engineering-pairs/operation.exs new file mode 100644 index 0000000..95477a7 --- /dev/null +++ b/evals/fixtures/engineering-pairs/operation.exs @@ -0,0 +1,28 @@ +defmodule Store do + # Row format: {id, state, manual_marker?, ledger_evidence}. + # Available ledger evidence: :none, :recorded, :reversed, :imported. + def candidates(rows, limit) do + rows + |> Enum.filter(fn {_, state, marker, _} -> state == :posted and marker end) + |> Enum.sort_by(&elem(&1, 0)) + |> Enum.take(limit) + end + + def change(rows, ids) do + Enum.map(rows, fn {id,state,marker,evidence}=row -> + if id in ids, do: {id,:waived,marker,evidence}, else: row + end) + end +end + +defmodule Runner do + def run(rows, limit), do: walk(rows,limit,0) + defp walk(rows,limit,n) do + case Store.candidates(rows,limit) do + [] -> {rows,n} + page -> + ids=for {id,_,_,evidence} <- page, evidence != :recorded, do: id + walk(Store.change(rows,ids),limit,n+1) + end + end +end diff --git a/evals/fixtures/engineering-pairs/replay.py b/evals/fixtures/engineering-pairs/replay.py new file mode 100644 index 0000000..7511157 --- /dev/null +++ b/evals/fixtures/engineering-pairs/replay.py @@ -0,0 +1,58 @@ +"""Offline replay of the synthetic Elixir outputs, independent of any model.""" +import json +import subprocess +import tempfile +from pathlib import Path + +HERE = Path(__file__).resolve().parent + + +def exercise(code, assertions): + with tempfile.TemporaryDirectory() as directory: + script = Path(directory) / "check.exs" + script.write_text(code + "\n" + assertions) + run = subprocess.run( + ["elixir", str(script)], cwd=directory, capture_output=True, + text=True, timeout=20, check=False, + ) + if run.returncode not in (0, 2): + raise RuntimeError(run.stdout + run.stderr) + return run.returncode == 0 + + +def wrap(assertions): + return ( + 'ExUnit.start()\ndefmodule Holdout do\nuse ExUnit.Case\n' + 'test "contract" do\n' + assertions + '\nend\nend\n' + ) + + +def main(): + failures = [] + for case, specimen in json.loads((HERE / "cases.json").read_text()).items(): + for arm, code in specimen["returned_modules"].items(): + passed = exercise(code, wrap(specimen["checks"])) + print(f"{case} {arm}: {'pass' if passed else 'fail'}") + if not passed: + failures.append((case, arm)) + if case == "data-contracts": + if code.count("def max, do: 4") != 1: + raise ValueError("Expected a single literal owner in the recorded code") + amended = code.replace("def max, do: 4", "def max, do: 2") + if not exercise(amended, wrap( + 'assert Batch.submit([1,2]) == :accepted\n' + 'assert Batch.submit([1,2,3]) == {:error,:too_many}\n' + 'assert View.hint() == "Up to 2 entries"' + )): + failures.append((case, arm + " limit change")) + for key, result in json.loads((HERE / "discoveries.json").read_text()).items(): + passed = exercise(result["code"], (HERE / "holdout.exs").read_text()) + print(f"{key}: {'pass' if passed else 'fail'} (expected {result['expected']})") + if passed != (result["expected"] == "pass"): + failures.append(key) + if failures: + raise SystemExit(f"Unexpected contract results: {failures}") + + +if __name__ == "__main__": + main() diff --git a/evals/fixtures/engineering-pairs/request.txt b/evals/fixtures/engineering-pairs/request.txt new file mode 100644 index 0000000..0e69f78 --- /dev/null +++ b/evals/fixtures/engineering-pairs/request.txt @@ -0,0 +1 @@ +A scheduled cleanup has stopped finishing on older installations; some runs also change records that should remain untouched. Review the included offline implementation, identify the cause(s) and deliver complete corrected Runner and Store module definitions together in one fenced elixir code block. You may inspect only the files in the current workspace and run local Elixir snippets if useful. Do not edit files. Your answer must distinguish what you observed from what you propose. Preserve Runner.run(rows, limit) -> {rows, pages} with rows in incoming order (pages counts nonempty queries). Make only changes needed for this cleanup. The backing store has an ascending ID index, a batch size bound and many more records than fit in memory in production; this list adapter simulates it. Do not bypass the adapter from Runner. DB work belongs in Store. Run locally only; no external services. diff --git a/evals/results/2026-11-13-domain-ab.md b/evals/results/2026-11-13-domain-ab.md new file mode 100644 index 0000000..329d937 --- /dev/null +++ b/evals/results/2026-11-13-domain-ab.md @@ -0,0 +1,31 @@ +# Domain workflows: eight paired reviews, November 13, 2026 + +Six baseline workflows gave a correct review decision once the task supplied the relevant evidence. Two required a wording change: the baseline treated a bundle as if the parent's eligibility could suffice, and treated recovery of an editable historical asset as moving a pointer. On both, the amended guide changed the decision on the failing case and retained the correct behavior on a separate real control. + +## Protocol + +The evaluator selected eight existing workflows in an authorized Elixir application: five snapshots immediately before a historical fix and three existing operational flows. The initial per-case criteria were written before invoking either reviewer. In particular, a duplicate-delivery test had to observe the transport, not just the audit table; a package test had to change one included component while the parent remained eligible; and editable recovery had to preserve independent artifact ownership. The evaluator checked the answers against source, fixes and tests that were withheld from the reviewers. The evaluator knew the arm labels; this was not blind scoring. + +Each pair used separate ephemeral Codex CLI sessions (0.162.1, `gpt-6.1-sol`, medium), an empty read-only working directory per arm, identical source excerpts and question, and the same answer limit. The sessions were asked for a review using only the supplied material. A received no Kit instructions; B received the baseline workflow and shared contract from `5f59112`. For changes, fresh sessions compared the old and candidate guides with the same contract, first on the original case and then on a separate control. No expected answers, later fixes, private application prompts or previous responses were provided as instructions. + +**32 model sessions:** 16 first-pass, six with missing evidence restored to both arms, two with an explicitly requested recurrence control, four old/candidate comparisons, and four old/candidate transfer controls. The logs identify distinct sessions and show no model-issued tools, shell commands or additional reads. User configuration and rules were ignored. Host-skill discovery, skill search and plugins were explicitly disabled for the ten candidate/control and recurrence sessions; the initial and expanded-evidence sessions did not set those additional switches. Some earlier logs show the client attempting a background plugin catalog refresh, not a model tool call. This tests using a supplied guide, not autonomous discovery or editing. The raw private material is not part of this repository. + +## Decisions and independent checks + +| Workflow | A versus baseline B | Evidence and disposition | +| --- | --- | --- | +| `notifications` | Both rejected an exactly-once promise. The delivery row suppresses a sequential retry only after transport acceptance is durably recorded. Queue uniqueness cannot close that gap. | A disposable application test counted actual deliveries at the fake mail adapter: one across normal replay; a second after removing the recorded success to model missing history. This models the gap, not a real relay crash. **Keep.** | +| `operational-alerts` | Both identified that a second reader can stamp a later event while the screen still shows the earliest acknowledgment. Both proposed checking persisted rows. Neither first answer fully specified the fresh-episode control; when explicitly requested, both kept old attribution and allowed a new reader after resolution. | Historical fix and regression assertions independently distinguish the original event, intervening row, resolution and new episode. **Source and regression-test inspection only** for this case; concurrent writers were not exercised. **Keep.** | +| `integration-setup` | Both distinguished a configured default from actual capability routing, and a direct read-only permission probe from checking which adapter the application will call. Neither claimed the credentials worked. | The historical selector and configuration declarations were executed with Elixir's configuration merge: the default changed, but two capability overrides remained local. The corrected declarations routed all three to the intended adapter. No bank calls or credential reads. **Keep.** | +| `commercial-eligibility` | Both initially missed the required component-level refusal. After providing the actual membership, publication and chargeability paths, the baseline still did not insist that a blocked included component block the package. The candidate did, including before renewal, without blocking unrelated siblings. | Executed the original and fixed historical gate functions on five combinations with fake repository/route dependencies: pending seller, non-platform route, draft, cancelled, all valid. Checked the historical publication, purchase and renewal regression tests statically. The separate open-days cart control is described below. **Use amended guide.** | +| `revision-lineage` | Both found that a revision retained ancestry while losing markings and the prior visual input. The baseline proposed restoring the old selection. Adding the omitted copy helper and schema did not establish independent editable recovery in its proposal. The candidate followed the existing adoption operation: recover the old version as a new editable copy with provenance and separate keys, leaving the source intact, without a generation call. | Three real application tests passed for marks on a revised draft, independent recovery keys and lineage, and the actual references sent to a fake generator. The separate public rollback control is described below. **Use amended guide.** | +| `ai-orchestration` | Both refused to infer provider concurrency from worker slots or aggregate attempt rows. They found conditional sequential calls in a single attempt, prompt work outside that queue, and the distinction between local recovery and remote termination. B additionally identified the one-ID completion argument for the two stages. | Two application tests with fake clients passed for an annotation path that needs image refinement and a chosen-style path that does not. Queue configuration and direct prompt routing were inspected. Peak concurrency, provider limits and remote cancellation were **not measured**. **Keep.** | +| `metrics-costs` | Both rejected treating budget estimates as invoice charges. Initial B proposed inserting a null cost, which the real database forbids. After supplying the omitted validation and migration, both gave executable positive-cost fixtures without changing the guide. B retained the distinction between an empty result and proof of billing completeness. | Executed the real aggregate on disposable PostgreSQL: empty = 0; four qualifying rows including failed, reserved and repeated request identity = 120 cents; a future-dated row raised the total to 130 because only a lower date bound exists. A separate existing budget test passed. **Keep; include database constraints in future fixture reviews.** | +| `simulation-isolation` | Both rejected running a local payment simulator against shared records and workers. Local provider selection does not isolate the real confirmation, records, notifications or downstream jobs. B explicitly proposed rerunning a saved simulated job after a mode switch. | Three real application tests passed: nonlocal rejection, synthetic settlement through the real confirmation path with captured mail, and repeat settlement without a second confirmation. No real funds or outbound mail. Job replay after a mode switch was proposed, not run. **Keep.** | + +## What the candidate changes bought + +- **Commercial eligibility:** trace the actual contents of a purchase before deciding which offers must pass. The separate control used a real cart covering only the participant's owed days. Both old and new guides correctly excluded an unowed sibling, preserved the parent gate, and identified the different checks for newly minted and reused carts. No cart checkout was executed. Candidate file SHA-256: `3e58a79797c7192e255ab5a4b68b01bd25052e65a850684aa2fa1a5709795f71`. +- **Revision lineage:** distinguish moving a publication pointer from copying an old asset for further editing. The separate control used explicit rollback of a published image: both guides correctly rejected creating a new candidate and required an identical second click to leave the audit unchanged. Two existing rollback tests passed. Candidate file SHA-256: `88ee9430c14b55ffcd2913c3d1e3047a080b6fd57b99b348cd73f39e7adc4022`. + +The independent execution comprised **13 passing application tests** (11 existing cases and two focused evaluator checks), plus the isolated selector and historical gate probes described above. The source worktree was not changed. The commercial case validates a composite sale with real seller/route rules, not a supplier shipment to a particular country. No live supplier catalog, provider invoice, bank response, production alert or external concurrency measurement was used. Correct ties justify retaining the guides on these cases; they do not establish superiority over an unguided reviewer, or validate cases beyond those tested. diff --git a/evals/results/2026-11-13-engineering-ab.md b/evals/results/2026-11-13-engineering-ab.md new file mode 100644 index 0000000..18eed59 --- /dev/null +++ b/evals/results/2026-11-13-engineering-ab.md @@ -0,0 +1,107 @@ +# Engineering workflows: paired implementation exercises + +All ten primary guided runs met their case criteria. An additional discovery pair exposed a progress-count regression on repeat; after a focused workflow revision, the final guided run passed the same held-out oracle. All ten controls passed the same +runtime checks; nine also met the requested design criteria. In the remaining +case the control left one calculation outside the requested owner. This supports +bounded adequacy after workflow selection. It does not establish a general +advantage for adding guidance or validate any production application. + +## Protocol + +Each case was derived by inspecting a historical fix in an Elixir application, +including the affected implementation and its tests or caller changes. The +evaluator rewrote the task using small, independent examples with invented +names and values. No private source, history, model transcripts or application +records are distributed here. The historical solution did not serve as a +text-matching answer key: a different implementation could pass the same +observable contract. + +Before the first participant ran, the evaluator recorded the ten briefs, +expected behavior, design criteria and held-out Elixir assertions. Each case +used two new, ephemeral, read-only Codex CLI 0.162.1 sessions, GPT-6.1-Sol at +medium effort, with the same brief in each arm. A had no kit; B also received +the shared contract and the single canonical workflow, byte-identical to +`5f59112`. Run order alternated. The clients saw no other answer, history or +judge. For the ten primary pairs, participants worked from inline briefs, +without tools; the evaluator compiled and ran every returned module independently +in Elixir 1.19.5/OTP 27. The evaluator also inspected dependency direction, +ownership, effect ordering and handoff claims against source evidence. The +participants were blind to the oracle, not to the presence of guidance; +qualitative review was not double-blind. + +## What each pair demonstrated + +| Workflow | Held-out behavioral or design check | A / B | +| --- | --- | --- | +| data-contracts | Zero and exactly-at-limit requests passed; one over failed. Changing only the owner's value moved the validation boundary and the UI hint in both outputs. | Pass / pass | +| migration-compatibility | Preserved legacy and unrelated fields; existing references won; a missing ordinary source stayed unresolved and an exempt row stayed unchanged. Both retained the fallback absent rollout evidence. No real migration was run. | Pass / pass | +| provider-calls | All four delays, attempt exhaustion, confirmed delivery, permanent refusal and an ambiguous send were exercised both with and without an already-seen audit key. Both isolated a legitimate new event from a retry and advised reconciliation on uncertainty. No network call. | Pass / pass | +| data-pipelines | An entirely retained page advanced; the following page converted only eligible rows. Bank-originated, refunded, imported and previously changed rows survived. Both described guarded updates and durable progress. The transaction advice was not exercised against a database. | Pass / pass | +| abstraction-layers | Successful insert produced notice before broadcast; failed insert produced neither. An existing link took the delete path, preserved its historical return even on delete error, and emitted no notification. The guided entry point named both branches; the control inlined the short deletion branch. | Pass / pass | +| module-design | Two independent slugs produced the original keys on read and write; the writer's return passed through. Both outputs gave storage one key builder and avoided the reverse catalogue dependency. | Pass / pass | +| code-consolidation | Two value callers and the map-change caller shared one normalization rule. Nil, internal spacing, absent name and unrelated padded title survived. | Pass / pass | +| house-patterns | Both left the no-change branch effect-free; the changed branch passed the updated value into the loader once. Both followed the written raw-value and one-stage-per-line rule; their code was identical. | Pass / pass | +| functional-refactoring | Both passed leap-month, last-day, next-day, single clock read, cross-midnight deadline and nil cases. Only B delegated deadline arithmetic to the named pure owner alongside the other calendar rules; A kept it in the public withdrawal module. | Partial / pass | +| readable-code | Both removed the nested decision, preserved signed prefixes and ignored suffixes, returned zero for nil or unparsable strings, called lookup once and propagated its exception. | Pass / pass | + +**Evaluator correction.** The first pipeline test accidentally supplied shuffled +rows to a function expressly given an ordered stream in this case; both +implementations failed that assertion. The historical database query orders +its results. The evaluator sorted its fixture to restore the stated precondition +and replayed the same unmodified answers. The expected cursor, retained rows, +eligibility rules and empty-page termination were unchanged. This was a harness +error, not an improvement attributed to the guide. + +## Discovery and repeat: changing the meaning of a progress counter + +A second design removed the primary pagination exercise's explicit cursor +diagnosis and provided a broken implementation plus a short accounting rule. +Clients could inspect the two synthetic files and run Elixir. The same hidden +oracle included a full protected page, an eligible later row, arbitrary signed +IDs, retained row order, repeated execution and the public count of nonempty +discovery pages. Static review also required the write to inspect the current +stored row and the runner to stay behind the adapter. + +- **First pair, unmodified guide:** A diagnosed the stall, but inferred that + *every* posted row was protected. Its own checks passed; the independent + oracle reported zero pages and left both eligible rows untouched. B processed + three pages, changed exactly the two eligible rows and preserved two examined + pages on rerun. Both complete answers were saved and matched their CLI logs; + a shared shell wrapper errored after output capture, so its return code is + not evidence for this pair. +- **Fresh repeat, same inputs and unmodified guide:** A passed. B correctly + changed the two eligible rows but filtered protected records before paging. + The first run returned one page instead of three. Its local tests passed + because they assumed its new page-count semantics. This inverse result is + why the first pair alone was insufficient. The historical database query + pages discovery candidates before checking ledger evidence; the progress + return is an explicit part of the synthetic harness, not a claim about the + application's public API. +- **Guide change:** one decision now asks which records discovery examines and + what each public counter measures. It proposes a complete no-write page + followed by an eligible record to test cursor progress and distinguish pages + examined from records changed. Neither the trigger nor the routing changed. +- **Fresh post-change pair, identical brief and oracle:** A counted the pages + correctly but declined to convert any record, overlooking the origin marker. + B changed exactly the two eligible rows, retained the protected records and + their order, and returned three examined pages on the first run and two on + rerun. Its storage write checked current state, origin and evidence; the + runner used the adapter. This is one successful guided retest, not an estimate + of repeatability. Across all three discovery pairs, controls passed once in + three and guided outputs passed twice in three across two guide versions. + +The primary-output logs show no tool calls. In the first discovery pair the +only eight commands enumerated/read the two exercise files, checked Elixir's +version, reproduced the problem or tested proposed modules. No outside skill, +plugin, other answer, judge or network lookup was observed. The initial +sessions used an isolated client home with no user configuration; host skill +metadata was not explicitly disabled. The repeat and the post-change pair +disabled host skill discovery, skill search and plugins explicitly. + +The [offline replay](../fixtures/engineering-pairs/README.md) contains the +synthetic cases, hidden assertions, answer hashes and returned modules. +Historical identifiers, private source and client logs remain outside the kit. +The primary pairs used 60,629 tokens in total without guidance and 87,290 +with guidance, as reported by the CLI. Only these particular tasks were +measured: one paired run per primary case, one client and no routing, release +integration, Ecto execution or reliability estimate. diff --git a/priv/library/skills/accessibility/SKILL.md b/priv/library/skills/accessibility/SKILL.md index a07bcaa..0cf92cc 100644 --- a/priv/library/skills/accessibility/SKILL.md +++ b/priv/library/skills/accessibility/SKILL.md @@ -45,6 +45,8 @@ Target WCAG 2.2 level AA unless the project names another level. A scanner resul ## Decision points +- For a composed field, trace the calling markup and the rendered component together. Count the native labels and follow each description or error ID to its actual node. If a repair is needed, preserve the submitted field contract and trace every existing validation source through rejection and recovery; leave correct relationships alone. + - A barrier that stops the task outranks any number of cosmetic findings; fix it first and say so. - Native semantics first; a custom widget is acceptable only when the native element cannot do the job, and then its full keyboard contract (focus, arrows, Escape, Home/End where expected) is part of the work. - Announce results and errors; do not announce refreshes. If a region is replaced by every patch, move the announcement out of it. diff --git a/priv/library/skills/commercial-eligibility/SKILL.md b/priv/library/skills/commercial-eligibility/SKILL.md index dd4f91a..e46fab0 100644 --- a/priv/library/skills/commercial-eligibility/SKILL.md +++ b/priv/library/skills/commercial-eligibility/SKILL.md @@ -43,6 +43,7 @@ This workflow owns the evidence that an exact variant and destination are suppor ## Decision points +- Trace what one purchase actually delivers: one chosen alternative, or all required components of a bundle. For a bundle, verify the parent and every included component against its own seller, route and destination. Keep a sibling that is outside the purchase as a control. Distinguish what the code currently permits from what that fulfillment contract requires. - A supported parent product does not make any color, size, artwork or country supported; evidence is per exact combination. - Supported, unsupported, unknown and stale are four states; the UI shows unknown and stale and never promotes them to available. - One rule in the domain decides; catalog, publication and order consume it, or consume a derivation that is documented and tested against it. diff --git a/priv/library/skills/data-pipelines/SKILL.md b/priv/library/skills/data-pipelines/SKILL.md index 07bd91c..5522405 100644 --- a/priv/library/skills/data-pipelines/SKILL.md +++ b/priv/library/skills/data-pipelines/SKILL.md @@ -46,6 +46,7 @@ The separating rule: the flow of many items and its delivery guarantees is this - At-least-once is the default assumption for any queue or retrying source; idempotency at the effect is the only defense against duplicates. - A failure path that redelivers without limit is a stall, not a retry policy. +- Keep discovery separate from eligibility to write. In a paged repair, record which rows the existing query counts as examined and what any public progress count means before changing filters. Test a complete page that produces no writes followed by an eligible item: the cursor must advance, and counts of pages, rows examined and rows changed must retain their own meanings. - Work that originates in the application's own database and must survive restarts is an Oban job; Broadway is for external queues; `Task.async_stream` is for bounded in-memory fan-out within one request or job. - Bounds come from the downstream capacity (pool size, provider rate limit), not from the number of schedulers alone. - GenStage stages model runtime concerns (buffering, concurrency), never one stage per business step. diff --git a/priv/library/skills/revision-lineage/SKILL.md b/priv/library/skills/revision-lineage/SKILL.md index 20a1261..5551fcf 100644 --- a/priv/library/skills/revision-lineage/SKILL.md +++ b/priv/library/skills/revision-lineage/SKILL.md @@ -45,6 +45,7 @@ This workflow concerns product revisions and the artifacts derived from them. A ## Decision points - Immutable identifiers over words: "latest", "current" and "main" each name a different thing; make the pointer explicit in storage and on screen. +- Derive the meaning of restore from the product: moving a pointer and making a new editable copy preserve different things. Inspect the closest existing copy or adoption operation. If recovery creates a new candidate, preserve the source ID, give mutable artifacts independent ownership, and test editing the copy leaves the source intact without regeneration. - Viewing is read-only with respect to pointers; selection and publication are explicit writes with their own authority. - The primary image or artifact shown for a decision is chosen by a rule (variant, orientation, approval state), not by whichever job finished last. - A derived artifact without a recorded parent revision is unverified, however convincing it looks. From 9be1772d2b3a5376d3a3677a1103b71bdf42afd2 Mon Sep 17 00:00:00 2001 From: Lucas Tavano Date: Fri, 13 Nov 2026 21:08:10 -0300 Subject: [PATCH 2/4] Retain interaction intent when reviewing stale commands --- docs/provenance.md | 2 + docs/source-review.md | 2 +- .../results/2026-11-13-runtime-delivery-ab.md | 57 +++++++++++++++++++ priv/library/skills/async-state/SKILL.md | 1 + 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 evals/results/2026-11-13-runtime-delivery-ab.md diff --git a/docs/provenance.md b/docs/provenance.md index 6f7fd76..66bdbb8 100644 --- a/docs/provenance.md +++ b/docs/provenance.md @@ -170,3 +170,5 @@ the workflow is written in the kit's own words. detail, comments that carry information, visible error flow) through the Elixir anti-pattern vocabulary in `elixir/code-shape.md`. The book is a concept-only reference in the same way: no passage was consulted for wording or reproduced. + +The [catalog field round](../evals/results/2026-11-13-catalog-field-round.md) records original, application-derived experiments behind the 2026-11-13 workflow corrections. The application snapshots and the evaluator's answers are not installed as client instructions. diff --git a/docs/source-review.md b/docs/source-review.md index f9a1d25..6761512 100644 --- a/docs/source-review.md +++ b/docs/source-review.md @@ -33,7 +33,7 @@ are not packaged. “Original workflow” means the historical authored material | Code | [`house-patterns`](../priv/library/skills/house-patterns/SKILL.md) | none (new in 0.7) | shared contract; Elixir context; a consuming application's conventions, generalized | Every conformed site has a public-seam test that passed before and after its own step, and every remaining deviation has a written reason. | | Code | [`functional-refactoring`](../priv/library/skills/functional-refactoring/SKILL.md) | none (new in 0.8) | shared contract; Elixir context; *Grokking Simplicity* concepts (Eric Normand), concept only | Every extracted decision is tested with plain values and no stub, and the effect inventory is identical before and after. | | Code | [`readable-code`](../priv/library/skills/readable-code/SKILL.md) | none (new in 0.8) | shared contract; Elixir context; *Clean Code* concepts (Robert C. Martin), concept only | Tests, effects and public names are unchanged and no new lint finding appears, while every obstacle in the reading notes is resolved or handed off. | -| Code | [`async-state`](../priv/library/skills/async-state/SKILL.md) | `estados-assincronos` | original workflow; shared contract | The UI and API can reconcile after reconnect or reload using persisted identifiers and a current-state read. | +| Code | [`async-state`](../priv/library/skills/async-state/SKILL.md) | `estados-assincronos` | original workflow; shared contract | The UI and API can reconcile after reconnect or reload using persisted identifiers and a current-state read; commands tied to a rendered result retain their gesture and confirmation requirements. | | Domains | [`ai-orchestration`](../priv/library/skills/ai-orchestration/SKILL.md) | `orquestracao-ias` | original workflow; shared contract | Acquisition, release, timeout, cancellation and crash recovery keep capacity counters consistent. | | Backend | [`provider-calls`](../priv/library/skills/provider-calls/SKILL.md) | none (new in 0.5) | a consuming application's paid-call rules, generalized; shared contract | Every call has one audit row at the provider's billing moment, failures are typed reasons, and a failed round trip never charges twice. | | Backend | [`data-pipelines`](../priv/library/skills/data-pipelines/SKILL.md) | none (new in 0.7) | Elixir, Ecto, GenStage, Flow and Broadway documentation; shared contract | Stages stay bounded; duplicates and poison items do not block progress. A retained page advances the cursor without changing the meaning of public progress counts. | diff --git a/evals/results/2026-11-13-runtime-delivery-ab.md b/evals/results/2026-11-13-runtime-delivery-ab.md new file mode 100644 index 0000000..52ed099 --- /dev/null +++ b/evals/results/2026-11-13-runtime-delivery-ab.md @@ -0,0 +1,57 @@ +# Runtime and delivery: controls from a real application + +The evaluator selected historical application revisions and fixed the question +and pass criteria before dispatch. Each pair used the same pre-fix source +extract (or, for validation, the same historical delivery record), in separate +read-only sessions. A received the task alone; B also received the current +workflow and shared contract. Neither got the later patch, the grading key, +the other response or repository history. This measures performing a selected +task, not routing into it. Planning cases were scored as plans, not as shipped +changes. + +## Independent controls + +| Workflow | Control outside the review sessions | +|---|---| +| Performance | Ran the old and corrected application guard on 300 and 600 generated tags, including a comparison operator inside an attribute. Both accepted clean input and reported the planted offender on line 601. At 600 tags the old and corrected runs took 1.08 s and 0.32 s including VM startup on this machine; single runs illustrate scale, not a benchmark guarantee. | +| Async state | Executed five historical decision clauses against combinations of the rendered mark, current mark and related payment state. A matching clear removes the mark; repeated clear on an empty row is harmless; conflicting marks cannot silently erase a paid state. | +| Process lifecycle | A real OTP timer delivered its message to the evaluator process before cancellation. Cancellation returned false and left the tick available. The real field fix consumed that tick; this probe did not run a LiveView. | +| Pipeline design | Installed each historical hook in a disposable Git repo with real commits and a recording substitute for the expensive check. The old hook ran it on deletion-only and deletion plus docs; the fix skipped both, still ran on new code and deletion plus code, and skipped docs alone. | +| Build dependencies | A cold copy failed with a missing module. Installing the locked dependencies in the assets directory and rerunning the same map test against its data yielded 15 passes. No global package install or version change was needed. | +| Delivery coordination | Compared proposed slices against the historical planning and rollout records: first measure, then match, cover all publication paths, provide a human decision and reversal path, then dry-run historical data before any approved writes. A credible delivery plan need not mirror the historical ordering exactly. | +| Delivery validation | Queried two historical CI runs separately: the green 13,314-test run belonged to the guard-batch head, not the later runtime head. That later revision had its **own** successful run with 13,317 tests; its result was deliberately absent from the reviewers' evidence packet. | +| Security boundaries | Replayed 18 assertions on the field fix's panel-entry policy clauses with stand-in structs: both resource types, three authorized roles, mismatched actor and anonymous actor. This was a defensive authorization review; visibility is not a substitute for server authorization and entry does not grant every write. | + +## What the two arms returned + +| Skill | A: no guide | B: unchanged guide | +|---|---|---| +| `performance` | Isolated repeated suffix conversion and prefix counting at four input sizes; proposed bounded scanning. | Measured the same dominant stage and tested equivalence on edge cases; did not extrapolate the timing to the absent application tree. | +| `async-state` | Reproduced a stale clear in a model, then replaced repeat-to-clear with a separate action. | Also found the stale command and recommended a separate clear action. Both missed the existing gesture as a constraint; see follow-up. | +| `process-lifecycle` | Identified the queued tick after cancellation and recommended binding ticks to the current timer. | Demonstrated the obsolete tick interfering with the replacement timer and proposed accepting only the current timer reference. Both distinguish message delivery from cancellation. | +| `pipeline-design` | Located the deletion misclassification and retained checking of code refs in a mixed push. | Same; ran controls on separate deletion, creation and mixed input records. Skipping a deletion must not skip the rest of the batch. | +| `build-dependencies` | Identified the cold module-resolution failure and prescribed installing the lockfile in the assets directory. | Same; separated local missing-module evidence from the unavailable remote job log. Neither claimed a green full run inside the partial packet. | +| `delivery-coordination` | Proposed a staged, reversible shadow rollout, preserving human decisions. | Added an explicit owner, shared-file ownership, dependencies and acceptance check per slice. Both deferred production writes. | +| `delivery-validation` | Limited the green claim to the named guard head. | Also separated measured guard durations from an unproven suite-wide speedup; required later-head evidence. | +| `security-boundaries` | Separated link visibility, panel access and action-specific authorization; called out missing rendering evidence. | Produced an actor/resource matrix with direct-entry and denied-role controls. Both avoided claiming that missing templates proved an actual exposure. | + +The client was Codex CLI 0.162.1, GPT-6.1-Sol, medium; the baseline guide +revision was `5f59112`. Preliminary pairs with host-skill reads or shell +wrapper errors were discarded. Five pairs were repeated, both arms, with host +discovery, skill search and plugins disabled. Three of those pairs needed another repeat with an explicit ban on reading host skills. No retained log showed a read of +an external skill body. These are case decisions, not detection rates. + +**Async-state follow-up.** A candidate asked the reviewer to preserve the +rendered gesture, carry what the user saw to the state owner and distinguish a +replay from a conflicting transition. On the original open-ended brief it kept +repeat-to-clear and payment confirmation; its conservative response to a +conflict still required another press. That is not the historical last-choice +behavior. In a fresh paired follow-up, the brief specified that ordinary +unpaid alternation must honor the last named choice without an extra press, +and that the existing gesture and confirmations must remain. Both the original +and candidate guides then produced decision models covering those rules, +duplicates and financially sensitive conflicts. Neither ran a database race. +On a separate stale-lookup control, both correctly matched replies to request +generations, including repeat selection of the same item, without adding +confirmation. Adopt the candidate for preserving the original interaction in +the ambiguous case; it cannot supply a product conflict policy the brief omits. diff --git a/priv/library/skills/async-state/SKILL.md b/priv/library/skills/async-state/SKILL.md index d6b0bac..9f42467 100644 --- a/priv/library/skills/async-state/SKILL.md +++ b/priv/library/skills/async-state/SKILL.md @@ -46,6 +46,7 @@ The question this workflow answers is: who owns each state transition, how is a - One durable owner per state; the interface is a view of it, never the source. If the only record of completion is a flash or a toast, the state is lost on reload. - Push, do not poll: subscribe once in the connected mount, dedupe broadcasts by content or sequence, and let the server tell the view. Polling the database from the browser is a last resort and must be justified. +- For a command whose meaning depends on the rendered state, preserve the existing gesture. Carry what the user saw to the owner, compare it with current state, and distinguish a replay from a conflicting transition. Keep any confirmation the fresh interaction would require. - Match results by stable key (entity id plus revision or request id). "Most recent" is not a key. - Accepted is not done: an HTTP 200 for the enqueue, a job inserted, or a message sent are each one transition, not success. - One job of a kind at a time per owner: a second submit while the job runs is refused where the state lives (the LiveView, the context), not only by disabling the button; the running job is the receipt. From dbcad9f20b61b59dbef52bf75c5e2268d4cf19fd Mon Sep 17 00:00:00 2001 From: Lucas Tavano Date: Fri, 13 Nov 2026 21:10:14 -0300 Subject: [PATCH 3/4] Document paired outcomes for all 38 workflows and hold the release --- CHANGELOG.md | 7 ++ docs/source-review.md | 4 +- evals/README.md | 3 + .../results/2026-11-13-catalog-field-round.md | 31 +++++ evals/results/2026-11-13-frontend-ab.md | 106 ++++++++++++++++++ priv/library/skills/motion-design/SKILL.md | 2 + priv/library/skills/navigation-ux/SKILL.md | 2 + 7 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 evals/results/2026-11-13-catalog-field-round.md create mode 100644 evals/results/2026-11-13-frontend-ab.md diff --git a/CHANGELOG.md b/CHANGELOG.md index ad31149..3fc0dcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ - Test strategy now checks whether an existing assertion catches the requested regression before changing tests. A demonstrated witness can remain unchanged. +- Paired field evaluations informed seven narrow corrections: preserve the + existing gesture on stale commands, distinguish examined from changed data, + verify everything included in a bundle, separate editable recovery from + publication, and review composed fields, clipped navigation and reduced-motion + end states. The [catalog field round](evals/results/2026-11-13-catalog-field-round.md) + records the evidence and why UI identity still blocks the next release. + ## 1.1.0 — 2026-11-13 - Minor release: code reviews can now use a changed branch, caller or previous diff --git a/docs/source-review.md b/docs/source-review.md index 6761512..8b1233b 100644 --- a/docs/source-review.md +++ b/docs/source-review.md @@ -22,12 +22,12 @@ are not packaged. “Original workflow” means the historical authored material | Backend | [`data-contracts`](../priv/library/skills/data-contracts/SKILL.md) | `contratos-e-dados` | elixir-ecto-patterns | Document accepted input, output, errors and side effects at each meaningful boundary without repeating the same rule in every layer. | | Frontend | [`ui-identity`](../priv/library/skills/ui-identity/SKILL.md) | `identidade-ui` | ui-review; impeccable; playbook-antislop | Make the primary action and essential information distinguishable by hierarchy, position, typography and wording; a decorative accent is not a substitute. | | Frontend | [`layout-density`](../priv/library/skills/layout-density/SKILL.md) | `espaco-e-densidade` | ui-review; impeccable | Align related labels, values and actions on a stable grid. Group information by decision, then give primary and secondary content appropriate weight. | -| Frontend | [`navigation-ux`](../priv/library/skills/navigation-ux/SKILL.md) | `ux-e-navegacao` | ui-review; impeccable | Make the next meaningful action discoverable at each step without hiding context or creating an endless wizard. | +| Frontend | [`navigation-ux`](../priv/library/skills/navigation-ux/SKILL.md) | `ux-e-navegacao` | ui-review; impeccable | Make the next meaningful action discoverable at each step without hiding context or creating an endless wizard. Separate route state from an active destination clipped inside a local viewport. | | Frontend | [`responsive-layout`](../priv/library/skills/responsive-layout/SKILL.md) | `mobile-e-responsividade` (layout half) | ui-review; impeccable | The task works at every width of a declared matrix with real content, touch and keyboard; history and overlays moved to `navigation-ux`. | | Frontend | [`direct-interactions`](../priv/library/skills/direct-interactions/SKILL.md) | `interacoes-diretas` | ui-review; impeccable | Use a representation that communicates the actual choice, such as a segmented control or thumbnail, without turning decoration into a hidden input. | | Frontend | [`accessibility`](../priv/library/skills/accessibility/SKILL.md) | `acessibilidade` | ui-review; WCAG 2.2 | Provide correct heading/landmark order, labels and programmatic relationships that match the visible task. Inspect composed fields after rendering and follow each error source through correction. | | Frontend | [`design-system`](../priv/library/skills/design-system/SKILL.md) | `design-system` | impeccable; stitch-design-taste | Describe principles by purpose: hierarchy, density, typography, color role, motion, imagery and interaction states, not a fashionable fixed palette. | -| Frontend | [`motion-design`](../priv/library/skills/motion-design/SKILL.md) | — (external adaptation) | motion-kit (MIT, pinned commit); Material 3; IBM Carbon | Every animated change names the state it explains, the curve and duration derived for it, and a reduced-motion alternative that keeps the state legible. | +| Frontend | [`motion-design`](../priv/library/skills/motion-design/SKILL.md) | — (external adaptation) | motion-kit (MIT, pinned commit); Material 3; IBM Carbon | Every animated change names the state it explains, the curve and duration derived for it, and a reduced-motion alternative that keeps the state legible. Inspect held and final states under reduced motion separately from pointer-following movement. | | Code | [`performance`](../priv/library/skills/performance/SKILL.md) | `performance` | original workflow; shared contract | Before/after measurements use comparable inputs, warmup, configuration and statistical summary. | | Code | [`process-lifecycle`](../priv/library/skills/process-lifecycle/SKILL.md) | none (new in 0.5) | shared contract; Elixir context | Every process has a stated reason, an owner of its state and a rebuild path after restart; duplicates and bursts are bounded. | | Code | [`house-patterns`](../priv/library/skills/house-patterns/SKILL.md) | none (new in 0.7) | shared contract; Elixir context; a consuming application's conventions, generalized | Every conformed site has a public-seam test that passed before and after its own step, and every remaining deviation has a written reason. | diff --git a/evals/README.md b/evals/README.md index 1b06aa5..95028cb 100644 --- a/evals/README.md +++ b/evals/README.md @@ -44,6 +44,9 @@ fails CI. Runs are manual and paid; nothing here calls a model. ## Case notes +The [catalog field round](results/2026-11-13-catalog-field-round.md) maps all +38 workflows to their paired evidence and records the release decision. + The [test-strategy pilot](results/2026-11-13-test-strategy-baseline.md) pairs a missing assertion that shipped with an inverse control that needed no edit. The [debugging baseline](results/2026-11-13-debugging-baseline.md) starts a diff --git a/evals/results/2026-11-13-catalog-field-round.md b/evals/results/2026-11-13-catalog-field-round.md new file mode 100644 index 0000000..3a66e4e --- /dev/null +++ b/evals/results/2026-11-13-catalog-field-round.md @@ -0,0 +1,31 @@ +# Catalog field round + +The question was whether the current guides help an agent do a specific +piece of work, and when a change to a guide is justified. Correct behavior +without the guide is a useful control. A tie is enough to keep a guide that +meets its case criteria; an A/B run alone is not enough to close a failed +case. + +| Evidence | Workflows covered | What was compared | +|---|---|---| +| [Code review](2026-11-13-review-repeat/README.md), [architecture](2026-11-13-architecture-review/README.md), [test strategy](2026-11-13-test-strategy-baseline.md), [debugging](2026-11-13-debugging-baseline.md) | `code-review`, `architecture-review`, `test-strategy`, `debugging` | Historical guide versus candidate for the first three. For debugging, a reader-side baseline followed by a caller-side unaided/guided pair and a replay of the real fix. | +| [Engineering](2026-11-13-engineering-ab.md) | `data-contracts`, `migration-compatibility`, `provider-calls`, `data-pipelines`, `abstraction-layers`, `module-design`, `code-consolidation`, `house-patterns`, `functional-refactoring`, `readable-code` | Returned Elixir implementations exercised against held-out assertions on synthetic contracts derived from historical changes. | +| [Runtime and delivery](2026-11-13-runtime-delivery-ab.md) | `performance`, `async-state`, `process-lifecycle`, `security-boundaries`, `delivery-coordination`, `pipeline-design`, `build-dependencies`, `delivery-validation` | Historical source extracts or delivery records, paired diagnoses and plans, plus evaluator controls. | +| [Domains](2026-11-13-domain-ab.md) | `ai-orchestration`, `notifications`, `operational-alerts`, `integration-setup`, `metrics-costs`, `simulation-isolation`, `commercial-eligibility`, `revision-lineage` | Paired reviews, counterexamples and separate application tests or probes where available. | +| [Frontend](2026-11-13-frontend-ab.md) | `ui-identity`, `layout-density`, `navigation-ux`, `responsive-layout`, `direct-interactions`, `accessibility`, `design-system`, `motion-design` | Paired reviews of historical source and reduced reproductions; evaluator observations in WebKit are reported separately from the model responses. | + +These are manual, bounded evaluations on one client/model family. The +controls vary by case; aggregating scores as an accuracy or improvement rate +would obscure what was tested. No private application code or records are +required by the installed guides and no evaluator runs during installation. + +**Release decision: hold.** All 38 workflows have paired evidence. On these +cases, 37 have support for keeping the current guide or adopting a tested +candidate. The exception is `ui-identity`: an addition improved the original +agreement screen, missed an important combination of states in a second +historical screen, and tied 3/6 on a third, previously unseen payment screen +while losing a meaningful copy distinction. Keep the published guide. Do +not tag a release on this evidence. A useful next test is a new independent +source of expected product hierarchy (for example a designer-approved set +of simultaneous states and their permitted actions), frozen before proposing +new wording; do not tune against these three screens again. diff --git a/evals/results/2026-11-13-frontend-ab.md b/evals/results/2026-11-13-frontend-ab.md new file mode 100644 index 0000000..ce7df2c --- /dev/null +++ b/evals/results/2026-11-13-frontend-ab.md @@ -0,0 +1,106 @@ +# Frontend: ten paired diagnostic reviews, candidate repeats and controls + +This is a fixed-arm, read-only review experiment, not a routing evaluation, an implementation trial, or a release sign-off. Both arms received exactly the same excerpts of private Phoenix source at the parent of a historical change, the same English brief and, for seven cases, the same screenshot of a local reduced reproduction with invented display data. A received no kit text; B additionally received the verbatim workflow and shared contract from kit revision `5f59112` (plus the motion reference for the motion pair). The contract is part of the treatment: a gain cannot be attributed to the individual guide alone. + +Each answer came from a fresh ephemeral Codex CLI 0.162.1 session with GPT-6.1-Sol at medium effort. No session received the later fix, the evaluator's measurements, the expected answer, another answer, or application history. The source was provided in the prompt; plugins, host skill discovery and the shell were disabled. The examiner checked distinct session IDs, the private source/fix parentage, prompt and guide digests, and absence of tool calls in the scored logs. An exploratory run that loaded a machine-wide guide was excluded, and both arms were restarted. The two additional paired cases test the central responsibilities of density and navigation separately from their neighboring responsive cases. + +The examiner fixed three case-specific criteria before running either arm. Fresh judge sessions saw the criteria, the two anonymous answers in randomized order, and the examiner's independent observations. A score of 0 means missing/wrong, 1 partial, and 2 specific and correct. Judges did not see the treatment key, but a workflow-shaped answer can reveal its origin. Credit is for diagnosis and a proposed verification where the brief calls for review. No answer earns credit for operating a connected application, implementing a fix, or actually using assistive technology. + + +## Current-guide comparisons + +| Historical case | Workflow | Source packet¹ | A / 6 | B / 6 | Case-level result | +|---|---|---|---:|---:|---| +| Agreement gate | `ui-identity` | `fd4fcce58ce5` | 3 | 3 | Both preserved separate consent choices and the teacher follow-up; neither traced the exit for a person declining. B did not establish a stronger signature-versus-clause hierarchy. | +| Team row (phone boundary) | `layout-density` | `2c18b39e2875` | 6 | 6 | Both diagnosed flexible identity losing to nonshrinking controls, regrouped the row, and protected target size. B explicitly recognized the responsive boundary. | +| Settings rail (width boundary) | `navigation-ux` | `710c5c9409f7` | 5 | 3 | Both recognized clipped destinations. A would wrap the labels; B added another disclosure. Neither tried revealing the existing active item first. The judge credited wrapping as an alternate solution, not as an implementation of rail scrolling. | +| Responsive disclosure | `responsive-layout` | `5917fa2efea9` | 5 | 5 | Both explained the closed disclosure and hidden desktop control and proposed one responsive, operable form. The width transitions were proposed, not executed by the reviewers. | +| Collection row actions | `direct-interactions` | `72cb3e4ba6fe` | 5 | 5 | Both separated the opener, profile link and like button; neither explicitly diagnosed the missing accessible name in the original row. B also labeled one row as a large change. | +| Rejected document field | `accessibility` | `ab107a6e0387` | 3 | 3 | Both tied the error to the field, considered both validation sources and avoided claims about spoken output. Both missed the extra label generated by the wrapper. | +| Shared typography | `design-system` | `356ab3117317` | 5 | 5 | Both identified distinct text roles and preserved constrained navigation sizes. Neither counted the excerpted uses or verified consuming pages. | +| Held press | `motion-design` | `30a8771575a1` | 5 | 5 | Both separated the pulse from the held state and recognized the anchor gap. B added rapid-input checks; neither explicitly removed the existing component scale for reduced motion. | +| Wide roster | `layout-density` | `6a24fe3b8d7d` | 4 | 5 | B added empty/pending/populated coverage to same-width verification. Both left the grouping of surrounding sections partly unresolved. | +| Profile drawer history | `navigation-ux` | `1725ff62e334` | 6 | 6 | Both traced the history stack, retained URL context and distinguished a proven in-app origin from a shared link with unrelated prior history. | + +¹ First 12 hex digits of SHA-256 of each private text packet, computed from sorted filenames and contents. These identify the samples without publishing product code, private revision IDs or screenshots. + +Current B scored higher on one pair (wide roster), lower on one (settings rail), and tied on eight. A tie on a strong answer shows this model could diagnose that **case** without the kit. A tie on a missed defect shows neither arm did so. The boundary case does not invalidate the navigation guide on its core history case, which both arms solved. No broad frontend uplift, routing performance, or release-wide validation follows. + +## Independent observations + +The independent checks used the configured headless WebKit in a single tab, against local HTML reproductions of the historical structure and representative CSS. They are deliberately **not** full-page renderings: fonts, surrounding components, real data and LiveView behavior can differ. Only the screenshots went to the reviewers; the measurements and accessibility trees were reserved for adjudication. + +- **Agreement gate:** at 375 px, the accessibility tree contained two agreement checkboxes, two document links and one primary submit, with no alternative exit. Explicit keyboard activation checked both boxes; the primary could receive focus. That does not prove the server records consent or permits return. The historical gate logic established the redirect and the actual exempt exit. +- **Team row:** at 375 px, the name's available/natural widths were 53/169 px; action rectangles were 114 × 44 and 91 × 44 px, and the document did not overflow. At 1280 px the name had 855 px. This is evidence of a local allocation problem; the wide teacher roster was separately assessed from historical source alone. +- **Workspace rail:** at 375 px the scrollable content was 744 px wide, with zero initial scroll; the marked item's edges were at 635 and 728 px. At 1280 px the same item was wholly visible. Seven destinations were already present. A separate historical drawer supplied an independent URL/history case. +- **Responsive disclosure:** the summary opened with Enter at 375 px. At 1280 px a fresh closed disclosure reported a computed block body and a nonzero child rectangle, yet the save control failed hit-testing, programmatic focus and visibility and was absent from the accessibility tree. The same checks passed for the open control. Geometry alone would have produced the wrong verdict. +- **Row actions:** a focus attempt failed on the outer clickable div (`tabIndex = -1`); its nested link and button could each receive focus. The accessibility tree contained neither a row opener nor its name. The reproduction does not establish whether any production click fires multiple events. +- **Document field:** the input exposed two native labels (one empty) even though the tree showed a plausible textbox name. In the rejected sample it had neither an invalid-state attribute nor a reference to the visible error. No screen reader was used and no spoken output is claimed. +- **Shared type:** the six original component excerpts contained 15 `text-xs`, 8 `text-sm`, 3 `text-base`, two 10 px literals and one 9 px literal. These sample counts are distinct from the larger product inventory in its design notes; no consumer-page rendering was tested. +- **Held press:** with regular motion, the plain button's brightness was about 0.80 at the middle sample and returned to normal after the 200 ms animation while still held. The plain link remained unchanged. With reduced motion, the 0.01 ms button animation had ended by the second sample. Certain shared controls independently applied an active scale. These traces do not demonstrate remote success, keyboard equivalence or native-device behavior. + +## Two focused candidate reruns + +Each candidate adds one general instruction to the matching baseline guide. A fresh session received the identical brief, source, contract and screenshot; only that instruction changed from the original guided input. A separate blinded comparison judged the old guided answer against the new one. The first two repeats are shown below. Including the additional comparisons that follow, that first round used **26 distinct executor sessions and six fresh judging sessions**. The original failures remain in the table. + +| Guide | Current → candidate / 6 | Changed behavior | +|---|---:|---| +| `ui-identity` | 3 → 4 | The candidate identified logout as an exempt candidate and warned against an untraced Back link. It did not fully establish the pending-user loop or the exit destination. | +| `accessibility` | 4 → 4 | The candidate found the extra empty label and proposed one populated native label. It lost explicit reconciliation of both error sources. The aggregate score did not improve; do not accept this draft as a net win. | + +The original answer was regraded independently in each candidate comparison. Judges differed on whether the original accessibility response deserved partial credit for identifying the outer label without spotting the empty wrapper (3/6 in the original A/B; 4/6 on regrading). All judges agreed it missed the wrapper. Compare within pairs. + +## Second accessibility candidate and navigation routing check + +- **Accessibility, revised wording:** the original guided result scored 4/6 versus 5/6 for a fresh guided answer. The revised instruction asks the reviewer to trace both the rendered associations and every existing validation source. The answer identified both labels, kept ID/name/value handling, respected the field error and separate rejection paths, and traced recovery. It did not expressly retain numeric input mode. +- **Accessibility, inverse:** both the current guide and that exact revised guide scored 6/6 and 6/6 on the same historical shared component with one error and correct native associations. Neither invented an extra label or called for a semantic change. This is a different case from the original composed field, using real source and its existing component-test example, not an assistive technology run. +- **Navigation, neighbor:** the identical rail packet was also paired with the unmodified `responsive-layout` guide. The original navigation-guided answer scored 3/6, and the responsive-guided answer scored 4/6 in this comparison. The latter recognized the missing active-item reveal, retained route/history semantics, and proposed wrapping on phones rather than adding another disclosure. It consciously rejected scrolling as the sole solution. Wrapping is a defensible design, but neither fresh guided session tested the smaller intervention of revealing only an offscreen selection. Routing to the neighbor reduced the scope of the proposal; it did not prove the original narrow fix. + +These candidates were written after observing misses and rerun on the same case, which favors them. Only the revised accessibility candidate also has a no-change control. The historical fixes are comparators; an alternative design need not match them to be useful. The public results exclude raw source, screenshots, account data, private revisions and executor transcripts. + +## Decision after the initial round + +Here “supported” means that the guided answer diagnosed the essential defect and proposed a plausible verification on the named read-only case. It is not evidence that frontline agents selected the workflow on their own or implemented it successfully. Neither a completed pair nor a point total automatically clears a release gate. + +| Workflow | Status for these diagnostic cases | Limits and next decision | +|---|---|---| +| `ui-identity` | **Pending** | The baseline missed a real alternative to a blocking primary action. A candidate recovered the candidate exit but did not fully establish its destination or improve the signature/clause hierarchy. Keep it experimental until an independent gate is tested. | +| `layout-density` | Supported on the phone boundary and wide roster | Both arms protected identity and hit-area allocation. The guide added desktop-state checks. No fixed application layout was rendered. | +| `navigation-ux` | Supported on drawer history; **pending at the width boundary** | Both arms solved history provenance, direct-entry fallback and Back. Navigation-guided rail advice added a disclosure; responsive advice was smaller, but neither tested visibility of the existing current item before restructuring. | +| `responsive-layout` | Supported on the disclosure | Matches independently measured native behavior; implementation and connected width transitions were not tested by executors. | +| `direct-interactions` | Supported on action separation | The native opener, nested controls and verification paths were correct. The baseline answer did not explicitly diagnose the missing original name or demonstrate a live event. | +| `accessibility` | **Baseline pending; refined candidate supported** on defect and inverse | The current guide missed the empty label. Only the second candidate recovered that defect without dropping the rejection paths and passed the inverse. No broader accessibility certification follows. | +| `design-system` | Supported for the excerpted migration review | Role-based tokens and intentional variants were identified. Actual consumer pages and rendered comparisons remain unverified. | +| `motion-design` | Supported for press lifetime; **pending on reduced-motion scale** | The answer recognized the active-scale problem but did not explicitly require suppressing that movement while retaining a stationary held state. Test that distinction on a fresh control. | + +**No all-frontend release validation from the initial round.** These are manual live model diagnostics accompanied by examiner-owned WebKit or source observations, distinct from kit structural gates. No production deployment, application changes, connected LiveView execution, physical device or screen reader was involved. + +## Independent candidate checks for the three remaining concerns + +Each proposed addition below was frozen *before* the original case was repeated and the separate control was run. On the original case the candidate got one fresh run against the stored baseline guided answer, with the exact same source, screenshot, brief and contract. On each independent control both baseline and candidate got fresh runs with identical inputs. The full prompts differed only by one general decision point. Two new judging sessions saw the randomized answers, the three preregistered criteria per case and independent observations, without the treatment key. This adds nine executor sessions and two judges, for **35 distinct executor sessions and eight judges** overall. The original session word limit remained 500. + +| Guide candidate | Original case, current → candidate / 6 | Independent case, current → candidate / 6 | Result | +|---|---:|---:|---| +| `ui-identity`: trace the choices and their consequences for each arriving person | 3 → 5 | 2 → 2 | The mandatory gate regained a real exit and the redirect explanation. The separate program/individual-session review did not show reliable transfer. **Defer this guide change.** | +| `navigation-ux`: distinguish route state, local-clipping and page-width failure before changing navigation | 2 → 6 | 5 → 4 | The first answer now kept the existing rail, focus and page scroll, revealing the active item only when needed. On an independently overflowing admin header, the candidate routed to responsive layout, did not prescribe scrolling and kept the commands. **Supported for these cases.** | +| `motion-design`: compare the computed held state with the animation, keeping meaningful displacement only | 4 → 6 | 5 → 6 | The candidate removed decorative scale while preserving stationary feedback. On a separate reorder gesture it kept the pointer-driven translation and distinguished the reduced-motion override from the normal tremor. **Supported for these cases.** | + +The identity transfer case matters: the historical program could show a public sold-out warning to a person already holding a seat. A prominent action could commit the full package, while the individual-day path was less visible. The candidate described several visitor states but did not identify the simultaneous contradictory conditions or a confirmation that named the scope and price of the commitment. The earlier agreement rerun also did not fully distinguish signing from the hierarchy of its supporting clauses. We did not add wording about this particular product to force the answer. + +The navigation control proposed wrapping the header instead of compressing the duplicated branding first. Its score fell one point versus the original guide because it omitted a direct-entry verification on this width-only control; both answers got full credit for distinguishing whole-bar overflow from an offscreen selection. It was useful for distinguishing page overflow from a local rail, not proof that the candidate always chooses the smallest visual change. The motion control kept the correctly reduced drag translation, even though the candidate also recommended removing the decorative tremor in the normal branch; that aesthetic recommendation was not independently validated. + +Further examiner checks, using the original historical rail hook and applicable CSS on reduced local fixtures: + +- At 375 px the menu held 744 px of content, but the document itself fitted. The original hook took the menu from scroll offset 0 to 369 and made the current item fully visible. A manually chosen offset of 364 stayed 364 on another update while the item remained visible. Focus and document scroll were not moved by the hook; at 1280 px a fitting menu stayed at offset 0. +- After a 300 ms hold on a shared-button reproduction, the browser still computed scale **0.97** under reduced motion, even though animation duration had fallen to **0.01 ms** and the brightness flash had ended. Thus changing duration alone cannot deliver stationary pressed feedback for this case. +- On the separate drag fixture, the normal CSS produced a scale of about 1.055 with a rotating ghost. Reduced motion produced scale 1, rotation 0 and no animation, while retaining the same pointer displacement of **(36, 22) px**. Removing every transform would break that useful signal. + +**Decision before the final holdout:** the revised accessibility, navigation and motion instructions have sufficient evidence for a narrow guide change. Keep the other five guides as tested. Of those five, **UI identity remains pending**: the separate transfer case failed an essential hierarchy/commitment check. Do not equate the seven case-supported workflows with validation of the full frontend catalog or with a release decision. These are bounded live diagnostic reviews, not client routing, before/after application implementation or a user study. + +## Final UI identity holdout + +One final pair tested a new, previously unseen payment-details screen. Before either answer, the examiner fixed three criteria: identify simultaneous coverage and settlement despite a primary payment link; preserve receipt/details access with an action weight grounded in whether money is due; and distinguish repeated or misleading paid/waived copy. The user brief asked for hierarchy and next steps and did not name the overlapping predicates. The added general instruction asks reviewers to examine independently true conditions together, including the commitment that remains for the same person. Neither that instruction nor the preceding candidate names the product. The original guide and final candidate scored **3/6 and 3/6** in a new blinded judging session. + +The candidate explicitly combined package coverage with paid and waived states and kept a useful package link while questioning payment emphasis. The baseline also recognized the problem of a permanently primary link. The candidate did not fully establish all settled/refunding combinations or the standalone paid-versus-waived copy distinction. This is partial transfer to one independent case, not proof that the final wording resolves the earlier purchase-confirmation miss. No further wording or case was fit to these responses. + +**Release interpretation:** accessibility, navigation and motion have supported, narrowly scoped guide changes. UI identity remains pending for the consent/commitment and overlapping-state family: the first novel transfer case missed the contradictory statuses and informed package confirmation, and this final comparison did not close those gaps across cases. Leave that experimental wording unpublished. Across the frontend experiments there were **37 distinct executor sessions and nine fresh judge sessions**, all read-only. No all-frontend release sign-off. diff --git a/priv/library/skills/motion-design/SKILL.md b/priv/library/skills/motion-design/SKILL.md index d21b308..0535a35 100644 --- a/priv/library/skills/motion-design/SKILL.md +++ b/priv/library/skills/motion-design/SKILL.md @@ -43,6 +43,8 @@ This workflow governs **interface motion**. Rendered video, motion graphics and ## Decision points +- Check the final computed state as well as the transition that reaches it, including styles from the component and its outer surface. Shortening a duration does not remove a transform applied by an interaction state. Under reduced motion, remove decorative displacement or scale while retaining a stationary signal of the same state; keep movement required for direct manipulation and verify both the normal and reduced branches. + - If the motion explains a state change, keep it and make it exact. If it only decorates, cut it or remove it. - Prefer a cut or a short in-place change for text, rows and counters. A crafted travel is for a new context or a signature moment, not for every section. - Use a spring only for direct manipulation or physical arrival (sheet, drag, add and remove). Overshoot is a choice; decelerating curves suit most product surfaces. diff --git a/priv/library/skills/navigation-ux/SKILL.md b/priv/library/skills/navigation-ux/SKILL.md index ddbda72..b2f2ad9 100644 --- a/priv/library/skills/navigation-ux/SKILL.md +++ b/priv/library/skills/navigation-ux/SKILL.md @@ -43,6 +43,8 @@ This workflow owns history, URLs, overlays that act as navigation, back behavior ## Decision points +- When a direct link seems to lose its location, first distinguish missing route state from a correctly identified destination outside the visible portion of a navigation container. Check the container and document separately. If the navigation already works, try the smallest local reveal on entry or changed selection; keep focus and scroll where they are when the item is already visible or the container fits. If the page itself cannot fit, route that layout defect to responsive-layout instead of scrolling it away. + - A place has a URL; a choice does not. Decide per overlay, never with a global history interceptor or a reflex history entry on every open. - State the user would expect in a shared link lives in the URL; personal transient state lives in assigns; state that must outlive the socket lives in the database or session. - `push_patch` for a change within the same LiveView, `push_navigate` when the process must restart, `redirect` only when leaving LiveView; a remount that drops the user's work is a finding. From f202d0522554c837a2ccc09ec85685d30d844f78 Mon Sep 17 00:00:00 2001 From: Lucas Tavano Date: Fri, 13 Nov 2026 21:12:13 -0300 Subject: [PATCH 4/4] Pin the seven evaluated guide bodies and qualify the catalog count --- .../results/2026-11-13-catalog-field-round.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/evals/results/2026-11-13-catalog-field-round.md b/evals/results/2026-11-13-catalog-field-round.md index 3a66e4e..6f81eff 100644 --- a/evals/results/2026-11-13-catalog-field-round.md +++ b/evals/results/2026-11-13-catalog-field-round.md @@ -29,3 +29,22 @@ not tag a release on this evidence. A useful next test is a new independent source of expected product hierarchy (for example a designer-approved set of simultaneous states and their permitted actions), frozen before proposing new wording; do not tune against these three screens again. + +## Candidate identity and limits + +The following SHA-256 values identify the full installed workflow files used +in the final candidate runs, including the inline guide in the pipeline test. +A match identifies the instructions; it does not establish repeatability. +In particular, pipeline outcomes varied across sessions. The 37 dispositions +above concern the named cases only, not complete acceptance across every +criterion or superiority to an unaided agent. + +| Workflow | SHA-256 | +|---|---| +| `data-pipelines` | `9b184ffdb3fd41fde659131cf05b4b47b95ec04670f882e06ab0db836a161426` | +| `async-state` | `67fdeacafaefb058c4e79f60dc561cceaf35c23fc5cf5ee22310af344e618066` | +| `commercial-eligibility` | `3e58a79797c7192e255ab5a4b68b01bd25052e65a850684aa2fa1a5709795f71` | +| `revision-lineage` | `88ee9430c14b55ffcd2913c3d1e3047a080b6fd57b99b348cd73f39e7adc4022` | +| `accessibility` | `235a9a2d72b7a43bd51b1ea6cd22b699ad51b68d3107ddd2efd624759099763f` | +| `navigation-ux` | `0ea2ec6236b3f234540ee6e03120c64e64d18c7ed382d814878c55ae2c1a413a` | +| `motion-design` | `b9d95147fcbd8a5aab67081762a92c68f94f8aec6fab70e0dea3c83395a689c0` |