Skip to content

fix: add local-state-first install preflight - #48

Merged
HaodiFan merged 24 commits into
mainfrom
codex/bug/20260731-infra-install-preflight
Aug 4, 2026
Merged

fix: add local-state-first install preflight#48
HaodiFan merged 24 commits into
mainfrom
codex/bug/20260731-infra-install-preflight

Conversation

@HaodiFan

@HaodiFan HaodiFan commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR prevents fresh-install behavior from running before EvoZeus knows the local state and environment readiness.

It adds a two-stage, read-only Stable preflight; a six-state local decision model; a strict fresh-only installer contract; and release assets for the standalone verified checker. This matters now because the public install journey can otherwise repeat downloads, approval requests, registration, or writes against an existing or unsafe target.

The intended outcome is one deterministic result before product download or ~/.evozeus writes: a healthy no-op, a state-specific update/repair/migration route, a blocked result with remediation, or a fresh-install approval request.

Public Web /skill synchronization, publishing the next Stable release, Codex/Claude fresh and healthy-no-op UAT, merge, and release are intentionally out of scope for this PR. Reviewers should focus on zero-product-download guarantees, local-state trust, report binding, and fresh-install idempotency.

Linked Context

Addresses #41

Addresses #42

Depends on #46. Requested by issues #41/#42 and follow-up maintainer security review.

PR Scope

  • Case
  • Candidate / Artifact
  • Factor
  • Pattern
  • Report template
  • Privacy / security
  • Docs / README
  • Governance / template / script
  • Runtime / CLI / tooling
  • Other: Release asset and CI smoke integration

Primary layer:

  • Semantic Layer
  • Execution Layer
  • Governance Layer

Primary artifact kind: Install preflight and local-state routing contract.

One thing this PR does: gates the Stable bootstrap installer behind a verified, target-bound, fresh-only preflight result.

What this PR does not do: update the separate EvoZeus Web /skill, publish Stable, validate both hosts end-to-end, merge, or release.

EvoZeus Evidence Proof

  • Behavior, Case, or issue addressed: dependency failures surfaced too late and install entrypoints could enter a fresh-install path before classifying an existing installation.
  • Real environment or session tested: macOS with real GitHub Stable HEAD, real local filesystem permissions and disk checks, plus isolated unsafe-path and state-transition fixtures.
  • Exact steps or command run after this patch: npm test; npm run test:python; npm run test:preflight; real POSIX pre-fetch and full-checker Stable smoke; claude plugin validate .; syntax checks; PR readiness; git diff --check.
  • Evidence after change: pre-fetch 24 tests, CLI 33 tests, installer 16 tests, channel 47 tests, Session Signal 97 tests, Runtime 94 tests, and all remaining product suites passed locally.
  • Observed result after change: real macOS pre-fetch and full checker returned ready with one payload-free HEAD, zero product downloads, zero target writes, and not_installed; healthy-current fixtures remained strict no-ops even when install dependencies were unavailable. A real Stable regression now deletes skills/using-evozeus/SKILL.md, observes repair_required, proves a zero-write repair plan, applies the same verified manifest into a new root, preserves rollback, and returns Doctor to ready. A real launcher regression proves complete product/link/dispatcher/bootstrap/Plugin restoration after a cross-version registration failure. The same-version repair regression now refuses to reactivate its damaged predecessor, keeps the verified repaired root active, and reports failed_recovery_required while Plugin alignment remains incomplete. A pre-switch isolated-repair failure now preserves the damaged-state truth and reports recovery required. Recognized v1 channel state now produces a zero-write migration plan and an approved v2 migration transaction without treating legacy bytes as verified rollback. Rollback smoke also disables Python bytecode writes, and a full historical-root inventory/mtime assertion proves validation leaves the candidate root unchanged.
  • What was not tested: standalone checker assets do not exist until the next Stable release; Web /skill code is synchronized in PR [codex] Add workspace product feature router #16, while deployed-preview and Codex/Claude fresh/no-op UAT remain pending.
  • Proof limitations or constraints: issues [P1][Install] 在下载和写入前执行显式依赖与环境预检 #41/[P1][Install] 安装入口必须先识别本机已有安装并选择幂等路径 #42 stay open until Web PR [codex] Add workspace product feature router #16 is synchronized, the next Stable assets are published, and both hosts complete fresh and healthy-current proof.
  • Before evidence, if useful: the prior flow resolved/downloaded Stable material before a mandatory local-state Step 0, and the generic installer could plan reconciliation.

