Skip to content

Organization apps: Recover db-first installations and report truthful readiness - #326

Merged
immakermatty merged 3 commits into
mainfrom
agent/DEV-6568-organization-app-readiness
Sep 6, 2026
Merged

immakermatty merged 3 commits into
mainfrom
agent/DEV-6568-organization-app-readiness

Conversation

@agentrozjedemeai

@agentrozjedemeai agentrozjedemeai commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

Status: ready for review

A declared Organization application could contain only its canonical db/ checkout while updater status treated the parent as current and Doctor treated the directory as available. This change makes missing managed repositories and missing declared app runtimes block workspace readiness, and lets the existing explicit Organization install operation safely complete the Mission Control app checkout around an already valid database.

The installer retains immutable Forge identity checks and verifies the database’s own Git root, origin, canonical branch and clean HEAD. It stages and verifies the app repository, then publishes app entries using macOS renameatx_np(RENAME_EXCL) through the system JavaScript bridge and pinned directory descriptors, activating .git last. Database path, inode, origin and HEAD are preserved. Unknown content, symlinks, foreign/dirty databases and concurrent changes fail closed. Rollback preserves foreign edits and uncertain recovery stages; successful empty stages are intentionally retained to avoid unsafe pathname cleanup.

Recovery into an existing db-first parent is Darwin-only. Other platforms return an explicit unsupported-recovery blocker; ordinary installation into an absent target retains its existing platform support. No compiler, dependency, service or new data authority is added. Explicit apps: [] data-only declarations remain valid.

Validation on HEAD bd110918adce404874689ec9da0ef3ddacfe2b8f:

  • Initial bun run check passed all gates through lazurio:test (349 pass, 1 skip), then correctly stopped at the resident clean-source guard while the changes were staged. This one-shot command is not claimed as a pass.
  • bun run --cwd launchpad check: 1,140 pass, 16 skip, zero failures. bun run doctor:agent-skills: pass.
  • After the two safety review corrections, materialization/Organization integration regressions: 42 pass. Final Core regressions after recovery-message changes: 18 pass, including native exclusive rename and concurrent-write cases.
  • Clean committed bun run resident:test: 143 pass, 1 skip, zero failures. bun run pr:preflight: pass against current origin/main.
  • Independent gpt-5.5 safety review raised two actionable findings; both were fixed with direct regressions. Follow-up gpt-5.5 high review is clean.

Fixture coverage includes db-first success and idempotence, dirty/foreign/branch/unknown/symlink/tracked-db rejection, failures before every publication step, actual native no-overwrite behavior, target/staging path swaps, concurrent foreign edits and Doctor/updater regressions. Read-only review Doctor and updater status against the actual primary root both identify its missing Mission Control app checkout; Doctor also identifies the undeclared Design System runtime.

Canonical installation remains gated on publication of Organization identity PR112. The Design System runtime lives in Design System PR2, and its Organization documentation in Organization PR113. Native launcher PR325 is separate. End-to-end canonical app Start/Open/Stop smoke follows publication and standard install/update, rather than applying an unmerged workaround to the primary checkout.

Mission Control: HumanAndMachine-ai/mission-control-data:v3, data/mission-control/plans/2026/09/DEV-6568-organization-app-readiness.yaml; active task task-2026-09-06-017 in TODO.tasks.json. Completion and post-publication runtime evidence remain with that canonical plan; this PR does not publish its data or merge source changes.

Distinguish a declared managed Git checkout from a directory-only mount, and block readiness when its expected application runtime is missing or invalid. Keep explicit data-only modules valid and preserve existing access authority.
Complete db-first Mission Control installations through verified staging and exclusive descriptor-based publication, activating Git last. Preserve existing database identity and concurrent work through failure and rollback; fail closed on unsupported recovery platforms.

Add native race, quarantine and integration regressions, and document the bounded recovery contract. Independent safety review findings were fixed and the follow-up review is clean.
@agentrozjedemeai

Copy link
Copy Markdown
Collaborator Author

