Add Codex specific files
This commit is contained in:
@@ -0,0 +1,188 @@
|
||||
# Execution Plan
|
||||
|
||||
## Purpose and authority
|
||||
|
||||
This is the living execution plan for WireGuard Admin version 1. It records milestone scope, progress, review findings, and evidence so a new agent can resume from repository files without relying on chat history.
|
||||
|
||||
Read [AGENTS.md](AGENTS.md), [the specification](docs/SPEC.md), [architectural decisions](docs/adr/), [implementation order](docs/IMPLEMENTATION.md), and [the glossary](CONTEXT.md) before execution. The specification defines behavior; this plan schedules its delivery. Approved dependencies and Alpine/VM testing rules are in AGENTS.md. Do not change requirements to make a milestone pass.
|
||||
|
||||
Creating this plan does not start implementation or change the active model. All milestones below are initially pending, and no validation results are claimed.
|
||||
|
||||
## Model roles
|
||||
|
||||
| Role | Required model | Reasoning effort | Responsibility |
|
||||
| --------------------- | ------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------- |
|
||||
| Coordinator | GPT-6-Sol (`gpt-6-sol`) | `medium` | Refine tasks, dispatch workers, resolve interfaces, verify results, maintain this plan, accept milestones |
|
||||
| Implementation worker | GPT-6-Luna (`gpt-6-luna`) | `high` | Implement a bounded task and its meaningful tests |
|
||||
| Independent reviewer | GPT-6-Luna (`gpt-6-luna`) | `high` | Review the actual changes and evidence against acceptance criteria |
|
||||
| Repair worker | GPT-6-Luna (`gpt-6-luna`) | `high` | Fix review findings and regressions, then report new evidence |
|
||||
|
||||
These are the user's explicit model choices, not suggestions. Configure them through the execution harness, not by merely telling an agent to impersonate a model. In a harness using `spawn_agent`, use `model="gpt-6-luna"`, `reasoning_effort="high"`, and `fork_turns="none"` for workers; supply their context explicitly. Do not silently substitute another model. If the required model or effort is unavailable, report the limitation before starting affected execution. This Markdown file cannot switch the calling coordinator's model.
|
||||
|
||||
## Sequential execution and ownership
|
||||
|
||||
- Number milestones with integers starting at **1**. Keep IDs stable, never renumber accepted work or reuse IDs. Append new milestones using the next available integer; add bounded tasks within a milestone when finer scope is needed.
|
||||
- Execute milestones in ascending order. Start the next milestone only after the current milestone is accepted. Do not bypass an unmet gate because a later task looks independent.
|
||||
- The coordinator owns PLANS.md, task boundaries, interface agreements, and acceptance. Workers report proposed plan updates; they do not independently mark milestones accepted.
|
||||
- Default to one implementation writer at a time. Independent tasks within the active milestone may run concurrently only with explicit disjoint file ownership and agreed interfaces. Do not let agents overwrite one another's edits or run competing Cargo manifest/lockfile changes.
|
||||
- Use subagents for current-task work, not new user-owned chats. Reviewers should be separate agents from implementers and initially read-only. Further delegation must remain within the coordinator's assigned scope and model policy.
|
||||
- Preserve unrelated user changes. Do not create commits, publish, deploy, or access production merely because a milestone is accepted.
|
||||
|
||||
## Milestone lifecycle and review loop
|
||||
|
||||
Use states `pending`, `in_progress`, `in_review`, `needs_changes`, `blocked`, and `accepted`. A blocked milestone records the concrete missing prerequisite; it is not accepted and its successors remain pending.
|
||||
|
||||
1. **Prepare.** Inspect the actual repository. Expand the active milestone using the template below: concrete files/interfaces, small steps, observable outcomes, exact available commands, and expected results. Identify missing prerequisites before dispatch.
|
||||
2. **Implement.** Give a worker a bounded task brief. It implements only the assigned scope, adds focused behavioral tests, and reports changed files, commands/results, assumptions, and unfinished work.
|
||||
3. **Verify and review.** The coordinator examines the actual files/diff and checks evidence. A fresh reviewer evaluates correctness, regressions, specification/ADR compliance, security-relevant failure paths, and test coverage. Agent confidence or a prose summary is not acceptance evidence.
|
||||
4. **Repair.** Record each actionable finding with an ID, location, impact, expected behavior, and reproduction or validation. Assign a worker to fix it and rerun affected tests. The reviewer rechecks fixes and newly affected behavior.
|
||||
5. **Repeat.** Continue review and repair until findings are resolved and acceptance checks pass. Do not stop at an arbitrary iteration count or repeat an unchanged failing approach. Investigate repeated failures, reduce the task, or record a real external blocker. Settled requirements remain unchanged.
|
||||
6. **Accept.** The coordinator runs milestone gates against the integrated files, records reviewer disposition and validation evidence, updates progress/outcomes, and marks the milestone accepted. Only then advance. Routine acceptance does not require another user approval; new dependencies outside the approved set and unresolved product decisions retain their existing approval rules.
|
||||
|
||||
If a revision invalidates earlier acceptance evidence, record which milestones are affected and reopen the earliest affected milestone before advancing. Keep the integrated state buildable at each accepted milestone.
|
||||
|
||||
## Worker task brief
|
||||
|
||||
Every dispatch must include:
|
||||
|
||||
- Milestone ID, task ID, required model/effort, and role.
|
||||
- User-visible objective, relevant specification sections/ADRs, and prerequisite state.
|
||||
- Explicit read list, owned files, interfaces to preserve, and out-of-scope work.
|
||||
- Approved dependencies needed by this task; no permission to add unapproved dependencies.
|
||||
- Acceptance criteria and commands with expected outcomes; identify tests requiring Docker/VM access.
|
||||
- Safety boundary: synthetic fixtures only, no production keys/services/configuration, no host-network shortcuts.
|
||||
- Required report: changed files, checks actually run and their results, findings/risks, and remaining work. No secrets in reports.
|
||||
|
||||
For reviewers, provide the same objective and criteria plus the change baseline or exact changed-file list. Ask for independent inspection rather than confirmation of the implementer's conclusions.
|
||||
|
||||
## Milestone record template
|
||||
|
||||
Use this structure when expanding each active milestone. Replace placeholders before dispatch; do not interpret them as completed work.
|
||||
|
||||
```markdown
|
||||
## Milestone <next integer> — <observable outcome>
|
||||
|
||||
Status: pending
|
||||
Prerequisites: <accepted milestone IDs and environment requirements>
|
||||
|
||||
### Outcome and scope
|
||||
<What becomes possible, boundaries, and links to governing requirements.>
|
||||
|
||||
### Context and implementation steps
|
||||
<Actual paths, current state, interfaces, task ownership, and ordered steps.>
|
||||
|
||||
### Acceptance and validation
|
||||
- [ ] <Observable behavior and test/demonstration proving it.>
|
||||
- [ ] <Relevant failure behavior and how it is verified.>
|
||||
Commands: <exact commands, working directory, prerequisites, expected results>
|
||||
|
||||
### Progress
|
||||
- [ ] <Task ID and owner/agent ID; timestamp when updated>
|
||||
|
||||
### Review and repair
|
||||
| Finding | Iteration | Location and impact | Owner | Resolution and evidence | State |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
|
||||
### Evidence and handoff
|
||||
<Commands actually run, exit/results, artifact paths, reviewer disposition,
|
||||
remaining limitations, next concrete action.>
|
||||
|
||||
### Decisions and discoveries
|
||||
<New facts/trade-offs, reasons, and ADR references when warranted.>
|
||||
|
||||
### Outcome
|
||||
<Coordinator acceptance decision and timestamp, or exact blocker.>
|
||||
```
|
||||
|
||||
Use ISO 8601 timestamps with offsets for progress. Keep evidence concise and reproducible, with redacted excerpts or artifact paths rather than large logs. Distinguish planned commands from executed commands and unavailable checks from passing checks. Keep the plan self-contained by summarizing discoveries that affect the next task, not just linking to an agent conversation.
|
||||
|
||||
## Validation gates
|
||||
|
||||
For Rust milestones, use the relevant focused tests and the formatting, Clippy, default tests, and release-build commands in AGENTS.md. Add exact commands when targets exist; do not invent passing outputs. Unit and fixture checks run without root. Use standard-library test adapters rather than an additional mock framework.
|
||||
|
||||
Container suites are opt-in and use pinned/cached Alpine images, fresh server/client containers, synthetic keys, isolated dual-stack networking, and scoped `NET_ADMIN`. The real runtime adapter executes inside the server container. Missing Docker/kernel/IPv6 prerequisites are incomplete validation, not success. Alpine fixture application is not a production systemd test.
|
||||
|
||||
Actual systemd/D-Bus acceptance runs in a disposable VM. Never use production to fill gaps in test coverage. Final release acceptance requires relevant unit, Alpine WireGuard, and VM systemd results reported separately. Document blockers without silently weakening the gate.
|
||||
|
||||
## Milestone register
|
||||
|
||||
Each row is a delivery milestone, not a completion claim. Expand its record before execution; retain its original ID and acceptance scope.
|
||||
|
||||
| ID | Milestone | Prerequisites | State |
|
||||
| --- | -------------------------------------------------------- | ----------------------------------------- | ------- |
|
||||
| 1 | Rust foundation, settings, and domain states | None | pending |
|
||||
| 2 | Server configuration editing with byte preservation | 1 | pending |
|
||||
| 3 | Client keys, encrypted vault, and existing-client import | 2 | pending |
|
||||
| 4 | Backups, safe Commit, and full restoration | 3 | pending |
|
||||
| 5 | Runtime observation and systemd restart adapter | 4 | pending |
|
||||
| 6 | Client configuration delivery and reissue lifecycle | 5 | pending |
|
||||
| 7 | Complete terminal management workflow | 6 | pending |
|
||||
| 8 | Alpine Testcontainers integration | 7; suitable disposable Docker environment | pending |
|
||||
| 9 | Real systemd acceptance and release readiness | 8; disposable systemd VM | pending |
|
||||
|
||||
### Milestone 1 — Rust foundation, settings, and domain states
|
||||
|
||||
Create one Cargo package with thin startup/library separation, reproducible lockfile, validated TOML settings, executable-relative paths, public-key identities, and explicit draft/saved/applied states. Implement dual-stack first-free allocation and deferred address release. Provide help/version without root or vault access; management startup requires root. Do not create a nonfunctional full module tree.
|
||||
|
||||
Acceptance: settings and allocation tests cover invalid input, exhaustion, IPv4-only existing clients, and reserved deleted addresses; path resolution does not depend on the working directory. Build, default tests, formatting, and Clippy pass without touching live services.
|
||||
|
||||
### Milestone 2 — Server configuration editing with byte preservation
|
||||
|
||||
Implement document-preserving parsing/editing and versioned metadata comments. Server configuration remains authoritative, duplicate aliases are permitted, and only managed client portions change.
|
||||
|
||||
Acceptance: synthetic fixtures prove byte preservation of untouched settings/comments, client addition/deletion/rename, unknown-field preservation, missing creation dates, and rejection of metadata/terminal injection. No complete generic INI reserialization.
|
||||
|
||||
### Milestone 3 — Client keys, encrypted vault, and existing-client import
|
||||
|
||||
Implement separate vault/client key pairs, recipient encryption, password-protected vault identity, and versioned secret storage. Import from the configured directory on initial setup without deleting originals. Verify key correspondence and classify anomalies; conflicts block reissue until resolved.
|
||||
|
||||
Acceptance: new secrets encrypt without password entry, correct/incorrect password and corruption paths are covered, original files are unchanged, duplicates/conflicts are represented correctly, and persisted application data contains no plaintext client private keys. WireGuard key handling uses approved libraries, not utility subprocesses.
|
||||
|
||||
### Milestone 4 — Backups, safe Commit, and full restoration
|
||||
|
||||
Implement versioned tar archives/manifests, mandatory pre-operation backups, internal state persistence, Commit orchestration, and previewed full restoration without decryption. Define partial-write handling and archive validation. Persist address reservations and verified-state bookkeeping as needed.
|
||||
|
||||
Acceptance: backup failure prevents protected mutations; Commit/restore never change the running VPN; archive composition matches the specification; malformed/traversal/link entries are rejected; restore returns saved settings/configuration/vault without a password. Tests demonstrate draft cancellation and deletion of current secrets while older archives remain unchanged.
|
||||
|
||||
### Milestone 5 — Runtime observation and systemd restart adapter
|
||||
|
||||
Implement `wireguard-uapi` runtime queries and the `zbus` systemd adapter behind narrow interfaces. Track service job completion and timeout, then verify interface/client correspondence before recording applied state and releasing addresses. Require backup before restart.
|
||||
|
||||
Acceptance: ordinary tests exercise successful and failed jobs, missing/mismatched interfaces, unavailable statistics, and no automatic rollback using controlled adapters. Real runtime/systemd acceptance remains explicitly pending until milestones 8 and 9; mocks cannot close those later gates.
|
||||
|
||||
### Milestone 6 — Client configuration delivery and reissue lifecycle
|
||||
|
||||
Generate full-tunnel IPv4/IPv6 configurations using settings and preserved existing parameters where applicable. Save a root-only plaintext file and optionally render a matching QR code. Enforce post-Commit initial delivery and per-client password-based reissue with session-scoped retry after file errors.
|
||||
|
||||
Acceptance: file/QR payloads agree; no delivery before Commit; output failure permits directory change/retry; successful initial delivery or session exit ends password-free eligibility; overwrite requires confirmation; unrelated plaintext imports cannot bypass authentication.
|
||||
|
||||
### Milestone 7 — Complete terminal management workflow
|
||||
|
||||
Connect tested application operations to Ratatui/Crossterm screens: list and statistics, forms, anomalies/import, draft/diff, Commit, restart, output/QR, and backup selection/restore. Keep expensive work off the render/input loop and maintain public-key-based selection.
|
||||
|
||||
Acceptance: keyboard workflows and cancellation preserve the required states, statistics refresh without claiming online status, destructive actions identify targets, passwords are masked, and terminal cleanup/resize/non-TTY/error behavior is verified. No implicit apply or save on exit.
|
||||
|
||||
### Milestone 8 — Alpine Testcontainers integration
|
||||
|
||||
Implement opt-in Rust container tests and a minimal pinned Alpine image with `wireguard-tools` and `iproute2`. Cache images, use fresh isolated resources, build an Alpine-compatible test executable (prefer musl), and exercise the real runtime adapter within the server container. Avoid new helpers outside approved dependencies without agreement.
|
||||
|
||||
Acceptance: prerequisite checks and cleanup work; real dual-stack tunnels produce handshake/counter changes; creation/Commit leaves runtime unchanged until explicit test-only application; deletion retains access/address reservation until application; restored saved state does not implicitly apply. No host network, host D-Bus, production mounts, privileged default, or automatic module loading. Systemd coverage is explicitly excluded.
|
||||
|
||||
### Milestone 9 — Real systemd acceptance and release readiness
|
||||
|
||||
Prepare a repeatable disposable VM procedure and run the actual application/systemd adapter against synthetic WireGuard state. Finish operating/recovery documentation, safe settings examples, native target release build, and review of executable runtime dependencies.
|
||||
|
||||
Acceptance: real D-Bus job handling, separate restart verification, address release, and manual backup recovery pass in the VM. All specification acceptance criteria have linked evidence. Required default checks and Alpine tests pass on the integrated revision; unresolved defects or unavailable required VM checks prevent final acceptance. Production is never the test environment.
|
||||
|
||||
## Current progress and resume point
|
||||
|
||||
- All milestones are pending; application implementation has not started.
|
||||
- The approved dependency list and container testing methodology are recorded in AGENTS.md.
|
||||
- Next action when execution is requested: verify the coordinator model/effort, inspect the repository, expand milestone 1, and dispatch its first bounded worker task.
|
||||
- No workers have been dispatched by creation of this document; no build, container, or VM results are claimed.
|
||||
|
||||
## Plan maintenance
|
||||
|
||||
Update progress, findings, decisions, blockers, and the next action after each meaningful execution/review cycle and before handing off or ending a session. Preserve acceptance evidence when summarizing old iterations. Append scope changes with their reason; update the specification only when the user actually authorizes a requirement change.
|
||||
|
||||
Planning reference: [OpenAI — Using PLANS.md for multi-hour problem solving](https://developers.openai.com/cookbook/articles/codex_exec_plans). The specific model roles, milestone numbering, and review policy above are project decisions requested by the user.
|
||||
Reference in New Issue
Block a user