Guard source and build carrying cost
This commit is contained in:
parent
a28c1e02a6
commit
8c079d9fdd
3 changed files with 79 additions and 4 deletions
46
AGENTS.md
46
AGENTS.md
|
|
@ -82,7 +82,7 @@ machine-spirit awake.
|
|||
- Handoff summary: `F:\Projects\Epiphany\notes\fresh-workspace-handoff.md`
|
||||
- Epiphany algorithmic map: `F:\Projects\Epiphany\notes\epiphany-current-algorithmic-map.md`
|
||||
- Epiphany safety architecture: `F:\Projects\Epiphany\notes\epiphany-safety-architecture.md`
|
||||
- State CLI: `cargo run --manifest-path F:\Projects\Epiphany\epiphany-core\Cargo.toml --bin epiphany-state -- ...`
|
||||
- State CLI: `cargo run --manifest-path F:\Projects\Epiphany\Cargo.toml --bin epiphany-state -- ...`
|
||||
- Pre-compaction helper: `cargo run --manifest-path F:\Projects\Epiphany\epiphany-core\Cargo.toml --bin epiphany-prepare-compaction -- ...`
|
||||
|
||||
## Useful Commands
|
||||
|
|
@ -96,7 +96,7 @@ name the shared target explicitly:
|
|||
```powershell
|
||||
& 'C:\Users\Meta\.cargo-target-codex\debug\epiphany-state.exe' status
|
||||
$env:CARGO_TARGET_DIR='C:\Users\Meta\.cargo-target-codex'
|
||||
cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-state -- add-evidence --type research --status ok --note '...'
|
||||
cargo run --manifest-path .\Cargo.toml --bin epiphany-state -- add-evidence --type research --status ok --note '...'
|
||||
cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-prepare-compaction --
|
||||
```
|
||||
|
||||
|
|
@ -219,10 +219,50 @@ operator-enginseer, not the implementation servitor.
|
|||
run contaminated for supervision purposes, and continue from sealed
|
||||
projections instead of letting the worker's stream steer the supervisor.
|
||||
|
||||
## Source And Build Economy
|
||||
|
||||
- Verified capability is the asset. Epiphany-owned source, tests, schemas,
|
||||
dependencies, executable targets, and compiler artifacts are carrying costs.
|
||||
Minimize authority surfaces and build fan-out, not line count; readable code
|
||||
and consequence-bearing verifier reach remain invariants.
|
||||
- The target invariant is one Cargo package owner per production entrypoint.
|
||||
`epiphany-core` owns only the `epiphany-prepare-compaction` maintenance
|
||||
binary; runtime entrypoints are converging on `epiphany-release-bundle`.
|
||||
Known violations still under repair are `epiphany-model-runtime`,
|
||||
`epiphany-persona-service`, and `epiphany-tool-mcp-runtime`, whose sources are
|
||||
also admitted by their leaf package manifests. Treat those duplicates as cut
|
||||
work, not precedent. Do not point multiple packages at the same binary source
|
||||
or preserve a binary because a stale manifest, smoke command, or historical
|
||||
document still names it.
|
||||
- Admit a new executable only when a live consumer requires an independent
|
||||
process, privilege boundary, lifecycle, or deployment contract. Tests,
|
||||
fixtures, probes, and one-off migrations belong in existing library or
|
||||
integration-test surfaces unless they must cross such a boundary.
|
||||
- Local Cargo checks must name one package and a focused library, integration
|
||||
test, or binary target. Do not run local workspace-wide, `--all-targets`, or
|
||||
otherwise unspecified multi-binary builds without explicit operator
|
||||
authorization. Idunn owns release-wide build execution. Before an authorized
|
||||
broad build, inventory the target graph, output root, current output size,
|
||||
free disk, expected budget, and terminal retention.
|
||||
- An interrupted build remains unsettled work. Before retrying, inventory every
|
||||
output root it may have written, including absolute path, size, last write,
|
||||
owning run or revision, live process status, and retention decision. Settle
|
||||
that run before creating another target root; cleanup machinery is not a
|
||||
substitute for deleting unowned source or target fan-out.
|
||||
|
||||
## Verification Guardrails
|
||||
|
||||
- Use focused checks for the surface being changed instead of defaulting to a
|
||||
whole-repo ritual. Not every prayer needs a cathedral.
|
||||
- For Epiphany control-plane behavior changes, run focused Rust checks against the touched app-server mapper/handler tests plus any matching native `epiphany-core` smoke binary. The old Python smoke shims have been cut; do not resurrect them.
|
||||
- For Epiphany control-plane behavior changes, run the focused existing library
|
||||
or integration tests that exercise the changed consequence, plus touched
|
||||
app-server mapper/handler tests when applicable. Do not create or resurrect a
|
||||
standalone smoke executable merely to test a library or contract.
|
||||
- Source, test, and target counts are pressure signals, not acceptance metrics.
|
||||
Do not delete exact conflict, substitution, concurrency, lifecycle, re-entry,
|
||||
or user-visible consequence proofs merely to improve a count. Preserve the
|
||||
claim in the smallest owning library or integration surface, and delete a
|
||||
verifier only when the claim is dead, duplicated, or covered by stronger
|
||||
evidence.
|
||||
- For Codex Rust work on this Windows machine, set `$env:CARGO_TARGET_DIR='C:\Users\Meta\.cargo-target-codex'`.
|
||||
- Do not parallelize cargo builds or tests against the same target directory.
|
||||
|
|
|
|||
23
vendor/codex/AGENTS.md
vendored
23
vendor/codex/AGENTS.md
vendored
|
|
@ -48,6 +48,24 @@ In the codex-rs folder where the rust code lives:
|
|||
trivial; prefer new modules/files and keep `chatwidget.rs` focused on orchestration.
|
||||
- When running Rust commands (e.g. `just fix` or `cargo test`) be patient with the command and never try to kill them using the PID. Rust lock can make the execution slow, this is expected.
|
||||
|
||||
## Source And Build Economy
|
||||
|
||||
- Verified behavior is the asset. Owned source, tests, crates, dependencies,
|
||||
compiled targets, and build output are carrying costs. Prefer deletion,
|
||||
collapse, or reuse before adding another mechanism, and minimize build fan-out
|
||||
rather than chasing line-count reductions.
|
||||
- Every new crate, binary, dependency, or test target must have a named owner,
|
||||
live consumer, and invariant that an existing surface cannot coherently own.
|
||||
A fixture or probe does not justify a shipped binary.
|
||||
- Treat module-size guidance as a readability constraint, not an instruction to
|
||||
manufacture crates or abstraction layers. Preserve consequence-bearing tests
|
||||
and clear code when a smaller metric would make the machine harder to trust.
|
||||
- Before a workspace-wide, all-target, or all-feature build, enumerate the
|
||||
package and target scope, identify the output root, inspect its size and free
|
||||
disk, and decide what may be retained. If a build is interrupted, inventory
|
||||
and settle its output before retrying instead of accumulating a fresh target
|
||||
directory.
|
||||
|
||||
Run `just fmt` (in `codex-rs` directory) automatically after you have finished making Rust code changes; do not ask for approval to run it. Additionally, run the tests:
|
||||
|
||||
1. Run the test for the specific project that was changed. For example, if changes were made in `codex-rs/tui`, run `cargo test -p codex-tui`.
|
||||
|
|
@ -64,7 +82,10 @@ To that end: **resist adding code to codex-core**!
|
|||
Particularly when introducing a new concept/feature/API, before adding to `codex-core`, consider whether:
|
||||
|
||||
- There is an existing crate other than `codex-core` that is an appropriate place for your new code to live.
|
||||
- It is time to introduce a new crate to the Cargo workspace for your new functionality. Refactor existing code as necessary to make this happen.
|
||||
- A new Cargo workspace crate owns a coherent boundary and repays its added
|
||||
dependency graph, build target, and maintenance surface by removing or
|
||||
isolating greater complexity. Do not introduce one merely to satisfy a module
|
||||
line-count guideline.
|
||||
|
||||
Likewise, when reviewing code, do not hesitate to push back on PRs that would unnecessarily add code to `codex-core`.
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ harness, not an old language model product.
|
|||
- Prefer end-to-end coherence over local cleverness. A small pipeline whose
|
||||
parts visibly deserve to exist beats a large one full of compensators for
|
||||
misunderstood complexity.
|
||||
- Treat verified capability as the asset and owned source, tests, dependencies,
|
||||
compiled targets, and build artifacts as carrying costs. Prefer deletion,
|
||||
collapse, and reuse before adding another mechanism. Minimize conceptual
|
||||
surface and build fan-out, not line count or readability.
|
||||
- Use vivid language as an attention handle, not as mysticism. In Epiphany role
|
||||
work, body means code structure, runtime shape, data flow, seams, and scars;
|
||||
hands means bounded source actuation; soul means objective, invariants,
|
||||
|
|
@ -151,6 +155,11 @@ Codex's original prompt carries useful operator scars. Keep them.
|
|||
surrounding design.
|
||||
- Follow local style and existing abstractions. Add new abstractions only when
|
||||
they remove real complexity or match an established pattern.
|
||||
- A new crate, executable target, dependency, service, schema, or persistent
|
||||
type must have a named owner, live consumer, protected invariant, and a reason
|
||||
the existing surface cannot coherently own it. Preserve consequence-bearing
|
||||
verifier reach; deleting proof only to improve a size metric is not
|
||||
simplification.
|
||||
- Keep public APIs small, predictable, and easy to use.
|
||||
- Do not add copyright or license headers unless asked.
|
||||
- Add comments only when they save future readers real work.
|
||||
|
|
@ -162,6 +171,11 @@ Codex's original prompt carries useful operator scars. Keep them.
|
|||
|
||||
- Start with focused checks that exercise the surface you changed, then broaden
|
||||
as risk warrants.
|
||||
- Before a workspace-wide, all-target, all-feature, or otherwise broad build,
|
||||
enumerate its package and target scope, identify the output root, inspect
|
||||
existing output and free disk, and decide the retention bound. If interrupted,
|
||||
inventory and settle that output before retrying instead of routing around it
|
||||
with another target or cache root.
|
||||
- Treat proxy metrics, mocks, and narrow tests as suggestive, not conclusive.
|
||||
Validate against the real objective when the real objective can be measured.
|
||||
- Do not fix unrelated failures unless the user asks. Mention them when they
|
||||
|
|
|
|||
Reference in a new issue