Skip to content

feat(engine): resolution metrics over time, so the dashboard can show a trend (O7a) - #236

Merged
athvin merged 1 commit into
mainfrom
feat/dg-o7-insights
Oct 22, 2026
Merged

athvin merged 1 commit into
mainfrom
feat/dg-o7-insights

Conversation

@athvin

@athvin athvin commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Every dashboard number has always been computed live from the lake. That means the product could say what is true now and nothing about the direction of travel — and "is the duplicate rate going up" is the question an operator actually has. Nothing was retained to answer it.

New metric_snapshot lake entity, written at the end of every run_all, plus GET /v1/orgs/{org}/insights returning the series newest-first with the derived rates.

Four judgements worth the review

It counts duplicate RECORDS as well as groups. Counting only groups calls a five-record cluster and a two-record cluster the same amount of duplication — which is how a worsening corpus looks flat.

It keeps largest_group. A sudden jump there is the signature of an over-merge, and an average cluster size hides it completely.

It is assembled in one query per family. A snapshot built from several independent reads of a live lake can describe a corpus that never existed at any instant.

duplicate_rate is null, not 0.0, when there are no records. Reporting zero would draw a reassuring flat line for an empty corpus.

Shape

Keyed on run_id and upserted, so a correction pass or a retry reusing a run id corrects the snapshot instead of double-counting.

Written best-effort and last: the run's results are already in the lake, so a failure to describe them must not fail the run that produced them.

Rates are derived on read rather than stored, so changing a definition does not need a backfill.

Test

a_run_records_metrics_that_agree_with_the_corpus checks every count against the lake it describes rather than against constants — so it asserts "the snapshot is true", not "the snapshot is what it was when I wrote this". It also asserts duplicate_records > duplicate_groups on base_10, so the two definitions are distinguishable, and that re-running a run id corrects rather than appends.

Determinism

Deliberate rebaseline: model_registry_golden.json gains metric_snapshots (pure addition). No fixture and no base_10 golden is touched.

Gates

make check; the DuckLake e2e tier.

🤖 Generated with Claude Code

@athvin
athvin force-pushed the feat/dg-o7-insights branch 2 times, most recently from 246bb44 to 87593a6 Compare October 21, 2026 23:22
… a trend (O7a)

Every dashboard number has always been computed LIVE from the lake. That
means the product could say what is true now and nothing about the
direction of travel — and "is the duplicate rate going up" is the question
an operator actually has. Nothing was retained to answer it.

New `metric_snapshot` lake entity, written at the end of every `run_all`,
plus GET /v1/orgs/{org}/insights returning the series newest-first with the
derived rates.

Four judgements worth recording:

- It counts duplicate RECORDS as well as groups. Counting only groups calls
  a five-record cluster and a two-record cluster the same amount of
  duplication, which is how a worsening corpus looks flat.
- It keeps `largest_group`, because a sudden jump there is the signature of
  an over-merge and an average cluster size hides it completely.
- It is assembled in ONE query per family: a snapshot built from several
  independent reads of a live lake can describe a corpus that never existed
  at any instant.
- `duplicate_rate` is null, not 0.0, when there are no records. Reporting
  zero would draw a reassuring flat line for an empty corpus.

Keyed on run_id and upserted, so a correction pass or a retry reusing a run
id corrects the snapshot instead of double-counting. Written best-effort and
last: the run's results are already in the lake, so a failure to describe
them must not fail the run that produced them. Rates are derived on read
rather than stored, so changing a definition does not need a backfill.

Test: `a_run_records_metrics_that_agree_with_the_corpus` checks every count
against the lake it describes rather than against constants — it asserts
"the snapshot is true", not "the snapshot is what it was when I wrote this".
It also asserts duplicate_records > duplicate_groups on base_10, so the two
definitions are distinguishable, and that re-running a run id corrects
rather than appends.

Deliberate rebaseline: model_registry_golden.json gains metric_snapshots
(pure addition). No fixture and no base_10 golden is touched.

