Skip to content

fix: provision managed bootstrap runtime - #82

Merged
CruxExperts merged 23 commits into
mainfrom
fix/managed-bootstrap-runtime-sync
Jul 30, 2026
Merged

fix: provision managed bootstrap runtime#82
CruxExperts merged 23 commits into
mainfrom
fix/managed-bootstrap-runtime-sync

Conversation

@CruxExperts

@CruxExperts CruxExperts commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Problem

A managed non-interactive release bootstrap can refresh the managed source before the bare system Python invokes the CLI. On hosts without Localsetup's mandatory Python modules, that invocation fails before package materialization with a dependency-ledger validation error.

Change

  • Automatically synchronize the locked production environment only for managed, non-interactive sources bootstrapped by the release flow and containing pyproject.toml and uv.lock.
  • Preserve explicit checkout behavior: --sync-env remains opt-in.
  • Preserve the uv-bootstrap safety gate: an absent uv fails with an actionable --install-uv remediation; the default path neither downloads nor executes uv.
  • Document the managed-bootstrap behavior.
  • Add deterministic installer coverage for synchronization-before-uv run, explicit-source no-implicit-sync, and absent-uv no-network behavior.

Validation

  • UV_CACHE_DIR="$PWD/.localsetup-maint/state/uv-cache" uv run --locked pytest ls/tests/test_install_flow_root_installer_bootstrap_a.py -q — 9 passed
  • bash -n install
  • git diff --check
  • Generated documentation artifacts are current.

Review limitation

Native research-subagent spawning was unavailable because this OMP session has task recursion depth 0; no research subagent executed. The controller performed bounded inspection of installer/dependency paths and tests. A stateless review-only completion found no concrete remaining regression, test, security, or reliability finding; it is not a subagent review.

@github-actions github-actions Bot added area/docs Affected repository area area/installer Affected repository area area/release Affected repository area security Security-sensitive report status/needs-triage Triage status type/pr Issue or PR type labels Jul 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 55afd1bcfb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread install Outdated
Comment on lines +817 to +819
if ! "$EXPLICIT_SOURCE_DIR" && "$NON_INTERACTIVE" && ! "$SYNC_ENV" \
&& [[ -f "$SOURCE_DIR/pyproject.toml" && -f "$SOURCE_DIR/uv.lock" ]]; then
SYNC_ENV=true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve no-uv bootstrap fallback

For managed --non-interactive --yes bootstraps on a host without uv, this new block makes SYNC_ENV=true whenever the release source has pyproject.toml and uv.lock, but UV_BOOTSTRAP_POLICY is still never unless the user also passed --install-uv. The script therefore exits in ensure_uv_for_sync with uv is required... before reaching the CLI, turning the documented raw automation path into an implicit uv prerequisite; either opt into uv bootstrap for this path or keep the no-uv fallback/require --install-uv in that command.

Useful? React with 👍 / 👎.

Comment thread README.md Outdated
</p>

**Version:** 4.3.2<br>
**Version:** 4.3.3<br>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep generated facts in sync

This version bump leaves README.md showing 4.3.3 at the top while the generated facts block and ls/docs/_generated/facts.json still report 4.3.2, so the public docs now present two current versions and the generated-doc provenance is stale. Regenerate the docs artifacts/facts or include the generated receipt with the bump.

AGENTS.md reference: AGENTS.md:L101-L101

Useful? React with 👍 / 👎.

Comment thread install
# uv metadata retain the existing dependency-free path.
if ! "$EXPLICIT_SOURCE_DIR" && "$NON_INTERACTIVE" && ! "$SYNC_ENV" \
&& [[ -f "$SOURCE_DIR/pyproject.toml" && -f "$SOURCE_DIR/uv.lock" ]]; then
SYNC_ENV=true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep automation stdout machine-readable

When a first managed --non-interactive --yes bootstrap has uv available and the environment needs to be created or updated, setting SYNC_ENV=true here makes sync_uv_environment run before the CLI; that helper captures uv's normal progress output and reprints it to stdout on success, so automation receives human text before the expected JSON. Route the implicit sync output to stderr or suppress it so the documented machine-readable stdout contract remains valid.

Useful? React with 👍 / 👎.

