Skip to content

Commit 653a76b

Browse files
Jammy2211claude
authored andcommitted
Move the five sub-wikis under wiki/ with a shared schema at wiki/CLAUDE.md
wiki/lensing, wiki/smbh, wiki/cti, wiki/methods, wiki/galaxies replace the root-level *_wiki folders (the _wiki suffix is redundant under wiki/). The generic schema is promoted from lensing_wiki/CLAUDE.md to wiki/CLAUDE.md; the lensing wiki keeps a slim scope-only CLAUDE.md like its siblings. Relative links are rewritten for the new depth (append-only log.md files are left as historical record); the citation validator's sources glob and test fixture follow the layout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 48cd6fb commit 653a76b

173 files changed

Lines changed: 217 additions & 166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,31 @@ packaging, tooling, and workflow tasks.
1515
When you do read:
1616

1717
1. **Index first.** Start at [`index.md`](index.md), then the relevant
18-
sub-wiki's own `index.md` (`lensing_wiki/`, `smbh_wiki/`, `cti_wiki/`,
19-
`methods_wiki/`, `galaxies_wiki/`).
18+
sub-wiki's own `index.md` (`wiki/lensing/`, `wiki/smbh/`, `wiki/cti/`,
19+
`wiki/methods/`, `wiki/galaxies/`).
2020
2. **Then at most 2–3 pages.** Read only the concept/entity/source pages the
2121
index points you to. **Never bulk-load a sub-wiki.**
2222
3. **Do not couple to the internal layout** — reach pages through the indexes,
2323
not hard-coded paths.
2424

25+
## The write contract (layout rules)
26+
27+
The repo has exactly **two content homes**, enforced by
28+
`make validate-structure` (CI runs it on every push/PR):
29+
30+
- **`wiki/<domain>/`** — every sub-wiki, following the shared schema in
31+
[`wiki/CLAUDE.md`](wiki/CLAUDE.md). New sub-wikis are added beside the
32+
existing ones, never at the repo root.
33+
- **`bibliography/`** — the *only* place BibTeX lives. One canonical file
34+
(`pyautomemory.bib`) plus `bibkey_aliases.yaml`; never add loose `.bib`
35+
files anywhere else.
36+
37+
**Source PDFs live off-repo.** Never commit a paper (PDF/HTML, with or
38+
without a file extension) — read it, stub it in the right
39+
`wiki/<domain>/sources/*.md`, add its canonical entry to `bibliography/`,
40+
and run `make validate`. Unrecognised top-level files/folders fail the lint;
41+
the allowlist is in `scripts/validate_structure.py`.
42+
2543
## What does NOT live here
2644

2745
- **Operational history** — what the organism *did* (prior tasks, decisions,

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ The sub-wikis (self-contained, shared schema):
1717

1818
| Wiki | Covers |
1919
|------|--------|
20-
| [`lensing_wiki/`](lensing_wiki/index.md) | strong gravitational lensing (the primary wiki) |
21-
| [`smbh_wiki/`](smbh_wiki/index.md) | supermassive black holes, binaries, recoil, GW background |
22-
| [`cti_wiki/`](cti_wiki/index.md) | charge transfer inefficiency, Euclid VIS calibration |
23-
| [`methods_wiki/`](methods_wiki/index.md) | Bayesian inference, samplers, deep learning, simulations |
24-
| [`galaxies_wiki/`](galaxies_wiki/index.md) | galaxy formation and evolution |
20+
| [`wiki/lensing/`](wiki/lensing/index.md) | strong gravitational lensing (the primary wiki) |
21+
| [`wiki/smbh/`](wiki/smbh/index.md) | supermassive black holes, binaries, recoil, GW background |
22+
| [`wiki/cti/`](wiki/cti/index.md) | charge transfer inefficiency, Euclid VIS calibration |
23+
| [`wiki/methods/`](wiki/methods/index.md) | Bayesian inference, samplers, deep learning, simulations |
24+
| [`wiki/galaxies/`](wiki/galaxies/index.md) | galaxy formation and evolution |
2525

2626
[`bibliography/`](bibliography/README.md) holds the canonical BibTeX
2727
metadata every wiki cites against; [`reading-queue.md`](reading-queue.md)
2828
is what's waiting to be read and filed. New knowledge updates the metadata
2929
and the claim support together, then passes
30-
`make validate-literature-citations`.
30+
`make validate`.
3131

3232
The wiki schema is defined in
33-
[`lensing_wiki/CLAUDE.md`](lensing_wiki/CLAUDE.md) and inherited by every
33+
[`wiki/CLAUDE.md`](wiki/CLAUDE.md) and inherited by every
3434
sub-wiki. How agents should read this repo: [AGENTS.md](AGENTS.md). The
3535
organism this repo is the Memory of:
3636
[PyAutoBrain/ORGANISM.md](https://github.com/PyAutoLabs/PyAutoBrain/blob/main/ORGANISM.md),

bibliography/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Canonical PyAutoMemory bibliography
22

3-
`pyautomemory.bib` is the canonical metadata layer shared by every `*_wiki/` in this
3+
`pyautomemory.bib` is the canonical metadata layer shared by every sub-wiki under `../wiki/` in this
44
repository. Wiki source entries explain which claims papers support; the BibTeX file records
55
citation metadata and canonical keys. Keep PDFs, local paths, abstracts, and long paper
66
summaries out of both layers.
@@ -20,8 +20,8 @@ added elsewhere in the repo.
2020
1. Verify the paper from an authoritative public record or the paper itself.
2121
2. Search `pyautomemory.bib` by DOI, arXiv ID, and title. Reuse the existing canonical key;
2222
otherwise add verified metadata under a unique, stable author-year key.
23-
3. Add a compact section to the relevant `<domain>_wiki/sources/*.md` using the inherited
24-
schema in [`../lensing_wiki/CLAUDE.md`](../lensing_wiki/CLAUDE.md).
23+
3. Add a compact section to the relevant `../wiki/<domain>/sources/*.md` using the inherited
24+
schema in [`../wiki/CLAUDE.md`](../wiki/CLAUDE.md).
2525
4. Add concept/entity links only where the paper materially supports existing text.
2626
5. Run `make validate-literature-citations`.
2727

index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
The PyAuto organism's long-term knowledge: a multi-domain knowledge base of
44
accumulated scientific and project knowledge, organised as several
55
Karpathy-style LLM wikis over a shared canonical bibliography. Each sub-wiki uses
6-
the schema in [`lensing_wiki/CLAUDE.md`](lensing_wiki/CLAUDE.md).
6+
the schema in [`wiki/CLAUDE.md`](wiki/CLAUDE.md).
77

88
## Sub-wikis
99

10-
- [`lensing_wiki/`](lensing_wiki/index.md)**strong gravitational
10+
- [`wiki/lensing/`](wiki/lensing/index.md)**strong gravitational
1111
lensing.** The primary sub-wiki. Lens equation, mass models, source
1212
reconstruction, degeneracies, time-delay cosmography, dark-matter
1313
substructure, surveys (SLACS, BELLS, H0liCOW, TDCOSMO, Euclid Q1,
1414
HFF), software (PyAutoLens, lenstronomy).
15-
- [`smbh_wiki/`](smbh_wiki/index.md)**supermassive black holes.**
15+
- [`wiki/smbh/`](wiki/smbh/index.md)**supermassive black holes.**
1616
Binaries, recoil, scouring, mass functions, GW background
1717
(NANOGrav), seeds and growth.
18-
- [`cti_wiki/`](cti_wiki/index.md)**Charge Transfer Inefficiency.**
18+
- [`wiki/cti/`](wiki/cti/index.md)**Charge Transfer Inefficiency.**
1919
CCD trap physics, forward-model correction (`arctic`), trap pumping,
2020
Euclid VIS calibration, HST ACS, Gaia.
21-
- [`methods_wiki/`](methods_wiki/index.md)**statistical and
21+
- [`wiki/methods/`](wiki/methods/index.md)**statistical and
2222
computational methods.** Bayesian inference, samplers, deep learning,
2323
probabilistic programming, NUFFT, simulations, scientific software.
24-
- [`galaxies_wiki/`](galaxies_wiki/index.md)**galaxy formation and
24+
- [`wiki/galaxies/`](wiki/galaxies/index.md)**galaxy formation and
2525
evolution.** Massive ellipticals (MASSIVE survey), bulge/disk
2626
decomposition, IFU spectroscopy, stellar halos, COSMOS,
2727
high-redshift, halo-galaxy connection, galaxy-scale DM geometry.
@@ -38,7 +38,7 @@ the schema in [`lensing_wiki/CLAUDE.md`](lensing_wiki/CLAUDE.md).
3838
## Schema
3939

4040
The schema is defined once in
41-
[`lensing_wiki/CLAUDE.md`](lensing_wiki/CLAUDE.md) and inherited by
41+
[`wiki/CLAUDE.md`](wiki/CLAUDE.md) and inherited by
4242
all sub-wikis. Each sub-wiki has its own `CLAUDE.md` that diverges
4343
only on the `## Scope` section. Per-page frontmatter, naming
4444
conventions, `[[wiki-links]]`, status flags (`stub | drafted |

reading-queue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ became the unified knowledge repo. Section headers below match topic folders
66
in this repo (Strong Lensing, SMBHs, Galaxy Formation, Dark Matter,
77
Stats, …) — when a paper here is acquired as a PDF, it should be
88
filed under the matching folder and stubbed in the relevant
9-
`<sub>_wiki/sources/*.md` page.
9+
the matching `wiki/<domain>/sources/*.md` page.
1010

1111
---
1212

scripts/validate_literature_citations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def extract_canonical_keys(
8282

8383

8484
def source_directories(root: Path) -> tuple[Path, ...]:
85-
return tuple(sorted(path for path in root.glob("*_wiki/sources") if path.is_dir()))
85+
return tuple(sorted(path for path in root.glob("wiki/*/sources") if path.is_dir()))
8686

8787

8888
def collect_source_citations(directories: tuple[Path, ...]) -> tuple[SourceCitation, ...]:

tests/test_validate_literature_citations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_extract_canonical_keys_from_source_markdown():
4444
def _fixture_paths(tmp_path: Path) -> tuple[Path, Path, Path]:
4545
bibliography = tmp_path / "literature.bib"
4646
bibliography.write_text("@article{Alpha2024,\n}\n", encoding="utf-8")
47-
sources = tmp_path / "example_wiki" / "sources"
47+
sources = tmp_path / "wiki" / "example" / "sources"
4848
sources.mkdir(parents=True)
4949
aliases = tmp_path / "aliases.yaml"
5050
aliases.write_text("", encoding="utf-8")
Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
1-
# PyAutoLens AI Assistant — Strong Lensing Wiki
1+
# PyAutoMemory wikis — shared schema + usage rules
22

3-
This wiki gives a PyAutoLens AI assistant broad scientific context for strong
4-
gravitational lensing. It follows Karpathy's "LLM Wiki" pattern: concise,
3+
Every sub-wiki under `wiki/` gives an AI assistant broad scientific context
4+
for one domain. They follow Karpathy's "LLM Wiki" pattern: concise,
55
cross-linked pages are read at query time, while canonical citation metadata
6-
lives separately in `../bibliography/`.
6+
lives separately in [`../bibliography/`](../bibliography/README.md). This
7+
file defines the schema once; each sub-wiki's own `CLAUDE.md` diverges only
8+
on scope.
79

810
## Layout
911

1012
```
1113
PyAutoMemory/ # repo root
12-
├── lensing_wiki/ # this folder — the compiled wiki (in git)
14+
├── wiki/ # all sub-wikis (in git)
1315
│ ├── CLAUDE.md # this file — schema + usage rules
14-
│ ├── index.md # top-level navigation
15-
│ ├── log.md # append-only compilation log
16-
│ ├── concepts/ # one topic per page — the science
17-
│ ├── entities/ # specific surveys, lenses, collaborations, software
18-
│ └── sources/ # compact claim support (one paper = one section)
19-
└── bibliography/ # canonical BibTeX, aliases, citation instructions
16+
│ └── <domain>/ # one domain per sub-wiki, e.g. lensing/
17+
│ ├── CLAUDE.md # the sub-wiki's scope notes
18+
│ ├── index.md # the sub-wiki's own navigation
19+
│ ├── log.md # append-only compilation log
20+
│ ├── concepts/ # one topic per page — the science
21+
│ ├── entities/ # named things: surveys, instruments, software
22+
│ └── sources/ # compact claim support (one paper = one section)
23+
└── bibliography/ # canonical BibTeX, aliases, citation tooling
2024
```
2125

2226
Papers are the ground truth; wiki pages are syntheses. If they disagree, update
23-
the wiki and note the change in `log.md`.
27+
the wiki and note the change in the sub-wiki's `log.md`.
2428

2529
## References and citation metadata
2630

2731
- `sources/*.md` records compact guidance about what claims a paper supports.
2832
- `../bibliography/pyautomemory.bib` records canonical metadata and keys.
2933
- `../bibliography/bibkey_aliases.yaml` maps known alternate keys to canonical keys.
3034

31-
Never record local PDF paths or fabricate metadata. A canonical key is local to
32-
PyAutoMemory: resolve it against a target project's `.bib` before patching LaTeX.
33-
See [`../bibliography/README.md`](../bibliography/README.md) for the workflow.
35+
Never record local PDF paths or fabricate metadata — source PDFs live
36+
off-repo. A canonical key is local to PyAutoMemory: resolve it against a
37+
target project's `.bib` before patching LaTeX. See
38+
[`../bibliography/README.md`](../bibliography/README.md) for the workflow.
3439

3540
## Page types
3641

@@ -87,8 +92,8 @@ One paragraph an assistant can quote back to a user.
8792
## What it is
8893
The physics / definition.
8994
90-
## Why it matters for PyAutoLens
91-
How this concept shows up in lens-modeling decisions a PyAutoLens user makes.
95+
## Why it matters
96+
How this concept shows up in the decisions the domain's software users make.
9297
9398
## Key results from the literature
9499
Bullet list. Each bullet ends with `([[author-year-stub]])` so the LLM can
@@ -102,7 +107,7 @@ follow the link to the per-paper section.
102107
## Entity page structure
103108

104109
Same idea but the headings are "What it is / Key facts / Papers / See also".
105-
Use entity pages for: surveys (SLACS, BELLS, H0liCOW), specific lenses
110+
Use entity pages for: surveys (SLACS, BELLS, H0liCOW), specific objects
106111
(Abell 1201, the Cosmic Horseshoe), software (PyAutoLens, lenstronomy),
107112
collaborations (TDCOSMO, Space Warps).
108113

@@ -134,27 +139,17 @@ Papers covering this topic. Each paper has its own H2 section; cross-link with
134139
Keep entries short: normally 2–5 support bullets and no long prose. Do not copy
135140
abstracts or infer claims from filenames. Add a TODO when support is unverified.
136141

137-
## How the assistant should use this wiki
142+
## How the assistant should use a wiki
138143

139-
1. On a user question, first open `index.md`.
144+
1. On a user question, first open the sub-wiki's `index.md`.
140145
2. Follow the relevant `concepts/` or `entities/` page.
141146
3. Follow the source entry for claim scope and its canonical key for metadata.
142147
4. Resolve that key against downstream `.bib` files before changing LaTeX.
143148
5. If support or metadata is unclear, read the public paper and add a TODO
144149
rather than guessing. Log verified upgrades.
145150

146-
## Scope
151+
## Adding a sub-wiki
147152

148-
In-scope folders for the current wiki build:
149-
150-
- `Strong_Lens/` — primary
151-
- `Substructure/`
152-
- `StrongLensCluster/`
153-
- `Dark_Matter_Detection/`
154-
- `DarkMatterModels/`
155-
156-
Other folders (`WeakLensing/`, `Ellipticals/`, `Deep Learning/`, etc.)
157-
contain papers that touch lensing tangentially but are out of scope until
158-
explicitly added — see `log.md` for the decision.
159-
160-
This is the **lensing** sub-wiki. Sibling domain wikis inherit this schema.
153+
Create `wiki/<domain>/` with its own `CLAUDE.md` (scope notes only — this
154+
schema is inherited, not copied), `index.md`, `log.md`, and the three page
155+
folders. Give it a row in the repo-root `index.md` and `README.md` tables.
File renamed without changes.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ This sub-wiki gives an AI assistant the scientific context of Charge
44
Transfer Inefficiency (CTI) in CCDs — the physics of charge trapping
55
and release in silicon, its impact on astronomical imaging, the
66
forward-model correction algorithms (`arctic`), and the Euclid VIS
7-
detector calibration programme. Sibling of `lensing_wiki/` under
7+
detector calibration programme. Sibling of `../lensing/` under
88
`PyAutoMemory/`, same Karpathy "LLM Wiki" pattern.
99

1010
## Layout
1111

1212
```
13-
cti_wiki/
13+
cti/
1414
├── CLAUDE.md # this file — schema + scope
1515
├── index.md # top-level navigation
1616
├── log.md # append-only compilation log
@@ -21,7 +21,7 @@ cti_wiki/
2121

2222
## Schema
2323

24-
Inherits verbatim from [`../lensing_wiki/CLAUDE.md`](../lensing_wiki/CLAUDE.md)
24+
Inherits verbatim from [`../CLAUDE.md`](../CLAUDE.md)
2525
— page types, naming, `[[wiki-links]]`, frontmatter, concept-page
2626
structure, source-collection structure, `status: stub|drafted|reviewed`.
2727
This file only diverges on scope.
@@ -33,16 +33,16 @@ injection, the Euclid VIS detector and calibration pipeline, and the
3333
Hall-Shockley-Read trap-emission theory underlying CTI. Source PDFs live
3434
off-repo (the wiki was compiled from an off-repo CTI/Euclid paper corpus);
3535
what's here is the durable knowledge plus canonical citation metadata in
36-
`../bibliography/`.
36+
`../../bibliography/`.
3737

3838
Adjacent topics that link out:
3939
- Sampling / Bayesian inference of trap-density posteriors —
40-
`../methods_wiki/`.
40+
`../methods/`.
4141
- Cosmological weak-lensing shape biases from residual CTI —
42-
`../lensing_wiki/` ([[weak-lensing]] when written).
42+
`../lensing/` ([[weak-lensing]] when written).
4343

4444
## How the assistant should use this wiki
4545

46-
Same protocol as `../lensing_wiki/CLAUDE.md`: follow concepts/entities to
47-
compact source claims, use canonical metadata from `../bibliography/`, resolve
46+
Same protocol as `../CLAUDE.md`: follow concepts/entities to
47+
compact source claims, use canonical metadata from `../../bibliography/`, resolve
4848
downstream keys before editing LaTeX, and never fabricate.

0 commit comments

Comments
 (0)