Verdict / Review Gate

Proposed verdict, if this PR adds or changes a Case or Candidate:

  • Preserve
  • Promote to Skill
  • Extract Factor
  • Keep as Habit
  • Fix Environment
  • Reject Pattern
  • Open Case
  • Not applicable

Review gates checked:

  • Ontology Gate
  • Evidence Gate
  • Privacy Gate
  • Value Gate
  • Operational Gate
  • Negative Gate
  • Scope Gate

Tests and Validation

Commands run:

  • npm test
  • npm run test:python
  • npm run test:preflight
  • real macOS pre-fetch and full-checker Stable HEAD smoke
  • node --check for changed JavaScript entrypoints
  • /bin/sh -n scripts/evozeus-install-prefetch.sh
  • python3 -m py_compile scripts/evozeus-coevolve-dispatcher.py scripts/check_pr_ready.py
  • claude plugin validate .
  • python3 scripts/check_pr_ready.py --base origin/main --allow-cross-layer
  • git diff --check

The checks now cover exact Node/Python thresholds, missing tools, network failure, zero-GET blocked paths, six local states, channel/version mismatch, healthy no-op, checker download accounting, target and release-tag binding, stale reports, TOCTOU, strict-empty targets, same-version Stable/UAT repair, target-Core shim derivation, transactional cross-channel bootstrap-and-shim switching, legacy rollback compatibility, malformed control/manifest evidence, current-link mismatch, unsafe transaction roots, symlinks, external current/previous roots, rollback-candidate required paths, embedded components, compatibility and fixed smoke, existing-empty target permissions, and dry-run fresh-only behavior.

No test or script was skipped locally. All local gates pass on f7368c4 after integrating the current #46 base; the hosted matrix and final automatic re-review are pending on that head.

Risk Checklist

Did user-visible behavior change? (Yes)

Did SKILL.md, public instructions, or agent behavior change? (Yes)

Did privacy, security, network, auth, or tool permission behavior change? (Yes)

Did schema, storage, branch, PR, or governance behavior change? (Yes)

Highest-risk area: trusting local install evidence while allowing approved fresh, repair, or update writes.

How is that risk mitigated? Stable-only fail-closed routing, verified manifest/path evidence, strict schema and target binding, pre-manifest transaction-root checks, isolated repair roots, Plugin marketplace path gates, atomic state/link/dispatcher/bootstrap/Plugin recovery, a one-hour report window, exact Release tag binding, an immediate state recheck, strict-empty target policy, zero product downloads during preflight, and regression tests.

AI-Assisted Work

Was this PR written or materially changed by an AI coding agent? (Yes)

If yes, which agent/tool and what did it do? OpenAI Codex implemented the scoped code, tests, documentation, validation, and PR preparation under maintainer review.

Confirm the author understands the changed behavior:

  • Yes
  • Not applicable

Current Review State

Next action: complete hosted CI and exact-head automatic review on f7368c4; keep the synchronized public Web /skill gate pinned to its byte-identical Core source commit f7368c4.

Still waiting on author, maintainer, CI, or external proof: next Stable publication, and Codex/Claude fresh plus healthy-no-op UAT. Web #16 is synchronized to Core f7368c4 at Web head f02e388.

Reviewer or bot comments addressed: all maintainer findings on Stable-only routing, activity/launcher bypass, dependency thresholds, state trust, tag binding, TOCTOU, strict-empty targets, unsafe paths, healthy no-op, and executable same-version repair, cross-version bootstrap rollback, Plugin alignment rollback, honest recovery reporting, and Plugin marketplace path safety, complete rollback-root health validation, existing-target permission checks, recognized v1 migration routing, and pre-switch repair failure truth are covered.

Privacy Checklist

  • No raw private session logs
  • No secrets, tokens, cookies, or credentials
  • No customer data
  • No private local paths
  • Evidence is minimized and redacted

Operational Checklist

  • This PR has one primary purpose
  • This PR does not mix unrelated refactor, runtime, docs, and community Case work
  • Links are relative or public
  • python3 scripts/check_pr_ready.py passes
  • git diff --check passes