Comment thread install Outdated
Comment on lines +817 to +819
if ! "$EXPLICIT_SOURCE_DIR" && "$NON_INTERACTIVE" && ! "$SYNC_ENV" \
&& [[ -f "$SOURCE_DIR/pyproject.toml" && -f "$SOURCE_DIR/uv.lock" ]]; then
SYNC_ENV=true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid auto-syncing local checkout defaults

When ./install --non-interactive --yes is run from a cloned checkout without an explicit --directory, ensure_bootstrap_source returns on the default SOURCE_DIR=. but EXPLICIT_SOURCE_DIR is still false, so this condition also forces uv sync for local source installs. That makes dependency sync non-opt-in for a supported checkout path even though the change is intended for managed release bootstraps; gate this on BOOTSTRAPPED_SOURCE (or otherwise distinguish the default checkout case).

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45cd9c1144

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ls/docs/_generated/facts.json Outdated
"framework_version": "4.3.3",
"schema_version": 1,
"source_commit": "4b13df4809569858c6e723aae395fdcbfa328c75",
"source_commit": "55afd1bcfb912c6582292ecc124fcd52087aab7a",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep generated provenance tied to this history

Fresh evidence after the version fields were updated is that the generated artifacts now record source_commit as 55afd1bcfb912c6582292ecc124fcd52087aab7a, but that commit is not an ancestor of the reviewed 5f2d2d44 commit, so a clone containing this single change cannot reproduce or verify the generated docs from the recorded source state. Keep the version/generated-doc refresh in the normal generated sync commit, or regenerate after preserving a reachable source parent, so the provenance points at history that will ship with the PR.

AGENTS.md reference: AGENTS.md:L99-L101

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00b050be88

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ls/docs/_generated/facts.json Outdated
"framework_version": "4.3.3",
"schema_version": 1,
"source_commit": "4b13df4809569858c6e723aae395fdcbfa328c75",
"source_commit": "33cd17937bb626378f180f79a16fa42b4224035e",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep generated provenance on reviewed history

Fresh evidence in this revision is that facts.json now records source_commit as 33cd17937bb626378f180f79a16fa42b4224035e, but that commit is not an ancestor of the reviewed 3120179368ae1c6ab967b40da5d9b40609571bab commit, so a checkout containing this change cannot reproduce or verify the generated docs from the recorded source state. Keep the version/generated-doc refresh in the normal release-sync/generated-doc sequence, or regenerate after squashing so the recorded source commit is reachable in the PR history.

AGENTS.md reference: AGENTS.md:L101-L101

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a44675a6dc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread install
Comment on lines +819 to +821
if "$BOOTSTRAPPED_SOURCE" && "$NON_INTERACTIVE" && ! "$SYNC_ENV" \
&& [[ -f "$SOURCE_DIR/pyproject.toml" && -f "$SOURCE_DIR/uv.lock" ]]; then
SYNC_ENV=true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep implicit sync from dirtying managed checkouts

When a raw managed --non-interactive --yes bootstrap has uv available and the release source includes pyproject.toml/uv.lock, this new branch runs uv --project "$SOURCE_DIR" sync --locked --no-dev; uv sync --help describes that as updating the project's environment, and Localsetup's dependency code expects that project env at repo_root/.venv. Because .venv is not ignored by this repo (git check-ignore .venv reports not ignored), the first bootstrap leaves the managed source checkout with untracked files, so the next bootstrap reaches refresh_bootstrap_source -> inspect_managed_bootstrap_source and aborts on git status --porcelain --untracked-files=all before it can fetch a newer release. Put the implicit environment in an ignored Localsetup-owned path or ignore .venv before enabling this sync.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad1144536f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if subject.startswith(VERSION_SYNC_SUBJECT_PREFIX):
return git_text(repo_root, ["rev-parse", "HEAD^"])
parent = git_text(repo_root, ["rev-parse", "HEAD^"])
return generated_docs_source_ref(repo_root, parent) or parent

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize merge release-sync parents recursively

When CI regenerates docs on a merge commit whose second parent is a release-sync commit and that release-sync parent itself follows a docs: refresh generated artifacts commit, this new recursion only fixes the direct-HEAD release-sync case. The merge branch still returns HEAD^2^, so provenance records the generated-docs commit as source_commit instead of the original source commit/tree; apply the same generated_docs_source_ref(...) or parent normalization to the merge release-sync parent path too.

Useful? React with 👍 / 👎.

Comment thread .gitignore
.localsetup/
localsetup.lock.json
.codex/skills
.agents/state/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Block staged .agents/state paths in pre-commit

With .agents/state/ now the private state root, force-staged files there are still not rejected because .githooks/pre-commit only matches the older private paths such as .codex/runs/* and .localsetup-maint/*. In the scenario where an agent or user accidentally runs git add -f .agents/state/..., private ledgers, caches, or run evidence can be committed despite the repo's hook contract; add .agents/state/* to the hook blocklist.

AGENTS.md reference: AGENTS.md:L135-L139

Useful? React with 👍 / 👎.

Comment thread ls/core/docs_alignment/constants.py Outdated
LOCAL_DOC_EXCLUDES = {
".git",
".cache",
".agents",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not hide repo-owned .agents skills from docs alignment

Excluding the entire .agents component means _markdown_files() now drops tracked adapter content such as .agents/skills/custom/SKILL.md before it can be classified as a skill. In repos that intentionally keep custom skills under the shared .agents/skills adapter, docs-alignment inventories and generated audit surfaces silently omit those repo-owned files; narrow this exclusion to .agents/state so only the new private ledger root is skipped.

AGENTS.md reference: AGENTS.md:L109-L111

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67e6b1f0ff

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"source_dirty": false,
"source_provenance_hash": "46851918572cedc423d1e07d16323b3a00d9003d1717cecdbfadd309c4eb225f",
"source_root_id": "1ec606400e7e094b4fc26def99af4021f85c43dc713dd72c7cd03de15ff04634",
"source_commit": "d17cc96b93dbe17cb2016d67f307e29b1df3bdee",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep generated provenance on reviewed history

Fresh evidence in this commit is that the regenerated facts now record source_commit as d17cc96b93dbe17cb2016d67f307e29b1df3bdee, but git merge-base --is-ancestor d17cc96b93dbe17cb2016d67f307e29b1df3bdee 21d9e1f05e45fca2f066e7ba68c0e076433350be fails, so a checkout containing this PR cannot reproduce or verify the generated docs from the recorded source state. Regenerate the generated/version artifacts after preserving a reachable source parent for this branch so the publish-surface provenance points at history that ships with the PR.

AGENTS.md reference: AGENTS.md:L83-L83

Useful? React with 👍 / 👎.


## Location and identity

Create every new controller ledger at `.agents/state/<task-slug>/ledger.md`. The controller assigns `<task-slug>` once for the Git-bound objective as `<YYYYMMDD-HHMMSS>-<git-short-sha>-<objective-slug>` and every participating agent and tool reuses that exact directory. Task-local evidence, reviews, handoffs, and transient state may live beside `ledger.md`; no agent- or client-specific run root is created.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Align ledger path with the state allocator

This new location says controller ledgers live in .agents/state/<task-slug>/ledger.md, but the preceding allocation contract still resolves through the client-state registry, and the Codex repo state entry in ls/config/clients.yaml remains .codex/state. In Codex/controller workflows that either sends newly allocated ledgers to the historical client-specific root or forces agents to bypass the sidecar/verification contract described here; update the registry/allocator to return .agents/state for this shared ledger root, or remove the allocation-contract claim.

AGENTS.md reference: AGENTS.md:L125-L127

Useful? React with 👍 / 👎.

Comment thread VERSION
@@ -1 +1 @@
4.3.2
4.3.8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep release version on the reviewed patch target

For this review range, the base version is 4.3.2 and the only non-release-sync commit is fix: provision managed bootstrap runtime, so the repository's patch-default release policy would target 4.3.3, not 4.3.8. Shipping the direct version surfaces at 4.3.8 skips five patch versions and will publish/tag the wrong release from this PR; rerun the version sync from the reviewed base history instead of carrying over a version from another line of history.

AGENTS.md reference: AGENTS.md:L83-L83

Useful? React with 👍 / 👎.

@CruxExperts
CruxExperts merged commit e635aa5 into main Jul 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Affected repository area area/installer Affected repository area area/release Affected repository area security Security-sensitive report status/needs-triage Triage status type/pr Issue or PR type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant