Skip to content

fix: address 8 round-2 Codex findings in remote reconciliation - #56

Merged
Nickfost merged 6 commits into
mainfrom
fix/reconcile-round-2
Jul 28, 2026
Merged

fix: address 8 round-2 Codex findings in remote reconciliation#56
Nickfost merged 6 commits into
mainfrom
fix/reconcile-round-2

Conversation

@Nickfost

Copy link
Copy Markdown
Member

Round-2 fixes for remote configuration reconciliation

Fixes 8 of 9 review findings from the previous PR #54 round-2 Codex review.

Changes

scripts/remote-reconcile.sh — 6 fixes:

  • P1: Pass the already-fetched local checkout rather than OWNER/REPOSITORY to the installer for drift checks and upgrades, so a private desired-state repository is accessible without separate credentials.
  • P1: Fetch the last-known-good commit independently instead of copying from the depth-one HEAD checkout, which may not contain the LKG ref.
  • P1: Acquire a reconcile lock (/run/ci-fleet-reconcile.lock) with flock to serialize against concurrent installer mutations.
  • P2: Run the template repository validator with --strict --tree-paths, matching the installer's own validation chain.
  • P2: Source the rendered controller environment before health checks so controller identity and capacity are read correctly.
  • P2: Source the rendered environment in the new run_health_check wrapper function.

scripts/install-worker-controller.sh — 3 fixes:

  • P2: Include optional units (reconcile service + timer) in checkpoint snapshots so they survive a post-upgrade rollback.
  • P2: Disable optional timers during uninstall before removing their unit files.
  • P2: Only enable the reconcile timer when the configuration is identified by OWNER/REPOSITORY (not a local checkout path), preventing spurious fetch attempts.

Disputed

One P2 finding ("Add reconciliation failures to fleet health monitoring") was disputed with a thumbs-down. The reconcile timer is monitored by systemd like all other fleet timers, and reconciliation state is independently reported via state.json. Adding health.py integration for reconcile failures is a separate enhancement, not part of this scope.

Verification

$ python3 -m unittest scripts.test_remote_reconcile -v
----------------------------------------------------------------------
Ran 14 tests in 1.8s
OK

$ bash -n scripts/remote-reconcile.sh scripts/install-worker-controller.sh
# syntax OK

- P1: pass local pinned checkout to installer for drift check and reconcile
- P1: fetch LKG commit independently (not from depth-one HEAD checkout)
- P1: serialize reconcile with installer mutations via flock
- P2: add optional units to installer checkpoints
- P2: disable optional timers on uninstall
- P2: run template validator with --strict --tree-paths
- P2: source rendered env before health.py calls
- P2: gate reconcile timer on remote repo identity (OWNER/REPO, not local path)
- P2: disputed — reconciliation failures in health.py is a separate concern,
      reconcile already reports state independently via state.json

All 9 findings reacted (8 thumbs-up, 1 thumbs-down per Nick's convention).
@Nickfost

Copy link
Copy Markdown
Member Author

@codex review

@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: e4740f5b8a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/remote-reconcile.sh
Comment thread scripts/install-worker-controller.sh
Comment thread scripts/remote-reconcile.sh Outdated
Comment thread scripts/remote-reconcile.sh Outdated

@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: bbde944da1

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/remote-reconcile.sh Outdated
Comment thread scripts/install-worker-controller.sh
- P1: fix durable repo identity in rendered env too (not just state.json)
- P1: restore optional timer states in restore_systemd_snapshot
- P1: authenticate LKG fetch with reconciliation token
- P1: share installer lock to prevent concurrent mutations
- P1: check controller health before skipping same-commit drift reconcile
- P2: disable reconcile timer on local checkout path
@Nickfost

Copy link
Copy Markdown
Member Author

All 6 findings addressed in commit ad4f041. @codex review

@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: d4387be9b6

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/remote-reconcile.sh
Comment thread scripts/remote-reconcile.sh
Comment thread scripts/remote-reconcile.sh
Comment thread scripts/remote-reconcile.sh
@Nickfost

Copy link
Copy Markdown
Member Author

All 4 findings addressed in commit 1b2cfe4. @codex review

@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: 1b2cfe452f

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/remote-reconcile.sh
Comment thread scripts/remote-reconcile.sh
Comment thread scripts/remote-reconcile.sh
Comment thread scripts/remote-reconcile.sh
Comment thread scripts/remote-reconcile.sh
@Nickfost
Nickfost merged commit 24030d3 into main Jul 28, 2026
1 check passed
@Nickfost
Nickfost deleted the fix/reconcile-round-2 branch July 28, 2026 03:55
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