Update repository agent operating contracts

This commit is contained in:
Brandon Schneider 2026-05-11 22:48:54 -05:00
parent d4f4f563bd
commit 7f7e452859
5 changed files with 131 additions and 7 deletions

View file

@ -33,6 +33,30 @@ lake build
- `Semantics.BeaverMaskFreshness` is a finite admission gate for Beaver-mask
freshness negative controls.
- `Semantics.HCMMR.Kernels.EntropyCollapseDetector` is the finite arithmetic
receipt for the corrected entropy-collapse detector. It intentionally keeps
logarithmic/Hurst quantities as scaled receipt constants and proves the
dense-rank crossing count, D2 numerator, and Kendall tail values with
executable Lean checks.
- Stack status receipts live under `shared-data/data/stack_solidification/`.
- The current staged slice is documented in
`../../../6-Documentation/docs/stack_solidification_staging_manifest_2026-05-09.md`.
- The canonical arithmetic note is
`../../../6-Documentation/docs/distilled/ArithmeticSpec_Corrected_2026-05-11.md`.
Treat `sigma_q` on `n=8` as a deterministic window feature, not as a robust
Hurst estimator.
- The K=21 prime-gap rerun receipt is
`../../../shared-data/data/stack_solidification/prime_gap_k21_rerun_receipt_2026-05-11.md`.
Its conclusion is deliberately bounded: rare surviving windows are candidate
motifs, not a general prime-gap collapse theorem.
- Historical staged slices are documented in
`../../../6-Documentation/docs/stack_solidification_staging_manifest_2026-05-09.md`
and
`../../../6-Documentation/docs/stack_solidification_staging_manifest_2026-05-10.md`.
## Local Quarantine Boundaries
- The root `.gitignore` excludes known local formal scratch/WIP such as
`2-Search-Space/FAMM/FAMM_FSDU.lean` and `4-Infrastructure/hardware/test.lean`.
Do not revive ignored Lean files into the clean build surface without first
making them compile under a narrow target.
- Generated `*_tb.v` and `*_test_vectors.json` files are build artifacts unless
a task explicitly promotes one as a hardware receipt.

View file