Explicit review and publication handoff to @immakermatty. Ready candidate head: bd11091. Independent follow-up review is clean after both accepted rollback findings were fixed; focused materialization and clean resident checks pass. The PR body records the staged root-check provenance, full Launchpad evidence and Darwin-only recovery boundary. Please review and publish this change before the final canonical Organization install. Organization identity PR HumanAndMachine-ai/HumanAndMachine-ai_GEN3#112 is another prerequisite; Design System runtime HumanAndMachine-ai/design-system#2 and its Organization documentation PR HumanAndMachine-ai/HumanAndMachine-ai_GEN3#113 should be published together. Native launcher PR #325 is independent and all its provider checks passed. After publication, standard update/install and actual Launchpad Start/Open/Stop smoke remain required. This agent has not merged source changes or published private Personalspace data.

@greptile-apps

greptile-apps Bot commented Sep 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds truthful readiness reporting for missing managed checkouts and declared application runtimes, plus a Darwin-only recovery path that installs Mission Control app code around an existing validated database checkout.

  • Blocks updater and Doctor readiness when a managed directory lacks its own Git repository.
  • Blocks missing or invalid declared application runtimes while preserving explicit data-only declarations.
  • Adds descriptor-pinned, no-overwrite repository-container publication with conservative rollback.
  • Validates database identity, origin, branch, cleanliness, and inode preservation throughout recovery.
  • Adds focused recovery, concurrency, rollback, and readiness tests, although the Darwin-only tests are not currently exercised by CI.

Confidence Score: 4/5

The implementation appears safe to merge from a correctness perspective, with the non-blocking caveat that its Darwin-only recovery behavior lacks execution in CI.

The changed recovery and readiness paths are fail-closed and preserve database identity and concurrent content, but all substantive tests of the native macOS publisher are skipped by the jobs that run the project test suite.

Files Needing Attention: package.json and the macOS test coverage for lazurio/core/repository-container-publisher-lib.mjs and lazurio/organization-install-lib.mjs

Important Files Changed

Filename Overview
lazurio/core/repository-container-publisher-lib.mjs Adds Darwin-exclusive descriptor-pinned publication, snapshot validation, and conservative rollback around an existing database container.
lazurio/core/git-materialization-lib.mjs Extends checkout materialization with repository-db-parent inspection, publication, and retained recovery staging.
lazurio/organization-install-lib.mjs Detects eligible db-first installations, validates the canonical database, and recovers the Mission Control parent checkout.
lazurio/runtime/diagnostics-lib.mjs Makes missing managed Git roots and unavailable declared application runtimes block Organization readiness.
lazurio/runtime/lazurio-update-lib.mjs Reports managed directory-only checkouts as blocked instead of current.
package.json Registers the native publisher suite, but the Darwin-only behavioral tests remain unexecuted by repository CI.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Explicit Organization install] --> B[Run managed repository convergence]
  B --> C{Db-first Mission Control parent detected?}
  C -- No --> D[Continue ordinary installation]
  C -- Yes --> E{Darwin platform?}
  E -- No --> F[Return unsupported-recovery blocker]
  E -- Yes --> G[Validate parent layout and canonical db checkout]
  G --> H[Clone app repository into staging]
  H --> I[Verify app identity and db ignore policy]
  I --> J[Publish app entries with exclusive descriptor-relative renames]
  J --> K[Activate .git last]
  K --> L[Revalidate db path, inode, origin, branch, and HEAD]
  J -- Failure --> M[Rollback owned entries and retain uncertain stage]
  L --> N[Re-run convergence and report readiness]
Loading

Reviews (1): Last reviewed commit: "Organization install: Preserve canonical..." | Re-trigger Greptile

Comment thread package.json Resolved

@immakermatty immakermatty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Admin review (immakermatty): souladné se směrem Lazuria — fail-closed recovery db-first parentu, žádná nová data authority, non-Darwin vrací explicitní blocker. Lokálně na macOS ověřeno 42 + 132 testů pass.

@immakermatty
immakermatty merged commit 3c1881b into main Sep 6, 2026
6 checks passed
@immakermatty
immakermatty deleted the agent/DEV-6568-organization-app-readiness branch September 6, 2026 19:25
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