mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
Update repository agent operating contracts
This commit is contained in:
parent
7de2ef71a0
commit
cb96c6bed2
5 changed files with 131 additions and 7 deletions
|
|
@ -33,6 +33,30 @@ lake build
|
||||||
|
|
||||||
- `Semantics.BeaverMaskFreshness` is a finite admission gate for Beaver-mask
|
- `Semantics.BeaverMaskFreshness` is a finite admission gate for Beaver-mask
|
||||||
freshness negative controls.
|
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/`.
|
- Stack status receipts live under `shared-data/data/stack_solidification/`.
|
||||||
- The current staged slice is documented in
|
- The canonical arithmetic note is
|
||||||
`../../../6-Documentation/docs/stack_solidification_staging_manifest_2026-05-09.md`.
|
`../../../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.
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,13 @@ Scope: `4-Infrastructure/`
|
||||||
- Treat `/usr/bin/sem` as GNU Parallel on this machine unless proven otherwise;
|
- Treat `/usr/bin/sem` as GNU Parallel on this machine unless proven otherwise;
|
||||||
use the isolated `sem` binary documented in stack solidification receipts when
|
use the isolated `sem` binary documented in stack solidification receipts when
|
||||||
needed.
|
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
|
## Preferred Checks
|
||||||
|
|
||||||
|
|
@ -21,6 +28,10 @@ python3 -m py_compile 4-Infrastructure/shim/<script>.py
|
||||||
python3 -m json.tool <receipt>.json >/dev/null
|
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:
|
For Tang Nano 9K work, keep the boundaries explicit:
|
||||||
|
|
||||||
- bitstream present
|
- bitstream present
|
||||||
|
|
|
||||||
|
|
@ -24,27 +24,44 @@ Project-specific context may live under `models/`. Keep project-local notes comp
|
||||||
|
|
||||||
## Python Environment
|
## 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
|
```bash
|
||||||
./.venv/bin/python
|
./.venv/bin/python
|
||||||
```
|
```
|
||||||
|
|
||||||
This environment has the CAD dependencies required by the skill tools, including
|
This environment has the CAD dependencies required by the skill tools, including
|
||||||
`build123d` and `OCP`. If `.venv` is missing or cannot import those modules,
|
`build123d` and `OCP`. If `.venv` is missing or cannot import those modules and
|
||||||
create/install it from the repo root before running CAD tools:
|
the root scripts are unavailable, create/install it from this harness root:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3.11 -m venv .venv
|
python3.11 -m venv .venv
|
||||||
./.venv/bin/pip install -r requirements-cad.txt
|
./.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
|
## Source Of Truth
|
||||||
|
|
||||||
- Generated CAD and URDF outputs are derived artifacts.
|
- Generated CAD and URDF outputs are derived artifacts.
|
||||||
- Package-local render, topology, component, and review-image artifacts 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.
|
- 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.
|
- 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
|
## Prompt Artifacts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# AGENTS.md — Strict LLM Operating Rules
|
# AGENTS.md — Strict LLM Operating Rules
|
||||||
|
|
||||||
**Repository:** Sovereign Stack / Research Stack
|
**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.
|
**Paradigm:** Functional Collapse — All models reduce to a single `bind` primitive.
|
||||||
**Ground Truth:** Lean 4 (`0-Core-Formalism/lean/Semantics/`).
|
**Ground Truth:** Lean 4 (`0-Core-Formalism/lean/Semantics/`).
|
||||||
**Goal:** Zero-guesswork, proven-correct, hardware-native code.
|
**Goal:** Zero-guesswork, proven-correct, hardware-native code.
|
||||||
|
|
@ -259,6 +259,34 @@ else:
|
||||||
- Achieved: 6 sigma (error < ±5 samples)
|
- Achieved: 6 sigma (error < ±5 samples)
|
||||||
- If error > ±10 samples: alert user, do not commit
|
- 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
|
## 6. File and Edit Discipline
|
||||||
|
|
@ -678,6 +706,11 @@ theorem energyConserved (initial final : PhysicalState) :
|
||||||
- Elegance is not effect size
|
- Elegance is not effect size
|
||||||
- Coherence is not compression gain
|
- 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:**
|
**Valid evidence requires:**
|
||||||
- Reproducible benchmarks with corpus provenance
|
- Reproducible benchmarks with corpus provenance
|
||||||
- SI units for physically projectable claims
|
- SI units for physically projectable claims
|
||||||
|
|
|
||||||
41
AGENTS.md
41
AGENTS.md
|
|
@ -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.
|
- Prefer repo-native tools and receipt generators over ad hoc summaries.
|
||||||
- Treat Lean as the source of truth for formal or hardware-adjacent claims.
|
- 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.
|
- 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
|
## 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/`
|
- Hardware bring-up: `4-Infrastructure/hardware/`
|
||||||
- Documentation and wiki surfaces: `6-Documentation/`
|
- Documentation and wiki surfaces: `6-Documentation/`
|
||||||
- Stack receipts: `shared-data/data/stack_solidification/`
|
- 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
|
## 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 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 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.
|
- 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
|
## Do Not Sweep
|
||||||
|
|
||||||
|
|
@ -40,6 +55,30 @@ git clean -fdx
|
||||||
|
|
||||||
Use explicit file lists from the relevant staging manifest.
|
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
|
## Legacy Recovery Trigger
|
||||||
|
|
||||||
The phrase **`RECOVER LEGACY INFORMATION`** is the explicit retrieval trigger
|
The phrase **`RECOVER LEGACY INFORMATION`** is the explicit retrieval trigger
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue