Skip to content

Phase 2: complete Portable-GHAR source implementation - #15

Merged
sumitake merged 67 commits into
mainfrom
dev/codex/phase2-integration
Aug 1, 2026
Merged

Phase 2: complete Portable-GHAR source implementation#15
sumitake merged 67 commits into
mainfrom
dev/codex/phase2-integration

Conversation

@sumitake

@sumitake sumitake commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

This PR completes the declared Portable-GHAR Phase 2 source implementation. It does not claim that Phase 2 is fully verified, deployed, or activated.

  • Implements the crash-safe controller, acquisition/assignment state machines, fair fleet-capacity broker, bounded history maintenance, health publication, and portable/legacy fleet fencing.
  • Adds held one-job runner construction, immutable seed/runtime locks, capability-separated network adapter/broker/parser/helper/verifier components, JIT lifecycle reconciliation, watchdogs, and QTS/systemd lifecycle surfaces.
  • Adds source, integration, conformance, chaos, boundary, recovery, upgrade, public-safety, and release contracts plus the closed unit/full gate wrapper.
  • Designs out the RhoNAS tmpfs/self-update incident with reclamation-first behavior, bounded history, automatic runner-version candidate observation, rollback-safe image continuity, and explicit sizing/host gates.
  • Adds the approved Grafana/InfluxDB activation evidence contract as documentation only.
  • Makes the standalone product boundary explicit: Portable-GHAR has no source, build, test, release, deployment, runtime, or Phase 2 source-completion dependency on a consumer repository, collaboration broker/plugin/workspace, or named review provider/transport.
  • Keeps consumer cutover canaries optional, capability-based, inventory-selected, and risk-ordered.
  • Keeps exact-artifact distinct-family review as development governance while making its provider and transport replaceable tooling.
  • Aligns the held-runner final audit with the exact closed proxy environment injected at container creation, preserving fail-closed rejection of every missing, extra, duplicate, or altered entry.

No host, deployment, selector, release, tag, runner, or production state was changed.

Exact final source checkpoint

  • signed head: ea9955dbf8bf868c8184e438cfede764adbbfcd6
  • GitHub signature verification: verified=true, reason=valid
  • tree: 7fa59b56d9ab4e16b5bde8ba27001537b0275e34
  • base: cafa5cbaf5123c8e46028b535997f32e45db972e
  • full base-to-head patch: 8,650,567 bytes
  • full base-to-head patch SHA-256: c48549a405c2ea387eefacd5d6167364778ab2ca2bc045aad3d3a62ddcdfbf7c

Verification

  • All exact-head hosted checks passed: both Linux go, container, shell, worker, and repository-metadata jobs; both sanitization jobs; both-language CodeQL jobs plus the CodeQL aggregate; and dependency review.
  • Fresh final-delta verification passed the focused runtime-environment, watchdog, hostruntime, runner-gate, and listener Go tests; watchdog Bats 6/6; markdownlint 43/43; Prettier; docs command/link checks; repository metadata; workflow policy; tracked sanitizer; full-history sanitizer; and git diff --check.
  • The lease-authority, systemd KillMode=process, and exact 3/7/8-entry environment regressions were observed RED before implementation and GREEN afterward.
  • The prior signed source checkpoint through 3a8c41792d902a5f70e427b71ac03d886bb98403 passed the complete 21-stage local unit aggregate, including race, static, Python, and sanitizer stages.
  • Local final-head note: the macOS aggregate passed source-integrity, gofmt, and vet before encountering existing sandbox/file-mode fixture failures outside the final delta; exact-head hosted Linux checks above are the merge authority.
  • Qualified Linux/Docker full-mode verification was intentionally not run locally and remains a mandatory deferred operational gate.

Exact distinct-family review

The review history preserves matching-artifact review chains for the implementation commits through parent a73fe758793d858196c5ddbcada275c9363c1353.

The final standalone-boundary delta was reviewed directly by xAI/Grok 4.5 at high effort in an isolated disposable clone. The initial exact review returned three documentation findings; all three were integrated. The changed-artifact confirmation returned structured APPROVE with findings: []:

  • reviewed parent: a73fe758793d858196c5ddbcada275c9363c1353
  • resulting signed commit: e4a41834c0c8f765a970d906e7a78e10ffdff1a4
  • exact patch: 14,135 bytes
  • patch SHA-256: 6b60f120ece3e9eb5ce34836de89a4193fbb39cd8f6bb6820bea507a34e3b3f3
  • reviewer session/request: 019fbf0d-d106-7500-9be1-579c8b35be85 / a0318f71-86f7-49c8-894f-7f76ef513e02

The exact held-runner environment repair was then reviewed directly by xAI/Grok 4.5 at high effort in a fresh isolated clone. It returned structured APPROVE with findings: []:

  • reviewed parent: e4a41834c0c8f765a970d906e7a78e10ffdff1a4
  • resulting signed head: 3a8c41792d902a5f70e427b71ac03d886bb98403
  • exact patch: 6,833 bytes
  • patch SHA-256: a97fc3263d371d36da600c5bc662acd7463b865bc7221501f72a55776a98432c
  • reviewer session/request: 019fbf22-a313-78a0-992d-59998edf4b9e / a6528b80-331a-41b9-9ce2-f68121608f06

The final lease-authority, watchdog service, and shared runtime-environment closure was reviewed directly by xAI/Grok 4.5 at high effort. The unchanged exact patch returned APPROVE with no residual authority, matcher, lifecycle, or complexity finding:

  • reviewed parent: 3a8c41792d902a5f70e427b71ac03d886bb98403
  • resulting signed head: ea9955dbf8bf868c8184e438cfede764adbbfcd6
  • exact patch: 48,543 bytes
  • patch SHA-256: 0c2c93d6e2878b6007df3d47bb4c83ab83c6db096f8c84ad41899e2cc5b6115f
  • reviewer route: direct xAI/Grok CLI, independent of Portable-GHAR runtime or build dependencies

The named reviewers above record checkpoint evidence only. Portable-GHAR does not depend on that provider or transport; any eligible read-only distinct-family route can satisfy future review gates.

Public-safety checklist

  • No deployment identifiers, account IDs, installation/client/app IDs, secrets, tokens, keys, credentials, passwords, real logs, or real runtime state.
  • Synthetic fixtures are exact-content allowlisted; historical exceptions bind full blob OID, path, line, rule, and canonical line hash.
  • Tracked and full-history sanitization pass after the final commit entered history.
  • Repository metadata validation passes through the authoritative source gate.

Deferred operational gates

These remain mandatory before any claim of Phase 2 fully verified or any production activation:

  1. Qualified Linux/Docker image, integration, conformance, chaos, namespace/capability, QTS, and cleanup gates.
  2. Two full clean runtime rehearsals with OCI comparison, reproducibility evidence, SBOM/license checks, Syft/Trivy evidence, immutable-release setting/App proof, and publication idempotence.
  3. Forced GitHub runner-version-bump rehearsal proving automatic candidate/build continuity and bounded self-update cleanup without manual intervention.
  4. Separate operator sign-off for tmpfs size, cgroup Memory cap, maximum concurrency, rebuild cadence, temporary high-water accommodation, and the 32 GiB host-memory budget.
  5. Production dark/queued/running/enabled cutover evidence, independent rollback, and the schema-versioned one-way Grafana/InfluxDB health export.
  6. Any Phase 3 work, deployment, activation, release, tag, QNAP/RhoNAS host configuration, runner drain, or legacy-fleet cutover.

This PR must merge only as the Phase 2 source-completion checkpoint. A separate evidence/completion PR is required after the deferred gates produce positive evidence.

sumitake added 21 commits July 15, 2026 09:43
The unanchored `state/` pattern (added in Phase 1 to ignore a runtime
data/database directory, alongside the adjacent *.sqlite/*.db/.cache/
entries) also matched the Go source package internal/state/ that this
plan's File and Boundary Map fixes as the crash-safe store's location.
Anchor it to /state/ so it still ignores a root-level runtime state
directory without blocking internal/state/ as tracked source.
@sumitake
sumitake marked this pull request as ready for review July 30, 2026 13:10
Comment thread internal/networkjail/authority_manager_unix.go Fixed
Comment thread internal/networkjail/authority_manager_unix.go Fixed
Comment thread internal/upgrade/directive.go Fixed
Comment thread tests/integration/testenv/closed_runtime_scanner.go Fixed
Comment thread tests/integration/testenv/closed_runtime_scanner.go Fixed

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

ℹ️ 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 internal/watchdog/watchdog.go
Comment thread internal/watchdog/watchdog.go 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: 145f4d1de6

ℹ️ 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 internal/watchdog/watchdog.go Outdated
Comment thread internal/watchdog/watchdog.go Outdated
Comment thread internal/hostruntime/lifecycle_engine.go Outdated
Comment thread internal/networkjail/authority_manager_unix.go Fixed
Comment thread internal/networkjail/authority_manager_unix.go Fixed

Copy link
Copy Markdown
Owner Author

Final exact-head review binding for the hosted portability repair:

  • direct distinct-family reviewer: xAI/Grok 4.5 (operator-authorized broker bypass)
  • verdict: APPROVE; findings: []
  • reviewed base: 709d2037b8c068cd0f3bf424aa818bff57a4bc98
  • reviewed index tree: d355e71258f5fb5373aaec92af1b9be8bd4c1f04
  • reviewed full-index patch: 214,843 bytes; SHA-256 2a5ffb16f9c295a0ca2d80b13d862f085cfffdb0e1fc010499f819efda733bbe
  • reviewer session: 019fb3c6-6a4f-7532-82e1-0c6fb97821f8
  • reviewer request: 34f3622b-6e33-460a-8090-9986f3e07f21
  • final signed head: 50fa6c71a0aadb5895856547a4e30a9bf9d20197
  • final head tree: d355e71258f5fb5373aaec92af1b9be8bd4c1f04 (exact reviewed tree)
  • GitHub commit verification: verified=true, reason valid

No review artifact or provider output was added to the repository. This evidence applies only to the Phase 2 source-completion checkpoint; deferred Linux/Docker, full runtime-rebuild, forced-version-bump, sizing, deployment, and activation gates remain open.

@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: 946e4aac80

ℹ️ 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 internal/productionruntime/target_executor.go

@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: 00d0dae2ee

ℹ️ 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 internal/hostruntime/private_overlay.go 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: 05e5af6bd2

ℹ️ 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 internal/hostruntime/broker_runtime.go 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: 743918f9bf

ℹ️ 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 internal/productionruntime/system_lifecycle.go

@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: 881c6ac27c

ℹ️ 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 cmd/portable-ghar-network-adapter/relay.go Outdated
Comment thread internal/productionruntime/system_lifecycle.go
Comment thread internal/networkjail/dialer.go 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: 2dcf176dab

ℹ️ 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 deploy/systemd/portable-ghar-watchdog.service 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: a8ce474fcf

ℹ️ 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 internal/hostruntime/verifier_runtime.go 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: a73fe75879

ℹ️ 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 internal/productionruntime/process_kernel_linux.go
Comment thread internal/productionruntime/process_authority.go
@sumitake

sumitake commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Exact-head Phase 2 source checkpoint: signed head a73fe758793d858196c5ddbcada275c9363c1353 is GitHub-verified (reason=valid). Its exact parent delta is 47,568 bytes, SHA-256 849d9e0b0212436b1a10541c58ed43ff1bd0d5b06579eb5b9082263d7225dbc1. The authoritative non-mutating source gate passed every declared stage, along with worker/schema/docs checks, govulncheck, and tracked+history sanitization. Native xAI/Grok 4.5 high-effort review initially requested changes; after primary adjudication against the literal source and one read-only full-context confirm pass, it returned structured APPROVE with no findings (session/request 019fbee3-3fc0-7cc0-a980-e672a2241d10 / beaa2666-fbe2-42fa-aa5e-d9d43e9f8add). No broker/workspace, host, deployment, release, or activation state was changed.

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

ℹ️ 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 internal/hostruntime/dockercli.go Outdated
@sumitake

sumitake commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Final standalone-boundary checkpoint: signed exact head e4a41834c0c8f765a970d906e7a78e10ffdff1a4, tree b9203690cae8255ea55eb681ce182cdb3b486364, GitHub signature verified=true. Parent delta is 14,135 bytes, SHA-256 6b60f120ece3e9eb5ce34836de89a4193fbb39cd8f6bb6820bea507a34e3b3f3. Direct xAI/Grok 4.5 high-effort changed-artifact confirmation (019fbf0d-d106-7500-9be1-579c8b35be85 / a0318f71-86f7-49c8-894f-7f76ef513e02) returned structured APPROVE, findings: [], after three named-provider wording findings were integrated. Fresh exact-delta gates: markdownlint 43/43, Prettier, repository metadata, tracked+history sanitizer, productionruntime tests, boundary tests, and diff check all pass. The standalone boundary is explicit; review provider/transport remain replaceable development tooling. Linux/Docker and the other documented operational gates remain deferred; this is source completion only.

@sumitake

sumitake commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Final exact-head update: held-runner audit repair is committed as signed 3a8c41792d902a5f70e427b71ac03d886bb98403, tree 002b8cb8908662dad9384e3366dbfc1bb2b44977, GitHub signature verified=true. Parent delta: 6,833 bytes / SHA-256 a97fc3263d371d36da600c5bc662acd7463b865bc7221501f72a55776a98432c; direct xAI/Grok high-effort review returned structured APPROVE, findings: []. Fresh authoritative unit aggregate: all 21 stages pass, linux_docker=not_run. Full base-to-head artifact: 8,642,668 bytes / SHA-256 6357edeaed3869a772a6125d3ec74c54e943206b302d065ce01fe9a8e8549b4b. Hosted exact-head checks are rerunning.

@sumitake

sumitake commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Final review-fix checkpoint is signed head ea9955d (tree 7fa59b56d9ab4e16b5bde8ba27001537b0275e34; GitHub signature verified=true/reason=valid).

Exact parent patch: 48,543 bytes, SHA-256 0c2c93d6e2878b6007df3d47bb4c83ab83c6db096f8c84ad41899e2cc5b6115f. Direct xAI/Grok 4.5 high-effort adversarial review returned APPROVE with no residual authority, matcher, lifecycle, or complexity finding.

The patch:

  • revalidates the held lifecycle lease immediately before every SafeStop and StartDisabled mutation;
  • sets the watchdog oneshot to KillMode=process so systemd cannot reap the identity-managed controller;
  • centralizes image, proxy, runtime, and listener environments and carries the TLS-only proxy contract through create, held audit, conformance, listener exec, and post-JIT residual checks.

Fresh changed-scope evidence: focused Go packages pass; watchdog Bats 6/6; markdownlint 43/43; Prettier, docs command/link checks, repository metadata, workflow policy, tracked sanitizer, and full-history sanitizer pass. The local aggregate reached and passed source-integrity, gofmt, and vet but its full unit stage hit existing macOS sandbox file-mode fixture failures outside this delta; hosted exact-head Linux checks are now authoritative and in progress. No host, deployment, release, activation, broker, or consumer-repository mutation occurred.

Full base-to-head source artifact: 8,650,567 bytes, SHA-256 c48549a405c2ea387eefacd5d6167364778ab2ca2bc045aad3d3a62ddcdfbf7c.

@sumitake

sumitake commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Final source-completion merge gate: exact signed head ea9955d; all hosted exact-head checks passed, including both Linux/container matrices; all 64 review threads are resolved after exact-scope adjudication; GitHub reports MERGEABLE/CLEAN. This remains Phase 2 source completion only. No deployment, activation, release, tag, host mutation, numeric sizing decision, or Phase 3 work is included.

@sumitake
sumitake merged commit 8075e44 into main Aug 1, 2026
18 checks passed
@sumitake
sumitake deleted the dev/codex/phase2-integration branch August 1, 2026 22:04
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