Exact-head update (2026-08-02)

  • Exact head: f7368c4.
  • Legacy recovery: a recognized install with state markers but a missing primary CLI shim may acquire the verified checker for state classification; arbitrary existing homes and unsafe/dangling shim paths still fail closed.
  • Review audit: unsafe-stop and legacy missing-shim threads are resolved; Hosted CI is running on this exact head.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evozeus-metainflow Ready Ready Preview Aug 4, 2026 6:04am

@github-actions github-actions Bot added the proof:needed Real behavior proof is missing or incomplete label Jul 31, 2026
@github-actions

Copy link
Copy Markdown

EvoZeus Proof Gate

Mode: dry-run

Proof labels

  • proof:needed

Missing or weak fields

  • missing code/workflow section: Problem
  • missing code/workflow section: Scope
  • missing code/workflow section: Real behavior proof
  • missing code/workflow section: Tests
  • missing code/workflow section: Rollback plan
  • missing code/workflow section: Problem
  • missing code/workflow section: Scope
  • missing code/workflow section: Real behavior proof
  • missing code/workflow section: Tests
  • missing code/workflow section: Rollback plan
  • missing skill instruction section: Instruction surface changed
  • missing skill instruction section: Agent behavior before / after
  • missing skill instruction section: Safety boundary
  • missing skill instruction section: Prompt injection risk
  • missing skill instruction section: Rollback plan
  • missing schema section: Schema changed
  • missing schema section: Breaking or non-breaking
  • missing schema section: Migration needed?
  • missing schema section: Validator updated?
  • missing schema section: Examples updated?

Next action

  • Add real behavior proof, not only mocks/lint/CI.

@github-actions github-actions Bot added the triage:too-many-prs Author or branch family exceeds queue limits label Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

EvoZeus Queue Guard

Mode: dry-run

Author open PRs: 5

Branch family: codex/bug/20260731-infra-install-preflight

Branch family open PRs: 1

Violations

  • author has 5 open PRs; limit 3

Next action

  • Reduce open PR queue or ask maintainers to override.

@github-actions github-actions Bot added triage:dirty-pr PR mixes too many surfaces or should be split triage:owner-only Owner review required triage:rfc-needed RFC required before review labels Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

EvoZeus Auto Response

Redaction required

The PR appears to include sensitive evidence or private context. Redact secrets, raw logs, customer data, private paths, internal URLs, and unreleased business context before review.


Missing real behavior proof

This PR needs real behavior proof before review can continue. Add the command, environment, input, output after the patch, observed result, and what was not tested.


Split this PR

This PR appears to mix too many surfaces or protected paths. Split it into one primary layer and one review target.


Owner review required

This PR changes a protected path. CODEOWNERS review and maintainer approval are required; do not request automerge.


RFC required

Governance, workflow, branch protection, or architecture changes need linked RFC or maintainer discussion before normal PR review.


Queue limit reached

This author or branch family appears to exceed the current queue limit. Reduce open PRs or ask a maintainer to override before continuing review.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

EvoZeus Dirty PR Check

Mode: dry-run

Surfaces

  • code
  • dependency
  • docs
  • schema
  • skill
  • workflow

Reasons

  • changes 6 surfaces: code, dependency, docs, schema, skill, workflow
  • large PR: 26 files, 6339 changed lines
  • protected path changed
  • governance/workflow change has no RFC or maintainer discussion marker

Next action

  • Split the PR, add RFC context, or wait for owner review.

@github-actions github-actions Bot added candidate:needs-redaction Candidate needs redaction before review risk:privacy May expose private or sensitive evidence labels Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

EvoZeus Privacy Scan

Mode: dry-run

Findings

  • .github/workflows/ci.yml: dotenv content
  • maintainer/skills/evozeus-install-registration/SKILL.md: dotenv content
  • scripts/evozeus-channels.mjs: dotenv content
  • scripts/evozeus-install-prefetch.sh: dotenv content
  • scripts/evozeus-install-preflight.test.mjs: phone-like number

Next action

  • Redact or explain these findings before maintainer review.

@github-actions github-actions Bot added risk:agent-behavior May change future agent behavior risk:dependency Adds or changes dependencies risk:github-token May affect GitHub token permissions risk:schema-break May break schema compatibility risk:skill-entry Touches SKILL.md or scenario skills risk:workflow Touches GitHub Actions or automation size:L Large PR type:code Runtime, CLI, script, or behavior change type:dependency Dependency or package metadata change type:docs Documentation or example change type:schema Schema, protocol, ontology, or compatibility change type:skill-instruction Agent-facing instruction or skill change type:workflow GitHub workflow or automation change labels Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