Gates: make check; DuckLake e2e tier.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin force-pushed the feat/dg-o7-insights branch from 87593a6 to be839fc Compare October 22, 2026 00:01
@athvin
athvin merged commit 2a04dca into main Oct 22, 2026
14 checks passed
@athvin
athvin deleted the feat/dg-o7-insights branch October 22, 2026 00:32
athvin added a commit that referenced this pull request Oct 22, 2026
…at catches drift (#243)

* feat(agents): a 15-skill library, generated references, and a gate that catches drift

The repo had three skills (entity-framework, security, pentest) covering schema
governance and security. Everything else an engineer does here was uncovered —
and those gaps are exactly where no vendor skill exists: Fellegi-Sunter
matching, DuckLake from Rust, the er CLI, the utoipa->TypeScript contract, the
BFF boundary, EKS/Terraform, and the CI gate set.

Eleven new skills, four refreshed, all flat in .claude/skills/ (rust/.claude is
gitignored and symposium regenerates it; nested skills also load only lazily).

Two defects fixed:
  - .agents/skills/ducklake-performance was tracked but unreachable — Claude
    Code only reads .claude/skills/, and symposium never mirrored it. It has
    been invisible in every session since it was written.
  - It was also stale: it instructed running benchmarks/workload_report.py,
    which no longer exists, and proposed Python-pushdown experiments in an
    all-Rust codebase. docs/profiling.md and docs/performance.md are themselves
    banner-marked historical records of the retired Python pipeline, so the
    rewrite says so rather than implying a campaign can be run.

The drift that motivated the gate: entity-framework claimed 25 entities against
a tree holding 30, security cited a statement count that had moved, and both
described er-entity check as narrower than verify when they are one code path.
So no skill states a count — counts live in five GENERATED blocks rebuilt from
entities/, the crate tree, analyze.rs, the workflows and the frontend config.
diagnostics.md derives the documented-but-unimplemented E0xx set by
set-differencing the design doc against the source, so nobody maintains it.

scripts/skills-check.sh splits by what its output derives from, and the CI
placement follows: regen derives from code (so it rides the existing lint job,
which any code change reaches), while lint derives from the skills themselves
and runs in a new job NOT gated on detect — because a .claude-only PR is
exactly what detect skips, and that is the PR that changes a skill.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(agents): route entity-framework away from sql-analysis, allow anchor links

Two findings from verifying the gate against all 15 skills.

entity-framework was the only description with no negative routing, and it now
overlaps the new sql-analysis skill on E0xx triggers — so a diagnostic question
could land on either. It now points at sql-analysis for the analyser's own
internals and at er-matching for golden-governed model SQL.

The link checker treated a `file.md#heading` target as a missing file, which
would have rejected a legitimate deep link into docs/entity-lint-rules.md. The
fragment is now stripped before the existence test while the error still reports
what the author wrote. Verified both directions: an anchor into a real file
passes, an anchor into a missing one still fails.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(agents): rebase onto main — dependabot now pins those majors, and two entities landed

Rebasing onto main picked up #240, which excludes arrow and
datafusion-common/-expr from dependabot's major updates. Three places in
rust-conventions and ci-and-supply-chain said the opposite — verified true when
written, wrong one rebase later. They now describe the exclusions and carry the
compiler errors that justified them (arrow 60's two RecordBatch types,
DataFusion 55's duplicate arrow_schema in the graph).

The generated entity index moved on its own: #236 added metric_snapshot and
#237 added record_quality, so 30 -> 32 entities and 131 -> 137 statements. The
gate caught it during a routine rebase with no prompting, which is the whole
argument for not writing counts in prose — that number would otherwise have
been silently wrong from the moment this branch rebased.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(ci): the skills job inherited rust/ as its working directory

The new `agent skills (lint)` job failed on its first push with exit 127 —
`bash: scripts/skills-check.sh: No such file or directory`. This workflow
defaults every `run` to `rust/` for the cargo jobs, and the script lives at
the repo root, so the step never reached a single assertion.

The step I added to the `lint` job already overrode it; this one did not. Both
now do, with a comment naming the failure so the next person adding a
root-relative step here does not repeat it.

Worth noting this class of bug is invisible locally: the script is
CWD-independent once it starts (it cds to its own repo root), so every local
run passed. Only CI's working-directory default could expose it — which is the
argument for observing a gate fail in CI before trusting it, and for not having
proposed it as a required check yet.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants