Skip to content

fix(start-os): restore the Start9 and Community registries on servers updated from 0.3.5 - #4673

Merged
dr-bonez merged 3 commits into
masterfrom
fix/seed-default-registries
Nov 11, 2026
Merged

dr-bonez merged 3 commits into
masterfrom
fix/seed-default-registries

Conversation

@MattDHill

@MattDHill MattDHill commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Fixes #4672.

Servers updated from 0.3.5 reach 0.4 with an empty ui.registries: v0_4_0_alpha_1 reads ui.marketplace.knownHosts, but 0.3.5 stored it as known-hosts. 0.4.0–0.4.1.1 masked this. Their UI prepended the built-in Start9 and Community registries and wrote each one's name back into ui.registries the first time it fetched, which BadgeService triggers at startup. 0.4.1.2 removed both, so a server that went from 0.3.5 straight to 0.4.1.2 or later shows a Marketplace stuck on "Loading..." with no registries.

  • The 0.4.2.1 migration adds back whichever built-in registry is missing, under the fresh-install seed's name. It matches existing entries with same_registry, so a saved https://registry.start9.com without a trailing slash counts, and it leaves other registries, their names, and a database without UI data untouched. migration_revision goes to 1, because 0.4.2.1 is already on alpha. The step is idempotent.
  • db.put.ui refuses the root pointer and anything under /registries, so registries change only through the registry handlers, which keep key trust in step. The web UI's own db.put.ui calls all write other keys.
  • remove_public accepts the built-in registries and still refuses whichever one provides StartOS updates. The web interface keeps hiding Remove for them. A CLI command to remove them comes with the separate server registries namespace change.

The new db.put.ui error ships in all five locales. Tests cover:

  • a 0.3.5-shaped UI through v0_4_0_alpha_1 and then 0.4.2.1
  • missing, null and partially populated lists, a database without UI data, and a second run changing nothing
  • the 0.4.2 → 0.4.2.1 release migration committing revision 1, and an existing 0.4.2.1 install at revision 0 repaired once at startup
  • built-in removal: refused for the OS-update registry, accepted otherwise
  • db.put.ui pointers, refused and allowed

cargo check -p start-core --tests --features=test passes locally with no new warnings. The tests themselves run in CI.

🤖 Generated with Claude Code

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for the existing migration regression test; I found no production correctness issue in the repair itself.

P2 — Update version::tests::releases_migrate_and_roll_back_without_changing_service_data. Its 0.4.2 → 0.4.2.1 fixture omits public.ui, so the new seed_default_registries returns an error and the existing migration unwrap() fails. Once that fixture is valid, the test still expects migration revision 0 although this PR records 1. The proposal supplies an empty UI object and updates the expected revision without weakening the migration's validation.

The proposal also adds coverage through the production Upgrade::load/apply path for an already-installed 0.4.2.1 alpha server at revision 0: the defaults are restored, unrelated UI state survives, revision 1 is recorded, and a subsequent startup leaves the database unchanged. The new direct Version.up tests do not cover that rollout path.

Proposed changes: b170c07...proposal/4673

The reviewed head merges cleanly with origin/master. Review and proposal are code-inspection only; I did not build, format, or run tests. CI is still pending, including Run Automated Tests. The author must verify adopted changes.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

v0_4_0_alpha_1 read ui.marketplace.knownHosts, but 0.3.5 stored the list
as known-hosts, so every 0.3.5 upgrade reached 0.4 with ui.registries
empty. 0.4.0-0.4.1.1 hid this by prepending the built-in registries and
saving them on first fetch; 0.4.1.2 dropped both, leaving servers that
skipped those versions with an empty Marketplace.

The built-in registries are now an invariant rather than UI convention:
- trusted_keys.remove-registry refuses either one (the UI only hid the
  button, and the backend refused only the OS-update registry)
- db.put.ui refuses the root pointer and anything under /registries
- the 0.4.2.1 migration restores whichever is missing, and bumps
  migration_revision so alpha servers already on 0.4.2.1 pick it up

Fixes #4672

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MattDHill
MattDHill force-pushed the fix/seed-default-registries branch from b170c07 to 550ca3b Compare November 10, 2026 17:06
@MattDHill MattDHill changed the title fix(start-os): seed the default registries on servers updated from 0.3.5 fix(start-os): keep the Start9 and Community registries connected Nov 10, 2026
helix-white added a commit that referenced this pull request Nov 10, 2026
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: the earlier migration-test blocker remains on head 550ca3b8.

P2 — The existing release-migration test still expects revision 0. In version::tests::releases_migrate_and_roll_back_without_changing_service_data, the ("0.4.2", "0.4.2.1", 0) case must expect 1. The production migration commits revision 1, so its applied_migration_revision assertion fails. The new helper tolerates the missing UI, addressing the previous error path, but the fixture should include a valid empty UI object so this case exercises the registry repair rather than silently skipping it.

I refreshed the proposal against this head. It fixes that fixture and expectation and adds the previously proposed production Upgrade::load/apply regression for an existing 0.4.2.1 alpha installation at revision 0, including unrelated-state preservation and the subsequent no-op startup. It also records the permanent-connection invariant beside BUILTIN_REGISTRIES, so the production owner states the obligation now enforced across registry operations and generic UI-data writes.

The expanded removal guard, pointer restrictions, and partial-list repair look consistent with the stated policy. The PR merges cleanly with origin/master.

Proposed changes: 550ca3b...proposal/4673

Code-inspection review only; no builds, formatting, or tests run. Prettier, Dependency Licenses, and Conflict Markers have passed; Run Automated Tests and other checks remain pending. The author must verify adopted changes.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

The release-migration test still expected 0.4.2.1 at revision 0, and its
fixture had no UI object, so the registry repair was skipped. Add a ui
fixture, expect revision 1, and cover an existing 0.4.2.1 install at
revision 0 being repaired once on startup. The migration now reads
public.ui without IndexMut, which would insert a null ui into a db that
has none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MattDHill

MattDHill commented Nov 10, 2026 •

Copy link
Copy Markdown
Member Author

Adopted proposal/4673 in f06f652: the release-migration case now expects revision 1 with a ui fixture, plus the Upgrade::load/apply re-run test and the invariant line on BUILTIN_REGISTRIES. One addition: the migration reads public.ui with get_mut instead of IndexMut, which would have inserted ui: null into a db without one; covered by a_db_without_ui_is_left_unchanged.

helix-white
helix-white previously approved these changes Nov 10, 2026

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at f06f6527. The earlier findings are addressed: the release-migration test expects revision 1 with a valid UI fixture, the same-version alpha repair has production-path regression coverage, and the connection invariant is recorded at its owner. The additional non-inserting lookup correctly leaves databases without UI data unchanged. This head merges cleanly with origin/master.

The 0.4.2.1 migration restores either missing Start9 or Community registry, repairing the empty Marketplace caused by the older migration reading knownHosts instead of the legacy known-hosts. It preserves saved names, equivalent URL spellings, custom entries, and unrelated UI data. Missing or null registry lists are initialized; non-object lists and absent UI data remain unchanged. Revision 1 makes the existing migration machinery apply the repair to servers already running 0.4.2.1 alpha.

This also makes the two built-in connections permanent through normal registry operations: removal now fails even when the registry is not the OS-update source. Generic db.put.ui calls can no longer replace the entire UI object or write anywhere under /registries; other UI keys remain writable. These are intentional API restrictions, with errors translated into all five locales. Repair and removal share the built-in list and existing URL-identity comparison. The migration does not change signer-trust flags or the OS-update source.

Implementation diff: +74 / −1 lines in 5 files (excludes lockfiles, tests, docs, release notes, and changelog).

Verification: code inspection only; I ran no builds or tests. The added tests cover legacy recovery, partial lists, idempotence, removal and pointer guards, and same-version migration replay. The author reports no local test execution. Current-head CI remains pending, including Automated Tests and product compilation; Conflict Markers has passed. No end-to-end upgrade or Marketplace session has been exercised for this review.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@MattDHill MattDHill changed the title fix(start-os): keep the Start9 and Community registries connected fix(start-os): restore the Start9 and Community registries; remove them from the CLI only Nov 10, 2026
@MattDHill

Copy link
Copy Markdown
Member Author

Policy change from the maintainer: the Start9 and Community registries must be removable, but from the CLI only. d3a3278 drops the built-in guard in remove_public (the OS-update registry is still refused), exposes server trusted-keys remove-registry on the CLI (the rest of the tree stays no_cli), drops the invariant comment on BUILTIN_REGISTRIES that no longer holds, and bumps start-cli to 2.8.1. The migration still restores a missing built-in once; db.put.ui still refuses /registries.

helix-white added a commit that referenced this pull request Nov 10, 2026
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white
helix-white dismissed their stale review November 10, 2026 18:04

The policy and CLI exposure changed materially after this approval: built-in registries are now removable through a new CLI command rather than permanently connected. The approval brief must change to describe permitted removal and the retained OS-update-source restriction.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revised policy and CLI registration look consistent: only remove-registry is exposed under server trusted-keys, it reuses the existing remote removal handler, and the selected OS-update registry remains protected. The earlier migration fixes remain intact. The current head merges cleanly with origin/master.

Requesting changes for two incomplete parts of the new CLI surface:

  • P2 — Commit the CLI man-page updates. The new parent and removal command have no committed pages, and start-cli-server.1 does not list trusted-keys. As the description acknowledges, this leaves the required Generated Artifacts check with known drift. This is missing generated source, not a reason to wait for CI before reviewing.
  • P2 — Correct the user-facing removal contract. projects/start-os/docs/src/marketplace.md still says the Start9 and Community registries cannot be removed. That directly contradicts the new CLI behavior. Document the CLI-only route and the retained OS-update-source restriction in the same change, and record the web-client obligation at the removal API now that the permanent-connection invariant has been dropped.

Proposed changes: d3a3278...proposal/4673

The proposal updates the Marketplace guide and CLI reference, records the caller obligation, and drafts the two missing man pages plus their parent entry. I wrote those proposed pages from the surrounding format without running the generator; the author must regenerate and verify the authoritative output before adopting them. No builds, tests, formatting, or generators were run during review. Current-head CI remains pending.

The previous approval described permanently connected registries and is superseded by this materially different policy and CLI exposure.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes remains the verdict. The re-request still targets d3a327813, unchanged since my previous review, so neither outstanding finding is addressed:

  • The new CLI parent and removal command still lack committed man pages and the parent listing update.
  • The Marketplace guide still says the Start9 and Community registries cannot be removed. It needs the CLI-only removal contract, with the web-client obligation recorded at the API owner.

The existing proposal still applies without changes: d3a3278...proposal/4673

Its man pages are drafts; the author must regenerate and verify the authoritative output. Mergeability was rechecked and remains clean. No builds or tests run during review; CI is still pending, but the verdict does not depend on waiting for it.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

The Start9 and Community registries stay out of the web interface's
Remove action, but remove_public no longer refuses them; it still refuses
whichever registry provides StartOS updates. A CLI command for it follows
in the registries namespace change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MattDHill
MattDHill force-pushed the fix/seed-default-registries branch from d3a3278 to a1421cd Compare November 10, 2026 18:30
@MattDHill MattDHill changed the title fix(start-os): restore the Start9 and Community registries; remove them from the CLI only fix(start-os): restore the Start9 and Community registries on servers updated from 0.3.5 Nov 10, 2026
@MattDHill

Copy link
Copy Markdown
Member Author

Scope split: the CLI work moves to a separate PR, which will give connected registries a server registries namespace, put trusted-keys on the CLI and remove server update-signers. That PR has been approved by the maintainer. a1421cd drops the interim server trusted-keys remove-registry exposure and the start-cli bump; this PR keeps the restore migration, the db.put.ui guard, and remove_public accepting the built-ins (OS-update registry still refused). Type-checked locally with cargo check -p start-core --tests --features=test.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at a1421cd3c. Moving the CLI work out resolves the outstanding man-page and CLI-documentation findings: this head introduces no CLI command, start-cli version change, or permanent-connection restriction. It merges cleanly with origin/master.

The 0.4.2.1 migration restores either missing Start9 or Community registry. This repairs the empty Marketplace left when the historical migration read knownHosts instead of the legacy known-hosts. It reuses the existing URL-identity comparison, preserving equivalent URL spellings, saved names, custom entries, and unrelated UI state. Missing or null registry lists are initialized; non-object lists and absent UI data remain unchanged. Signer-trust selections and the OS-update source are not changed.

