Skip to content

feat: unify Entity skill control plane#1

Draft
StaticObserver wants to merge 13 commits into
mainfrom
codex/entity-workspace-case-v3
Draft

feat: unify Entity skill control plane#1
StaticObserver wants to merge 13 commits into
mainfrom
codex/entity-workspace-case-v3

Conversation

@StaticObserver

Copy link
Copy Markdown
Owner

Summary

  • add a provider-neutral entityctl facade, shared project-to-Case bindings, and content-addressed multi-client bundle publication
  • record Agent provenance and coordinate mutating workflows with writer leases and explicit handoff
  • make deterministic flow the default managed transaction path and add correctness-first efficiency gates
  • import observable Claude Code and Kimi Code tool traces without retaining messages or hidden reasoning
  • document the v4 authority and storage model, plus a controller-local query canary and sanitized diagnostic baselines

Why

Codex, Claude Code, and Kimi Code could each maintain overlapping skill and project-state copies, while ordinary Router work required long model-driven primitive loops. The new control plane gives all local providers one controller-authoritative state location that remains readable when execution sites are offline, and moves routine validation and orchestration into bounded deterministic programs.

User and developer impact

  • all providers can resolve the same Case from a project root
  • client discovery roots can point at one immutable bundle instead of divergent copies
  • read-only inspection performs no Case mutation or remote contact
  • concurrent mutating Agents are rejected unless the writer lease is handed off explicitly
  • native provider usage can be measured without capturing private reasoning or message content

Validation

  • python3 -m unittest discover -s tests -v — 84 passed
  • python3 -m unittest discover -s skills/entity-pgen/tests -v — 3 passed
  • python3 -m unittest discover -s skills/entity-env-build/tests -v — 18 passed
  • Python compilation and Router Python 3.6 grammar checks passed
  • all Router/eval JSON parsed successfully
  • all four runtime skills passed quick_validate.py
  • git diff --cached --check passed
  • controller-local query canary passed with one tool roundtrip, zero remote calls, zero Case mutation, and bounded output

Scope boundary

Real SSH build/run/nt2 runner staging and a matched-scenario cross-provider token-reduction canary remain follow-up work. The diagnostic Claude/Kimi sessions in this PR are explicitly not treated as matched comparisons.

…ol plane

Remove the v3 Case state machine, v4 deterministic flow facade, and all
compatibility commands (flow, writer, project, inspect, run-status,
migrate --from-v3) now that the live controller has been imported into
the v5 SQLite store.

- add entityctl site add/list so v5 can register Sites without the
  deleted file-based profile tooling; migrate --export becomes export
- trim entity_router_common to the v5/shared primitive set
- pgen preflight reads the v5 store; managed writes fail closed until
  a v5 pgen Goal exists
- drop v3/v4 templates, playbooks, and the v4-era evals/router-flow
  scaffolding; rewrite router references and contract tests
- sync README and skill docs; record the retirement in the v5
  implementation design doc
…evidence

Checkpoint of the pre_gold formal evaluation scaffold (submission/physics
oracles, schemas, fake Slurm, variants), the router-operation evidence
validator, and CI coverage before trimming to the lightweight A/B setup.
Keep only task.md, physics-spec.json, and RUNBOOK.md. The pre_gold
formal scaffold (oracles, schemas, fake Slurm, variants) stays
recoverable in git history. Drop the scaffold-specific test and CI
steps, and document per-round directory conventions in the runbook.
- 0.1.0: R1-R4 review fixes; executor sbatch uses -input; apply failure
  finishes anomaly + operation cancel; status --live degrades to UNKNOWN;
  env-build requires OpenMPI >= 5.0.0 (hard gate); VERSION file +
  store migrate shell
- 0.2.0: entityctl site discover + site-profile schema; submission
  create/verify contract with body fingerprint; structured scheduler
  remediation hints
- 0.3.0: parameter confirmation gates across the chain - env-build
  checkpoint confirm, pgen preflight card/confirm, router planner
  simulation-confirmation hard gate (digest + signer, hard fail)
- 0.4.0: goal_kind on plans with per-kind validation; build Goal
  (checkpoint compatibility=pass + parameter digest, double-checked at
  plan and apply); data Goal with executor data.inventory.v1 receipts;
  readiness/current generalized over asset dimensions
- evals: e2e-neutral-streaming review findings, harness review,
  oracle tests, observability phase tracing
- design: router development plan 2026-07-22 (0.x versioning, 1.0.0
  candidate criteria)

Tests: 121 passed, 3 subtests passed
- status --live now classifies out-of-band divergence: job_gone (with
  sacct-confirmed flag), state_mismatch (recorded submitted vs observed
  terminal state), untracked_job (foreign job in the Case run root);
  bounded to three scheduler queries, tolerant of missing sacct
- entityctl apply --refresh re-executes a completed data Goal plan so a
  stale data-inventory.json is rebuilt after run artifacts change;
  data.inventory.v1 always re-walks the run root instead of trusting a
  previous verified receipt
- doctor: hard failures (exit 2) on client bundle drift and invalid
  stored Site profiles; warnings for leaked active Operations with the
  exact operation cancel remedy
- skill adoption metrics in the phases report: skill vs raw invocation
  counts, sqlite control-plane surgery counter, skill_call_share — the
  clean-comparison metric required by the 1.0.0 candidate criteria
- contract test updated: live status budget is now three bounded
  scheduler queries

Tests: 132 passed, 3 subtests passed
…lity, pgen

router: stable plan_hash across replans, timezone-safe launch recovery
with sacct fallback, purge directory probe fix, sqlite error envelope,
ssh_alias whitelist, content-addressed build identity, single-transaction
cancel, claim-token write checks, goal.schema for run/build/data

env-build: whitelist versions/arch/extra_env keys (command injection and
path traversal), fix ENTITY_DEPS_ROOT derivation, cmake_cxx_flags double
quoting, precise override issue removal, structured snapshot failures,
run_id validation, reject unknown Kokkos arch

observability: protected-root check for phases --output, case-insensitive
path compare, real kimi isError flags, robust evidence validation,
id-matched acceptance evidence, span_id reuse rejection, fcntl fallback,
TOCTOU-safe finish/artifact, redaction fixes

pgen/nt2py: preflight always emits JSON contract, store_present field,
fsync decisions, new nt2py unit tests

docs: sync README/CONTRIBUTING/design contract with implementation

Adds 61 regression tests (193 total, all passing), each reproduced the
reported failure before the fix.
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