D1-02 — Make the frozen Scarcity Router task runnable end-to-end #32
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Creatidy/creatidy-kernel#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #30
Depends on completed D1-01: #31
Goal
Turn the completed K1-K8 foundation into the thinnest supported real-task execution path needed to run the first frozen dogfood scenario:
BioMedical-IT/scarcity-router#143The next step after this issue must be able to execute that real task through Creatidy Kernel without manually assembling Python objects or Git plumbing.
This issue modifies Creatidy Kernel only.
It does NOT implement Scarcity Router #143.
Frozen dogfood subject
D1-01 selected and froze:
Repository:
BioMedical-IT/scarcity-routerIssue:
#143 — Flaky under load: test_scenario_11 client-disconnect cancel can assert before the cancel reaches the worker readerFrozen repository base at D1-01 completion:
develop @ 781bace66cec4f91b952cbe1993a3524be90fb63The implementation target is limited to:
tests/test_e2e_execution.pyThe semantic requirement is to remove the cancellation race using deterministic bounded synchronization without weakening the assertion that cancellation reaches exactly the owning worker.
The authoritative verification plan from #31 remains the acceptance authority for the eventual dogfood run.
D1-02 must not implement that repair itself.
Desired outcome
After D1-02, the owner should be able to start the frozen task through one supported Kernel entry point, approximately:
The exact CLI is implementation-owned.
The owner must not need to manually:
ScarcityRouterAllocator;CodexRuntime;ForgejoForge;run_live_reference()from Python;The command may still require explicit configuration for credentials, Router origin, model-runtime evidence and Forge identity. Security-critical material must never be accepted through unsafe command-line arguments if that would expose it in process listings or shell history.
Scope principle
Build the narrowest real vertical slice that can execute the frozen #143 scenario.
Do NOT build a generic Program engine, arbitrary workflow language or universal repository automation layer.
Generalize only where the existing K1-K8 port boundary already requires it.
Required capabilities
1. Real repository subject
Kernel must operate from an explicit exact repository/base subject.
For the frozen dogfood scenario:
BioMedical-IT/scarcity-router;develop;Kernel must refuse a workspace whose base cannot be established exactly.
Do not silently update or mutate canonical
develop.2. Frozen task input
The first real task may use an explicit checked-in or controller-owned task specification representing the frozen #143 contract.
Do not require a generic issue parser.
The task input must preserve at minimum:
Fetching arbitrary Forgejo issue prose and turning it into authority is NOT required for D1-02.
3. Workspace preparation
Create the disposable coding workspace automatically.
Required properties:
Do not claim hostile-worker isolation beyond what the existing Runtime actually enforces.
4. Real Scarcity Router allocation
Use the existing
ScarcityRouterAllocator.Do not introduce another model-selection path.
A new Attempt receives one real Router recommendation.
Existing Attempt recovery keeps its durable Allocation and does not reselect.
5. Real Codex Runtime composition
Use the existing Codex Runtime port and exact provider/model/reasoning-effort semantics.
D1-02 may add the minimal composition/configuration layer needed to instantiate the already-proven Runtime in a supported user-facing path.
Do not embed provider selection logic in the Runtime or CLI.
Do not weaken requested/resolved/observed identity evidence.
6. Coding prompt / task execution
The Runtime must receive the frozen task and relevant repository instructions.
Do not feed hidden acceptance secrets to the coding model unnecessarily.
For #143, the coding model may inspect the repository and edit only the authorized coding workspace.
The model is not the acceptance authority.
7. Candidate changed-path gate
Before repository tests can establish acceptance, Kernel/controller must compare the candidate against the exact base and reject changes outside:
tests/test_e2e_execution.pyThis must be controller-owned evidence.
The coding model must not be able to redefine the allowed changed-file set.
8. Independent structural acceptance for #143
Because #143 modifies a test file, green tests alone are insufficient.
Implement the smallest controller-owned structural verification needed to enforce the frozen D1-01 invariants.
It must reject at minimum obvious weakening such as:
skip/xfail;Do not build a generic static-analysis policy language.
If some semantic property cannot be safely established deterministically, preserve it as an explicit verification limitation for the later independent review rather than pretending it is proved.
9. Deterministic repository verification
Kernel must be able to run the frozen verification commands under controller authority.
For #143 the frozen plan is:
CancellationTests;make check;Command execution must be:
Do not add arbitrary worker-selected verification commands.
10. Candidate and acceptance subject
Verification must bind to the exact candidate Git subject.
A verification result for one tree/commit must never accept another.
The existing K4/K7 acceptance separation remains authoritative.
11. Real Forgejo PR delivery
After acceptance, use the existing Forge port / Forgejo AGit mechanism.
The PR must:
develop;No direct worker push authority.
12. Recovery
The supported path must retain the existing durable semantics across controller restart.
At minimum, D1-02 tests must prove recovery does not duplicate:
A live crash exercise will occur in the later dogfood execution issue; deterministic fixtures remain acceptable for implementation validation here.
User-facing status
The command should provide concise lifecycle output suitable for a human.
At minimum distinguish:
no merge / no deploy.Raw evidence may remain available through a separate inspect/export path.
Do not turn this into a dashboard or TUI.
Configuration
Use explicit configuration and existing secure mechanisms where possible.
Do not:
If the current existing adapters cannot be safely composed without an additional bounded configuration mechanism, implement only the smallest one necessary and document its trust assumptions.
Reuse-first
Before building new composition/plumbing, inspect existing:
Prefer ADAPT/PORT over duplicate implementation where semantics match.
Do not perform a broad framework search.
Explicit non-goals
D1-02 does NOT authorize:
Acceptance
D1-02 is complete when deterministic evidence proves that the frozen #143 scenario can be composed through one supported Kernel entry point up to and including a synthetic/effect-controlled Forge PR proof, with:
The implementation tests must not perform paid inference or create a real Scarcity Router PR.
Completion
Deliver through normal
/deliver-issuegovernance:develop;After owner merge, do NOT automatically execute Scarcity Router #143.
The next child will be the actual live dogfood run against the then-current canonical Scarcity Router
develop.D1-02 delivery ledger
developfeat/d1-02-dogfood-composition72f3ddcee754f1d67cc75e914375971818a4537249af0c4fd7475b6066a8f06fccdbe6b187042673(canonicaldevelop)max_remediation_cycles = 10,remediation_used = 0make check(788 passed; ruff format/check, basedpyright strict, lint-imports, secrets scan,git diff --check),make package-checkpassed