Revision 1 uses the existing migration-replay mechanism to repair servers already running 0.4.2.1 alpha. This also restores a built-in deliberately removed before the repair; after the revision is recorded, ordinary restarts do not enforce its presence. The existing removal handler remains unchanged from master, including its protection of the selected OS-update registry. A user-facing CLI removal command belongs to the separate namespace change, not this PR.

The additional API restriction rejects db.put.ui writes to the entire UI object or anywhere under /registries, preventing generic UI writes from bypassing the registry handlers. Other UI keys remain writable. Its error is translated into all five locales.

Implementation diff: +55 / −1 lines in 5 files (excludes lockfiles, tests, docs, release notes, and changelog).

Verification: the author reports cargo check -p start-core --tests --features=test passed with no new warnings. The regressions cover legacy recovery, partial lists, migration revision recording and same-version replay, unrelated-state preservation, removal policy, and UI-pointer guards. I reviewed code only and ran no builds or tests. Current-head CI is pending, including the Automated Tests workflow and product builds; runtime tests and an end-to-end upgrade are not yet established by the recorded evidence.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approved at the unchanged head a1421cd3c. Mergeability was rechecked against the current origin/master and remains clean. Moving the CLI work out resolves the outstanding man-page and CLI-documentation findings: this head introduces no CLI command, start-cli version change, or permanent-connection restriction.

The 0.4.2.1 migration restores either missing Start9 or Community registry. This repairs the empty Marketplace left when the historical migration read knownHosts instead of the legacy known-hosts. It reuses the existing URL-identity comparison, preserving equivalent URL spellings, saved names, custom entries, and unrelated UI state. Missing or null registry lists are initialized; non-object lists and absent UI data remain unchanged. Signer-trust selections and the OS-update source are not changed.

Revision 1 uses the existing migration-replay mechanism to repair servers already running 0.4.2.1 alpha. This also restores a built-in deliberately removed before the repair; after the revision is recorded, ordinary restarts do not enforce its presence. The existing removal handler remains unchanged from master, including its protection of the selected OS-update registry. A user-facing CLI removal command belongs to the separate namespace change, not this PR.

The additional API restriction rejects db.put.ui writes to the entire UI object or anywhere under /registries, preventing generic UI writes from bypassing the registry handlers. Other UI keys remain writable. Its error is translated into all five locales.

Implementation diff: +55 / −1 lines in 5 files (excludes lockfiles, tests, docs, release notes, and changelog).

Verification: the author reports cargo check -p start-core --tests --features=test passed with no new warnings. The regressions cover legacy recovery, partial lists, migration revision recording and same-version replay, unrelated-state preservation, removal policy, and UI-pointer guards. I reviewed code only and ran no builds or tests. Prettier and Conflict Markers have passed. Run Automated Tests, Formatting & Lockfiles, Generated Artifacts, Dependency Licenses, and product builds remain pending; runtime tests and an end-to-end upgrade are not yet established by the recorded evidence.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@MattDHill

Copy link
Copy Markdown
Member Author

#4674 has been retargeted to master so its CI can run. It still contains this PR's commits, so merge this one first. #4674 will be rebased onto the squash afterwards.

@helix-white

Copy link
Copy Markdown
Member

Acknowledged: #4673 must land before #4674, then #4674 can be rebased onto the squash. My approval of the unchanged head stands; this coordination update does not require another review.

CI is not fully green: Automated Tests, formatting, generated artifacts, and the other builds passed, but the riscv64-nonfree image job failed fetching rpcbind from deb.debian.org with “Connection reset by peer.” That external download failure remains the CI blocker; the failed job needs a targeted retry before merge. Log: https://github.com/Start9Labs/start-technologies/actions/runs/42875868105/job/130063039443

@dr-bonez
dr-bonez merged commit 24312ac into master Nov 11, 2026
49 of 51 checks passed
@dr-bonez
dr-bonez deleted the fix/seed-default-registries branch November 11, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Marketplace has no registries after updating from 0.3.5 — 0.4 migration reads knownHosts, 0.3.5 stored known-hosts (v0_4_0_alpha_1.rs:42)

3 participants