Skip to content

2026-11-21 bundle: TR-112b schema apply, TR-112c non-root images, TR-116 repo names - #1126

Merged
dwolfson merged 10 commits into
mainfrom
claude/bundle-2026-11-21
Nov 21, 2026
Merged

dwolfson merged 10 commits into
mainfrom
claude/bundle-2026-11-21

Conversation

@dwolfson

Copy link
Copy Markdown
Owner

2026-11-21 bundle: TR-112b schema apply, TR-112c non-root images, TR-116 repository names

Two branches, merged with merge commits onto main (b3d9c69). The bundle's tree (3a2b2727) is byte-identical to the tree gate b481 tested.

TR-112b: resource-explorer schema apply and RE_SCHEMA_MODE

  • resource-explorer schema apply builds the registry schema once, then prints schema ready · <n> statements · <elapsed>. A second run sends no DDL.
  • A one-row schema_version marker holds a fingerprint of the schema-defining code. That code includes what _init_schema imports, such as open_data.schema, the annotation types and the slug helper. A change to any of it moves the fingerprint.
  • RE_SCHEMA_MODE=external never runs DDL. It refuses with SchemaNotReady when the marker is missing or out of date. auto is unchanged.
  • The mode is per instance. It's passed through open_for_schema_apply, never held as class state. apply is accepted only from that command, never from the environment.
  • The docs say external mode covers the registry only; the other stores are TR-115. They also say rolling upgrades rely on additive migrations.

TR-112c: RE and EA images run as an arbitrary UID with GID 0

  • In both images the data directory, HOME and the Hugging Face cache are group 0 with g=u, and HOME is set.
  • The default user is still trellis (1000:1000).
  • Proven as the default user and as 1000680000:0:
    • health on 8810 and 8880;
    • every written path is writable;
    • schema apply runs twice, then web in external mode.

TR-116: a repository's SourceControlLibrary name is owner/repo

  • The cause: names differed depending on how the repo was registered. The wizard stored repo; discovery and org import stored owner/repo.
  • The fix:
    • One helper, repo_display_name(url), derives owner/repo from the URL and drops .git, ?query and #fragment.
    • It handles https, git@host:owner/repo, ssh:// and token URLs.
    • It returns None for a host other than github.com, and the publisher then falls back to the registered name.
  • Existing elements aren't renamed by this PR. A one-off rename of egeria-python follows separately.

Verification

Check Result
RE main suite 15,818 passed, 0 failed
Render harness 2,137 / 0
Boot 3 passed
trellis-analytics 294 / 0
Other packages 0 new failures
  • Gate b479 caught a class-state bug in an earlier 112b version; it's fixed here (per-instance mode).
  • Every commit is signed with Signed-off-by.

Merge with a merge commit (not squash). Deploying RE 8813 is a separate step.

🤖 Generated with Claude Code

…SCHEMA_MODE

`resource-explorer schema apply` runs the registry schema setup once, counts
the statements, writes a one-row schema_version marker (hash of the
schema-defining code) and prints "schema ready · N statements · elapsed".
A second run finds the marker, sends no DDL and prints the same line. It
uses the same database URL as web, so ?options=-csearch_path is kept.

RE_SCHEMA_MODE=auto (default) is unchanged. external never runs DDL: it
checks the marker and raises SchemaNotReady with the instruction to run
schema apply. The entrypoint gains a schema-apply role. A Postgres advisory
lock serialises concurrent applies. ProjectRegistry's constructor signature
is unchanged (a test pins it).

Tests run against a throwaway Postgres (RE_SCHEMA_TEST_PG_URL); they skip
without it, so none can reach a shared registry.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ith GID 0

Written paths (data dir, HOME, model cache) are group 0 with g=u and HOME is
set explicitly, so the same image runs as trellis (1000:1000, what compose
uses, unchanged) and as a random UID with GID 0 (OpenShift restricted-v2).
docker/proof-nonroot.sh runs both images both ways: health, a write to every
written path, ports at or above 1024, and for RE schema-apply twice then web
in RE_SCHEMA_MODE=external. Stacked on the TR-112b branch.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…pe and upgrade notes

The version hash followed only self. attributes and registry.py assignments,
so a change to open_data STATEMENTS or ADD_REPO_SLUG_COLUMN,
survey_report.ANNOTATION_TYPES_REGISTRY or org_importer._url_to_slug left it
unchanged. It now follows imports (module level and inside methods) and the
module-level definitions they reach, in a new schema_fingerprint module.
Tests: each of those moves the hash; docstrings and comments do not.

Docs and SchemaNotReady say external mode covers the registry only (four
stores still run their own DDL; TR-115) and that rolling upgrades rely on
additive migrations.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…, from its URL

The SCL was named from the registry's display name, which depends on how the
repository was registered: the onboarding wizard stores the bare repo name,
the discovery and org-import paths store GitHub's full_name. One helper now
derives owner/repo from the URL (https, ssh, ssh://, trailing slash, .git) and
the publisher's create uses it, falling back to the registered name only when
the URL has no owner and repo.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
open_for_schema_apply builds the instance with cls.__new__ and _construct
(schema_mode="apply"); __init__ keeps its signature and calls _construct. The
mode no longer lives on ProjectRegistry, so a MagicMock'd ProjectRegistry
class (the scheduler and scouting tests) cannot leak into a real
constructor, and two threads cannot see each other's mode.

Tests: a patched ProjectRegistry class, two threads with their own modes,
and the constructor signature pin.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ne off github.com

A query or fragment no longer stays in the name, and a non-github.com host (a
GitLab subgroup path, say) gives None so the publisher falls back to the
registered name instead of publishing a wrong owner/repo.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
The environment value is validated against auto and external only, so
"apply" is reachable only through open_for_schema_apply's parameter. A web
start with RE_SCHEMA_MODE=apply used to run neither the setup nor the marker
check. Test: the environment value apply raises a ValueError naming auto and
external, and open_for_schema_apply still works.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 13caf6f into main Nov 21, 2026
6 checks 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