Repository navigation
feat(api): tenant-admin dataset configuration — validate, dataset-scoped publish (#1010) - #1266
Merged
Merged
Conversation
…ped publish (#1010) A tenant admin key can create a dataset, dry-run a candidate config with POST …/config/validate, and publish it to THAT dataset. Publish and GET …/config read the org row, so a publish to any non-default dataset overwrote the default dataset's config file and repointed the org; a second dataset's first publish also hit the per-org correction-schedule unique, now per dataset (fixup 0006 drops the old index). Source mappings are checked before a run is queued, publish refuses an entity_type mismatch and a provisioning dataset, and pg_err walks its source chain. Also fixes the docs overview baseline shifting with page length (#1204). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 26, 2026 19:23 — with
GitHub Actions
Inactive
This was referenced Nov 26, 2026
Closed
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1010
Closes #1204
What
A tenant admin key can now run the whole dataset-configuration workflow through the public contract: create a dataset, validate a candidate config (
POST …/datasets/{ds}/config/validate, a dry run of every publish check), store a draft and publish it — and the publish lands on that dataset. Source mappings are checked before any run is queued. Docs describe the allowed customer configuration surface, model boundaries, tiers and rollback.Why
#1010's gap audit found the workflow broken for any dataset but
default: publish read the org row, so it overwrote the default dataset's config file, classified its tier against the default's document and repointed the org;GET …/configserved the default's config for every dataset; and a second dataset's first publish 500'd onschedules_one_correction_per_org. Dataset create was documented as operator-only, so it was absent from the public contract.Proof
pg_dataset_config(new): admin creates/validates/publishes a second dataset; asserts the default's file,/configand the org mirror are untouched, tier A classification against the dataset's own config, 403/404/409 edges, and that validation stores nothing.cargo test -p er-serveragainst Postgres (ER_TEST_PG_DSN): all pass (280 lib + 151 integration).make check: see below. Frontend:tsc, eslint,developer-referenceunit test green; docs overview baselines regenerated in the pinned Linux image.Risk & rollback
Fixup
0006drops the org-wide correction-schedule unique index (only loosens).git revert <merge-sha>is the rollback; the dropped index would not be recreated by the revert, which is harmless (the new per-dataset index stands in its place until then).Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-26T19:33:25Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not:
de8687b9— rust 45883261965 success, frontend 45883262045 success, infra/devcontainer/marketing preview successimagesbuilt, or correctly never ran because nothing that goes intoan image changed: 45883262090 success
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: deploy 45883709472 (dev + prod success); the live process at
https://dupezero.com/api/openapiserves the new public contract containingPOST …/config/validate(probed 2026-11-26T19:32Z)deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: deploy green;
driftred before this merge on the unconfirmed SNS subscriber (Confirm the er-alerts email subscription and prove alert delivery #1056),kindprobe red before it (known, kind probe red since 2026-11-10: KeyError 'token_hash' after the credential-omission fix #1106)Donethrough the automation rather than byhand, and the issue closed: API: self-service dataset configuration and source mapping #1010 and docs overview visual baseline breaks whenever /docs changes length #1204 CLOSED/COMPLETED, both cards
Done(a skill, a reference, memory) — or nothing new was learned: the dataset-scoping rules are in the code comments and the docs page; memory updated with the session's gate traps
Specific to this change
0006_per_dataset_correction_schedulerecorded in dev'spublic.fixupsafter deploy — blocked — the AWS SSO session on this machine expired (needs an interactiveaws sso login); the deploy's schema-migrate hook succeeded, which runs every fixup before the new pods startContext — plan, discoveries, measurements, files
Discoveries
publish_config_versionusedpg::org_publish_context(org row) forconfig_path, state and active version → cross-dataset overwrite. Now uses the dataset row; the org's deprecatedactive_config_versionmirror moves only for the default dataset.active_configread the same org pointer.schedules_one_correction_per_orgunique onorg_idwhileensure_config_ownedkeyed by dataset → second dataset's publish = unique violation. Index is now per dataset; fixup 0006 drops the old one.pg_errprinted onlydb error; it now walks the source chain (errfmt::chain), per the repo's error rule.sources.*.columnskeys: a misspelled attribute (emial) was silently ignored. Newsource_mapping_problems: canonical attributes only, no empty/duplicate columns, non-empty record id/timestamp columns, distinctpriority_ranks.entity_typedisagrees with the dataset's, and refuses a dataset still provisioning (409).Files
er-server/src/{lib,config_check,fixups,pg,openapi}.rs,entities/schedule/entity.yaml(+ generated),tests/pg_dataset_config.rs, regenerated OpenAPI/TS/MCP/operations,frontend/src/app/(marketing)/docs/page.tsx.🤖 Generated with Claude Code