Skip to content

feat(registry): managed lists and classification domains - #7

Merged
markhazleton merged 3 commits into
mainfrom
001-work-ps-023-classification-domains
Nov 21, 2026
Merged

markhazleton merged 3 commits into
mainfrom
001-work-ps-023-classification-domains

Conversation

@markhazleton

Copy link
Copy Markdown
Collaborator

Summary

Repository properties are now chosen from lists set up beforehand instead of typed as free text.

  • Managed lists. Clients, projects and applications are picked from cascading dropdowns, both when assigning a repository and on the source form. The API, store and CLI reject unknown names, so a typo can no longer create a second client. The CLI's add and assign take --create to add a name on purpose.
  • Lists tab. Create, rename, retire, restore and merge entries. A project with no client is internal. Merging moves every repository and source to the entry that stays. Likely duplicates ("Acme" / "Acme, Inc.") are suggested but never merged automatically.
  • Domains tab. Named lists of allowed values, either single- or multi-choice. Seeded with Tier, Type, Lifecycle (single) and Stack (multi), all editable. Keys are stable and labels can change. A value or domain that is in use can only be retired: it leaves the dropdowns but stays on repositories that have it.
  • Repositories tab. Edit a repository's domain values, classify a selection in bulk, and filter for repositories missing a client or a domain value.
  • Export. portfolio.json lists every active domain per repository (empty list when unassigned) plus a domain catalog with labels. It updates on the worker's next collection.
  • Fix. Editing a source with an invalid client used to save enabled before failing. The client is now checked first.

Excluded: automatic tier rules, scope selector and dashboard filters, per-client access, domains on anything other than repositories, and classifications in per-source repositories.json, which the collector writes without reading the registry. Self-hosted, single-administrator admin UI only; the public Pages build is unaffected.

Changes

Migration 4: retired_at on client/project/application; domain, domain_value and repository_classification tables; seeded domains.

  • Backend: new registry/catalog.py, registry/domains.py, api/catalog_routes.py (takes over the client/project/application routes from app.py)
  • Frontend: new Lists and Domains panels, repository editor, bulk classify; updated Repositories, Sources and admin API client
  • Tests: test_classification.py, test_classification_api.py, Classification.test.jsx; existing tests updated
  • Docs: DOCKER_DEPLOYMENT.md

26 files, +3842 / -325.

Verification

  • ./run-validation.ps1: exit 0. pip check, black, flake8, mypy (76 files), pytest 572 passed, config validate, pip-audit (no known vulnerabilities), npm ci, lint, prettier check, vitest 168 passed with coverage, build, npm audit (0 vulnerabilities).
  • New tests cover migration, unknown-name rejection, retire, merge, duplicates, single/multi-choice, bulk classify, export, CLI --create and API auth; frontend tests cover cascading dropdowns, no free text, bulk classify, the gap filter and both new tabs.
  • End to end: built a registry with the code on main (schema 3, free-text names including a case-variant duplicate), then opened it with this branch through the real API. All assignments, including an internal project, survived. The duplicate was suggested, a typo was rejected, merge moved 1 repository and 1 source, bulk classify and the export worked, and the pre-migration backup was written.

Quality Gates

No gate artifacts found. Knowledge is ready; no .knowledge/ nodes changed.

Deployment status

Ready to deploy, not deployed. After deploy: back up the server registry, then confirm on the Lists tab that existing clients and assignments are intact and merge any suggested duplicates.

Notes

  • store.py (581 lines before this change) gets the size-justification comment the constitution requires; it is now 521.
  • In Git Bash on Windows, vitest fails every file (also on main); it passes in PowerShell and CI.

🤖 Generated with Claude Code

markhazleton and others added 3 commits November 21, 2026 15:28
Clients, projects and applications are chosen from managed lists instead
of typed: unknown names are rejected by the API, store and CLI (which
gains --create). A Lists tab creates, renames, retires, restores and
merges entries and suggests likely duplicates. Domains (Tier, Type,
Lifecycle, Stack seeded, all editable) classify repositories singly or
in bulk; values in use are retired, not deleted. Classifications are
exported to portfolio.json with explicit empty lists.

Migration 4 keeps existing names and assignments. Editing a source now
validates the client before changing anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Validate a repository assignment before saving the excluded flag, so a
  rejected PATCH leaves the repository unchanged.
- Keep domain headings to the label; the Rename control sits beside them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
L-01 and L-02 remediated in d7eb401 and awaiting independent verification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markhazleton
markhazleton merged commit c9f1770 into main Nov 21, 2026
1 check passed
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.

1 participant