@ -13,6 +13,13 @@ Scope: `4-Infrastructure/`
- Treat `/usr/bin/sem` as GNU Parallel on this machine unless proven otherwise;
use the isolated `sem` binary documented in stack solidification receipts when
needed.
- Remote model/API probes must be secret-clean. Read provider credentials from
environment variables only (`OLLAMA_API_KEY`, `DEEPSEEK_API_KEY`, etc.); never
embed literal keys in scripts, receipts, prompts, or docs.
- LLM/model outputs are reviewer receipts, not validation. If a model review is
promoted, store the answer and a machine-readable receipt with prompt/answer
hashes under `shared-data/artifacts/`, and state which files formed the
context.
## Preferred Checks
@ -21,6 +28,10 @@ python3 -m py_compile 4-Infrastructure/shim/<script>.py
python3 -m json.tool <receipt>.json >/dev/null
```
For API-facing or receipt-writing scripts, also run a touched-file secret scan
before staging. Treat the repository credential hook as a backstop, not the
first detector.
For Tang Nano 9K work, keep the boundaries explicit:
- bitstream present

View file

@ -24,27 +24,44 @@ Project-specific context may live under `models/`. Keep project-local notes comp
## Python Environment
Prefer the repo-local CAD runtime when it exists:
The root workspace pins Python 3.11.15 in `.python-version` and exposes the CAD
setup through root `package.json` scripts. From the repository root, prefer:
```bash
npm run install-python
npm run setup-cad-env
npm run verify-cad
```
These commands mirror the checked-in VS Code tasks in `.vscode/tasks.json`.
Inside this harness, prefer the repo-local CAD runtime when it exists:
```bash
./.venv/bin/python
```
This environment has the CAD dependencies required by the skill tools, including
`build123d` and `OCP`. If `.venv` is missing or cannot import those modules,
create/install it from the repo root before running CAD tools:
`build123d` and `OCP`. If `.venv` is missing or cannot import those modules and
the root scripts are unavailable, create/install it from this harness root:
```bash
python3.11 -m venv .venv
./.venv/bin/pip install -r requirements-cad.txt
```
Do not commit `.venv`, Python caches, or local package caches. They are runtime
state, not CAD source.
## Source Of Truth
- Generated CAD and URDF outputs are derived artifacts.
- Package-local render, topology, component, and review-image artifacts are derived artifacts.
- Do not hand-edit generated artifacts unless explicitly instructed. Edit the owning source file or imported source file first, then regenerate explicit targets with the relevant skill tool.
- If regenerated output differs from checked-in generated files, the regenerated output is authoritative.
- Root `.python-version`, root `package.json` scripts, and root VS Code tasks
are workspace setup surfaces. Update them when the preferred CAD rebuild
command changes.
## Prompt Artifacts

View file

@ -1,7 +1,7 @@
# AGENTS.md — Strict LLM Operating Rules
**Repository:** Sovereign Stack / Research Stack
**Version:** 2.1 — Anti-Drift Evidence Standards (2026-04-29)
**Version:** 2.2 — Anti-Drift Evidence Standards (2026-05-12)
**Paradigm:** Functional Collapse — All models reduce to a single `bind` primitive.
**Ground Truth:** Lean 4 (`0-Core-Formalism/lean/Semantics/`).
**Goal:** Zero-guesswork, proven-correct, hardware-native code.
@ -259,6 +259,34 @@ else:
- Achieved: 6 sigma (error < ±5 samples)
- If error > ±10 samples: alert user, do not commit
### 5.3 Entropy-Collapse Detector Arithmetic
The canonical detector arithmetic is
`distilled/ArithmeticSpec_Corrected_2026-05-11.md`, mirrored by
`0-Core-Formalism/lean/Semantics/Semantics/HCMMR/Kernels/EntropyCollapseDetector.lean`.
Hard boundaries:
- Dense ranking is mandatory. Equal values get equal rank; tied pairs do not
create braid crossings.
- For W=8, the corrected example has `crossings = 12`, not 18.
- `K=7` is not selective under the random-permutation null:
`P(count > 7) = 38129/40320 = 94.57%`.
- `K=21` is a heuristic random-permutation calibration:
strict `count > 21` gives `1230/40320 = 3.05%`; inclusive `count >= 21`
gives `2191/40320 = 5.43%`.
- `sigma_q` on an `n=8` window is a deterministic window feature, not a robust
long-series Hurst estimate.
- 1D Renyi D2 is bounded in `[0,1]`; `D_c = 1.2` is a definition mismatch for
this estimator. `D_c = 0.7` is heuristic.
- Prime gaps do not satisfy the random-permutation null. Ties, non-uniform gap
marginals, overlapping windows, local dependence, and multiple testing must
be stated before making any prime-gap signal claim.
The current bounded conclusion is: the original prime-gap result was mostly an
artifact of non-selective `K=7`; strict `K=21` leaves rare candidate motifs, not
evidence of a general prime-gap collapse phenomenon.
---
## 6. File and Edit Discipline
@ -678,6 +706,11 @@ theorem energyConserved (initial final : PhysicalState) :
- Elegance is not effect size
- Coherence is not compression gain
LLM reviews may be stored as reviewer receipts only when they include prompt
hash, answer hash, model, timestamp, and the exact context files. They can guide
follow-up work, but they do not override Lean checks, arithmetic receipts,
hardware receipts, or empirical baselines.
**Valid evidence requires:**
- Reproducible benchmarks with corpus provenance
- SI units for physically projectable claims

View file

@ -10,6 +10,11 @@ This file is the first stop for coding agents working in this repository.
- Prefer repo-native tools and receipt generators over ad hoc summaries.
- Treat Lean as the source of truth for formal or hardware-adjacent claims.
- Keep claims bounded: a receipt proves only the gate it actually checks.
- Secrets are runtime-only. Use environment variables such as `OLLAMA_API_KEY`
or `DEEPSEEK_API_KEY`; never paste, print, or commit literal provider keys.
- For repo-stabilization tasks, finish with a clean `git status --branch --short
--untracked-files=all` and an empty `git clean -nd` dry run before claiming
the tree is stable.
## Core Surfaces
@ -18,7 +23,11 @@ This file is the first stop for coding agents working in this repository.
- Hardware bring-up: `4-Infrastructure/hardware/`
- Documentation and wiki surfaces: `6-Documentation/`
- Stack receipts: `shared-data/data/stack_solidification/`
- Current scoped staging map: `6-Documentation/docs/stack_solidification_staging_manifest_2026-05-09.md`
- Promoted review receipts: `shared-data/artifacts/deepseek_review/`
- CAD harness: `5-Applications/text-to-cad/`
- Historical scoped staging maps:
`6-Documentation/docs/stack_solidification_staging_manifest_2026-05-09.md`
and `6-Documentation/docs/stack_solidification_staging_manifest_2026-05-10.md`
## Verification Expectations
@ -26,6 +35,12 @@ This file is the first stop for coding agents working in this repository.
- For Python shims, run `python3 -m py_compile` on touched files.
- For JSON receipts, run `python3 -m json.tool` or a repo-native receipt parser.
- For hardware claims, distinguish software witness, bitstream presence, SRAM load, flash persistence, UART beacon, and live hardware receipt.
- Before committing, run `git diff --cached --check` and a staged secret scan
for touched source/receipt files. The repository credential hook is a final
gate, not a substitute for local review.
- For root CAD setup changes, JSON-parse `package.json`, `.vscode/settings.json`,
and `.vscode/tasks.json`, then use the pinned Python/CAD commands documented
in `5-Applications/text-to-cad/AGENTS.md`.
## Do Not Sweep
@ -40,6 +55,30 @@ git clean -fdx
Use explicit file lists from the relevant staging manifest.
`shared-data/` is ignored by default because most of it is generated or
offloaded. Promote only specific, durable receipts with `git add -f -- <path>`,
and keep empty/failed model outputs out of Git unless they are themselves the
evidence under review.
## Git Remote Hygiene
- The active branch may not have an upstream. Inspect with
`git rev-parse --abbrev-ref --symbolic-full-name @{u}` before assuming push
state.
- For GitHub sync, prefer the `github` remote and verify the remote head after
push:
```bash
git fetch github <branch>
git rev-list --left-right --count FETCH_HEAD...HEAD
git push -u github <branch>
git ls-remote --heads github <branch>
```
- Dependabot banners printed by GitHub after push may be stale relative to the
live alert API. Treat the push result and remote-head hash separately from
dependency-alert remediation.
## Legacy Recovery Trigger
The phrase **`RECOVER LEGACY INFORMATION`** is the explicit retrieval trigger