EvoZeus Labeler Report

PR type/risk labels were updated from changed files.

Surfaces

  • code
  • dependency
  • docs
  • schema
  • skill
  • workflow

Labels

  • risk:agent-behavior
  • risk:dependency
  • risk:github-token
  • risk:schema-break
  • risk:skill-entry
  • risk:workflow
  • size:L
  • type:code
  • type:dependency
  • type:docs
  • type:schema
  • type:skill-instruction
  • type:workflow

Changed lines

  • 6339

@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: 8489448bfe

ℹ️ 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/evozeus-install.mjs
@HaodiFan

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact head b64e0ff. Managed recovery dispatch now validates manifest_digest, and channel integrity repairs missing, byte-mismatched, or non-executable primary/recovery shims.

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

ℹ️ 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/evozeus-channels.mjs Outdated
@HaodiFan

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact head 1c4a0d7. Install and channel repair share canonical managed-shim bytes; each shim is independently verified and regenerated without trusting the other file.

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

ℹ️ 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/evozeus-channels.mjs Outdated
Comment thread scripts/evozeus-channels.mjs Outdated
@HaodiFan

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact head faa86f79406ab0653ab36f648181e1ce06658b9f. This head derives managed shim bytes from the verified target Core, restores the complete bootstrap-plus-shim surface after partial reconciliation failure, and isolates candidate smoke from the operator’s live Home. Local gates: full npm test (Channels 45/45 and all product gates), Session Signal 97 passed / 2 skipped / 18 subtests, Runtime 94 passed / 4 skipped, and git diff --check.

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

ℹ️ 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/evozeus-cli.mjs Outdated
Comment thread scripts/evozeus-channels.mjs
@HaodiFan

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact head e6b9502e7ca7040480b9aa867b915c70c53cf008. Channel use and all cross-channel recoveries now transactionally activate the target Core, refresh its bootstrap, and reconcile both target-derived shims; rollback entries whose verified Core predates the generator export use the explicit v1 compatibility path. Regressions cover v1/v2 switches, partial shim-write restoration, and pre-export rollback. Local gates: full npm test with Channels 47/47, Session Signal 97 passed / 2 skipped / 18 subtests, Runtime 94 passed / 4 skipped, and git diff --check.

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

ℹ️ 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/evozeus-launcher.mjs
Comment thread scripts/evozeus-channels.mjs Outdated
@HaodiFan

HaodiFan commented Aug 2, 2026

Copy link
Copy Markdown
Contributor 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: 691f03fad1

ℹ️ 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/evozeus-install-prefetch.sh Outdated
@HaodiFan

HaodiFan commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up commit f7368c4 adds a safe legacy recovery route: if a recognized install marker exists but the primary bin/evozeus shim is absent, the zero-write prefetch gate proceeds to the verified checker so it can classify repair/migration; arbitrary existing state and dangling primary shims remain fail-closed.

Validation: sh -n scripts/evozeus-install-prefetch.sh; node --test scripts/evozeus-install-preflight.test.mjs -> 25 passed.

@HaodiFan
HaodiFan requested review from Neillan96 and removed request for Neillan96 August 4, 2026 05:49
@HaodiFan
HaodiFan changed the base branch from codex/bug/20260731-skill-positioning-demo to main August 4, 2026 06:03
@HaodiFan
HaodiFan merged commit 31b4b29 into main Aug 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

candidate:needs-redaction Candidate needs redaction before review proof:needed Real behavior proof is missing or incomplete risk:agent-behavior May change future agent behavior risk:dependency Adds or changes dependencies risk:github-token May affect GitHub token permissions risk:privacy May expose private or sensitive evidence risk:schema-break May break schema compatibility risk:skill-entry Touches SKILL.md or scenario skills risk:workflow Touches GitHub Actions or automation size:L Large PR triage:dirty-pr PR mixes too many surfaces or should be split triage:owner-only Owner review required triage:rfc-needed RFC required before review triage:too-many-prs Author or branch family exceeds queue limits type:code Runtime, CLI, script, or behavior change type:dependency Dependency or package metadata change type:docs Documentation or example change type:schema Schema, protocol, ontology, or compatibility change type:skill-instruction Agent-facing instruction or skill change type:workflow GitHub workflow or automation change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant