Skip to content

feat: harden local runtime, entitlements, and Store delivery - #22

Open
kristoffersodersten wants to merge 84 commits into
mainfrom
codex/ci-foundation-repair
Open

feat: harden local runtime, entitlements, and Store delivery#22
kristoffersodersten wants to merge 84 commits into
mainfrom
codex/ci-foundation-repair

Conversation

@kristoffersodersten

@kristoffersodersten kristoffersodersten commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restore the selected-text → local Ollama → contract-validated Chrome Extension path with explicit model, context-window, routing, privacy, and execution truth.
  • Make automatic setup choose the smallest qualified local profile (fast / gemma4:e2b-it-qat) on every supported machine; larger profiles require explicit operator selection.
  • Keep that exact generation model resident after installation and every generation request with an explicit keep_alive=-1 contract. Invalid overrides fail closed; embedding remains independently time-bounded.
  • Enforce fail-closed Ed25519 entitlements and Chrome Web Store packaging without placing production identity or secrets in the repository.
  • Keep extension preferences device-local, bind side-panel opening to the active tab, expose restricted-page failures, and provide tested Markdown, JSON, and plain-text exports.
  • Preserve protected review, exact-SHA admission, deterministic sampling, explicit model-missing failure, and no cloud inference fallback.

Exact-head verification

Source commit: 0e5ec938cbf1e12b22bda6efb4866771aa4273d4
Pull-request merge ref: aaa25122204c2fc096e3311b15bd68a56b88b34f

GitHub checks on the exact head: 9/9 successful.

  • CI run 33841994897: Node 20 and 22 validation, Python 3.9 compatibility, lint, manifest/shell contracts, strict typecheck, build/generated-JavaScript parity, Store assets, negative Store packaging, billing/privacy, unpacked-extension E2E, policy, stress, exact-SHA admission, and entitlement-image build.
  • CodeQL v4 run 33841994858: Python and JavaScript/TypeScript succeeded.
  • Dependency Review run 33841994937, Axiom Enforcement run 33841994928, and macOS helper/package run 33841994860 succeeded.
  • Exact Hetzner checkout passed 56/56 Node tests, 79/79 Python tests, billing 7/7, privacy 3/3, Playwright extension E2E 7/7, and deterministic stress 10/10, plus frontier/policy validation, negative Store packaging, exact-SHA admission, Axiom intent validation, and entitlement-image build.
  • Admission artifact selectpilot-code-admission-aaa25122204c2fc096e3311b15bd68a56b88b34f (artifact ID 9925367230) has evidence-file SHA-256 979e1956e918a1425bb33c060565888aa9b248eafbef47f0ecdbbe9c0c29ec87.
  • Admission traceability: 30 implemented, 0 missing, 0 unmapped files, 0 unmapped functions.
  • The five Dependabot alerts remain attached to stale main; this PR pins brace-expansion@5.0.9 and @humanfs/node@0.16.8, and exact-head Dependency Review passed at severity low or higher.
  • The separate npm audit endpoint timed out from Hetzner after its retries and is not counted as a passing check.

Exact-final-SHA physical Apple evidence

The signed candidate was installed from the exact source commit on physical Mac16,10 / Apple Silicon / 16 GB with existing local model artifacts only.

  • Automatic setup selected Fast / gemma4:e2b-it-qat at context 16,384, seed 42, maximum concurrency 1, and local-only mode. The larger installed E4B model remained inactive and all 37 cloud-tagged models were ignored.
  • All five installed runtime modules match the candidate byte-for-byte. LaunchAgent com.chromeai.nano is running and health exposes generation_keep_alive_seconds=-1.
  • Ollama reported only E2B for generation with UNTIL Forever. A baseline Action Brief completed in 10 s; after 342 s idle it completed in 10 s; after 733 s idle it completed in 9 s. All three produced canonical digest 67fbb16a29175c1de1a1517dcf9704fbb08bb026d2f64858dd2d387bb40ef45a.
  • Exact-SHA agent execution completed in 10 s on E2B.
  • Three warm benchmark runs measured extract at 5.917 / 5.429 / 5.513 s and summary at 10.350 / 9.758 / 9.934 s. The advisory suggested Balanced, while the binding auto_profile remained Fast under the owner-selected smallest-effective-model rule.
  • The embedding route used nomic-embed-text-v2-moe:latest, returned 768 dimensions in 27 s from cold state, and did not evict E2B; generation still reported Forever.
  • A reversible cold-start test explicitly unloaded E2B. Bootstrap absorbed the 132.97 s load inside Preparing local model bundle, returned green health, and the next Action Brief completed in 10 s with the same digest.
  • An isolated explicitly missing model produced degraded health and HTTP 503 ollama_unavailable; it did not substitute any installed or cloud model, and the primary E2B service remained healthy.

Release boundary

This is a tested repository and physical development-runtime candidate, not an approved production release.

  • The immutable CI admission artifact correctly remains runtime_verified=false, physical_hardware_verified=false, and full_system_ok=false; physical evidence is recorded here rather than rewriting CI evidence.
  • Protected main remains REVIEW_REQUIRED with zero approvals. Approval and merge remain human-controlled; no self-approval, self-merge, or protection bypass was performed.
  • The collaborator list contains only the PR author and pending invitations are empty. Because protected main requires one approving review with admin enforcement, an eligible independent human reviewer must be explicitly configured before merge.
  • A manual physical Chrome toolbar → selected text → side panel → local result → downloaded export journey remains required because the automation surface is prohibited from opening chrome://extensions; automated unpacked-extension E2E is 7/7.
  • Fresh read-only inventory: all three SelectPilot domains lack DNS; GitHub repository/environment secrets and variables are empty; Hetzner has no SelectPilot service, Nginx site, or TLS certificate; the Mac has Apple Development but no Developer ID/notary authority.
  • Production entitlement signer/keyring, Paddle authority, DNS/TLS endpoints, Developer ID/notarization, Chrome Web Store secrets/upload/publication, install-from-Store proof, and rollback/rotation proof require external authority or credentials not present in the repository.
  • No cloud inference fallback or telemetry was added.

kristoffersodersten and others added 2 commits March 31, 2026 19:37
- Added __init__.py files to all server subdirectories (intent, model, operations, runtime, task) to enable proper Python package imports
- Fixed import statements in server modules (ollama_client, nano_server, runtime_profiles) to use absolute imports
- Updated eslint.config.js to support .mjs files with Node.js globals for scripts
- All TypeScript builds successfully, ESLint passes (0 errors), and all tests pass (28/28)
- Python modules now import correctly without ModuleNotFoundError

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Install pnpm before setup-node cache initialization and use the repository lockfile for CodeQL dependency setup.\n\nVerified: pnpm lint; pnpm lint:manifest; pnpm typecheck; pnpm test
Copilot AI lite review requested due to automatic review settings August 10, 2026 20:13

@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: 5b58ff4fde

ℹ️ 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 server/nano_server.py Outdated

Copilot AI 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.

Pull request overview

This PR restores/aligns the CI and CodeQL workflows to bootstrap pnpm before setup-node caching, and ensures dependency installation uses pnpm + pnpm-lock.yaml. It also updates ESLint configuration for .mjs files and includes small Python/module and formatting tweaks.

Changes:

  • Update GitHub Actions CI and CodeQL workflows to set up pnpm earlier and use pnpm caching + pnpm install --frozen-lockfile.
  • Add an ESLint override for **/*.mjs to lint ES2022 Node ESM files with appropriate globals.
  • Minor Python import/whitespace-only edits in the server code and a formatting-only change in a stress report JSON.

Reviewed changes

Copilot reviewed 7 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/ci.yml Installs pnpm before setup-node to support pnpm cache bootstrap.
.github/workflows/codeql.yml Uses pnpm + pnpm-lock.yaml for JS CodeQL dependency setup and caching.
eslint.config.js Adds .mjs linting config (ES2022, ESM, Node globals).
server/nano_server.py Adjusts imports (module path style) and adds a trailing newline.
server/ollama_client.py Adjusts extraction preset import to a package-qualified path.
server/runtime_profiles.py Whitespace-only change (trailing newline).
reports/stress/master_summary.json Formatting-only change (adds a blank whitespace line).
server/__init__.py Empty package marker file (no content shown).
server/intent/__init__.py Empty package marker file (no content shown).
server/model/__init__.py Empty package marker file (no content shown).
server/operations/__init__.py Empty package marker file (no content shown).
server/runtime/__init__.py Empty package marker file (no content shown).
server/task/__init__.py Empty package marker file (no content shown).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread server/nano_server.py Outdated
Comment thread server/ollama_client.py Outdated
Comment thread reports/stress/master_summary.json
Route a fixed local sample through the paid extraction contract and persist successful completion. Replace static AES material with a per-install non-exportable key and cover the locked path plus encrypted round-trip.\n\nVerified: pnpm typecheck; pnpm exec tsc -p tsconfig.json; node --test tests/panel/*.test.mjs
Allow the full browser suite and unpacked-extension proof to run against the same explicitly selected Chrome binary.\n\nVerified: SELECTPILOT_CHROME_EXECUTABLE=<local Chrome> pnpm test:e2e (7 passed); pnpm lint
…un-export

feat(onboarding): add real first-run export flow
Restore imports compatible with the documented script invocation and add that invocation as a CI smoke gate. Remove unrelated whitespace noise identified in review.\n\nVerified: python3 server/nano_server.py --help; pnpm lint; pnpm lint:manifest; pnpm typecheck; pnpm test
Verification: remote-compute-audit; compute guard heavy/light refusal checks; bash -n; git diff --check
Verified: pnpm lint && pnpm typecheck && pnpm build && pnpm test && pnpm test:privacy && pnpm test:e2e && pnpm bench:frontier && pnpm runtime:compile-policy && pnpm runtime:validate-policy && node scripts/stress-runner.mjs
Expand required CI validation to cover privacy, unpacked-extension E2E, fail-closed policy compilation, and stress contracts. Emit an exact-SHA artifact that explicitly remains non-runtime and non-full-system evidence.\n\nVerified: pnpm lint && pnpm lint:manifest && pnpm typecheck && pnpm build && pnpm test && pnpm test:privacy && pnpm test:e2e && pnpm bench:frontier && pnpm runtime:compile-policy && pnpm runtime:validate-policy && node scripts/stress-runner.mjs && pnpm verify:admission
Verified: workflow YAML parse and GitHub release metadata for action majors
Use the generated profile variable names consistently and add a side-effect-free plan mode with exact Fast and Balanced regression tests.\n\nVerified: bash -n scripts/bootstrap-macos-local.sh && pnpm lint && pnpm test && pnpm test:privacy && pnpm test:e2e
kristoffersodersten and others added 28 commits August 25, 2026 22:12
Install the launchd runtime outside privacy-protected source folders, require Python 3.10 or newer for both local and packaged helpers, and wait for bridge readiness.

Verified: pnpm lint; pnpm test; pnpm build; pnpm verify:admission; pnpm test:privacy; pnpm test:billing; pnpm lint:manifest; pnpm validate:store; pnpm test:e2e
Verified: shellcheck scripts/*.sh; pnpm lint; pnpm test
Align both macOS installation paths with the declared Python 3.9 compatibility contract and keep the minimum version explicit in regression coverage.

Verified: shellcheck scripts/install-macos-local.sh installer/macos/scripts/postinstall; node --test tests/panel/bootstrap-contract.test.mjs; full Hetzner release verification.
Keep CI candidate packaging unsigned while requiring an authorized Developer ID Installer identity and notarytool keychain profile for production release.

Verified: shellcheck scripts/*.sh; node --test tests/panel/macos-release-contract.test.mjs tests/panel/bootstrap-contract.test.mjs; pnpm lint.
Add conflict-free loopback routing, hardened systemd and Nginx contracts, fail-closed preflight, safe diagnostics, and deployment regression coverage.

Verified: pnpm lint; pnpm test; pnpm typecheck; pnpm test:privacy; pnpm package:store; pnpm test:e2e; shellcheck; systemd-analyze verify; hardened systemd smoke and recovery.
…ase-preflight

feat(release): add production entitlement deployment
…hardening

fix(billing): harden Paddle webhook verification
Intent: AXIOM-20260830-OXBH25

Encrypt project memory at rest, keep preferences device-local, redact runtime errors, bound bridge requests, and activate downstream Axiom enforcement.

Not run: dependencies are intentionally absent on the Mac control surface; full verification runs on Hetzner.
Intent: AXIOM-20260830-OXBH25

Reject malformed and oversized authority requests, enforce JSON media types, bound server sockets, remove checkout HTML injection, and cap polling/network waits.

Not run: full verification executes on Hetzner.
…content-bundle

fix(ci): synchronize hardened content bundle
Intent: AXIOM-20260830-OXBH25

Normalize hostile trace identifiers, recursively redact runtime metadata, rotate feedback logs, cap SSE streams, and suppress raw model errors.

Not run: full verification executes on Hetzner.
…mission-gaps

fix(ci): map checkout hardening coverage
Intent: AXIOM-20260830-OXBH25
…mission-gaps

fix(governance): verify signed Axiom intent
Intent: AXIOM-20260830-OXBH25
…installer-routing

fix(macos): preserve hardware task routing
Fail closed on missing Store identity, runtime integrity failures, mutable state errors, and local inference saturation. Preserve exact model routing through the extension UI.

Verified: pnpm lint; pnpm test; pnpm test:e2e; pnpm build; pnpm test:privacy; pnpm test:billing; pnpm bench:frontier; runtime policy validation; stress runner.
Record the verified repository boundary and preserve every external production and review gate as open.

Verified: evidence commands recorded in the checkpoint.
Cover active helper modules and runtime policy with an aggregate launch-time hash, install the missing installation manager dependency, and normalize raw request timeouts into the explicit helper failure contract.

Verified: targeted Python runtime tests, bootstrap contract tests, shell syntax checks, and git diff --check.
Force the ESLint filesystem helper to 0.16.8 so build tooling cannot follow attacker-controlled symlinks outside a copied source tree. The lockfile is regenerated and verified on Hetzner in the following commit.
Update init, autobuild, and analyze together to remove the December 2026 v3 deprecation and the legacy Node 20 action runtime warning.
Record the admitted implementation parent, physical diagnostic boundary, protected Store environment state, and remaining external authorities without promoting the project to production completion.
Keep extension preferences device-local, bind the side panel to the active tab before opening, surface restricted-page failures, and add verified plain-text export.

Verified: Hetzner pnpm lint && pnpm test && pnpm test:e2e
Select the Fast E2B profile for automatic setup on every supported machine while keeping heavier profiles behind explicit operator choice.

Verified: Hetzner pnpm lint && pnpm typecheck && pnpm test && pnpm test:e2e
Verified: node --test tests/panel/runtime-profiles.test.mjs
Use one explicit generation keep-alive contract across prewarm, runtime requests, launchd, and health reporting. Invalid overrides fail closed and no larger model is selected as fallback.

Verified: python3 -m unittest tests.server.test_ollama_client tests.server.test_installation_manager

Verified: node --test tests/panel/bootstrap-contract.test.mjs

Verified: bash -n scripts/bootstrap-macos-local.sh scripts/install-macos-local.sh installer/macos/scripts/postinstall
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.

3 participants