Skip to content

Commit 418a730

Browse files
MartinCastroAlvarezmartin-castro-laminr-aiclaude
authored
chore: prune docs/ bloat — keep only screenshots; fix cross-link rot (#551)
Owner directive: minimal docs, focused on shipping. After #550 collapsed this repo to the React-super-layer, most of `docs/` either described the local API (now gone, in `django-admin-rest-api`) or agent governance (sole-agent mode now). ## Deleted (47 files) - `docs/agents/` — agent governance, autonomy policy, decisions log, PR workflow, per-role subdirs. None of it applies in sole-agent mode. - `docs/api-contract.md` — wire contract for `django-admin-rest-api`; belongs in that repo, not duplicated here. - `docs/extensions.md` — extension API doc that was already marked "not yet implemented" + the wiring lives in the API repo. - `docs/threat-model.md` — STRIDE threat model. SECURITY.md is the durable security document; per-endpoint threat surface is now an API-repo concern. - `docs/data-layer.md` — frontend data-layer internals; SPA-only and the code is its own documentation. - `docs/ux/` — UX principles / nav / responsive / a11y / PWA. Was the PM agent's internal doc — sole-agent mode has no PM agent. - `docs/consumer/` — pilot requirements; internal-only. ## Kept - `docs/screenshots/` (6 PNGs + README) — referenced from `README.md` for the PyPI landing page. - `docs/README.md` — trimmed to a 1-paragraph pointer at the screenshots + the root docs. ## Cross-link rot fixed - `README.md`: dropped the "see `docs/extensions.md`" ref (API-repo concern) and "Full wire contract: `docs/api-contract.md`" (the API repo owns it). - `ARCHITECTURE.md`: dropped 3 references to deleted docs/ files (decisions log, M2M ADR pointer, `installation.md`). - `SECURITY.md`: surgically removed every ref to `docs/agents/`, `docs/threat-model.md`, `tests/test_security.py` (deleted with the API in #550), and the now-obsolete CI-revisit prose. The §10 cross-references now point at README + ARCHITECTURE + the API repo's SECURITY. ## Verification - 42 SPA tests pass (unchanged from #550). - No remaining dead `docs/*` references in any of the 4 surviving root `.md` files. Co-authored-by: Martin Castro Laminrs <mcastro@laminr.ai> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0f6c4cd commit 418a730

51 files changed

Lines changed: 46 additions & 8474 deletions

Some content is hidden

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

ARCHITECTURE.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ truth** for permissions, querysets, forms, and field configuration — both
99
packages honour that contract.
1010

1111
> This document is the architectural contract for the **SPA super-layer**.
12-
> Any change that conflicts with it must update this file in the same PR
13-
> and be recorded in [`docs/agents/decisions.md`](docs/agents/decisions.md).
1412
> The wire-contract document (what the API actually emits / accepts) lives
1513
> in the **API repo** — this file refers to it but does not duplicate it.
1614
@@ -216,8 +214,7 @@ Conservative, list in [`SECURITY.md`](SECURITY.md) and codified in
216214
with timezone).
217215
- `ForeignKey``{ "id": ..., "label": str(obj) }`.
218216
- `ManyToMany` → list of `{ "id": ..., "label": str(obj) }` envelopes
219-
(Issue #55; supersedes the earlier "unsupported" decision logged in
220-
`docs/agents/decisions.md`).
217+
(Issue #55).
221218
- `FileField` / `ImageField``{ "name", "url", "size" }`; `url` defers
222219
to the consumer's storage backend so signed-URL backends work
223220
unchanged (Issue #57).
@@ -377,8 +374,7 @@ There is exactly one data path inside the SPA:
377374

378375
- The package ships a `tailwind.config.js` with a minimal, modern, neutral
379376
palette and CSS-variable-backed colors for trivial recoloring.
380-
- Consumers can extend it via their own `tailwind.config.js`; this is
381-
documented in `docs/installation.md`.
377+
- Consumers can extend it via their own `tailwind.config.js`.
382378
- **Partial replacement is supported** (e.g., override `colors`, `fontFamily`,
383379
`spacing`).
384380
- **Full replacement of the config is not a v1 goal** — it would mean every

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,9 @@ register_field_type(MoneyField, vocab_type="decimal")
459459
# code required.
460460
```
461461

462-
For coining a brand-new `vocab_type` (with a matching SPA widget)
463-
see [`docs/extensions.md`](docs/extensions.md).
462+
Coining a brand-new `vocab_type` (with a matching SPA widget) is an
463+
**API-repo** concern — open the issue at
464+
[`MartinCastroAlvarez/django-admin-api`](https://github.com/MartinCastroAlvarez/django-admin-api).
464465

465466
### Pre-built `get_*` overrides still work
466467

@@ -531,8 +532,9 @@ frontend, a script).
531532

532533
Every endpoint is **staff-only by default** (or whatever
533534
`AdminSite.has_permission` returns), CSRF-required on unsafe
534-
methods, and emits `Cache-Control: no-store`. Full wire contract:
535-
[`docs/api-contract.md`](docs/api-contract.md).
535+
methods, and emits `Cache-Control: no-store`. Full wire contract
536+
lives in the API repo:
537+
[`MartinCastroAlvarez/django-admin-api`](https://github.com/MartinCastroAlvarez/django-admin-api).
536538

537539
---
538540

SECURITY.md

Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ them must not merge.
103103
`exclude`. The set of readable fields is similarly derived from
104104
`get_fields(request, obj)`/`get_fieldsets(...)`.
105105
7. **Never serialize passwords, tokens, API keys, or other secret-shaped
106-
fields.** A denylist of common patterns lives in
107-
`api/serializers.py` and is applied **on top of** the
108-
`exclude`/`readonly_fields` rules (defense in depth). Documented in
109-
`docs/api-contract.md`.
106+
fields.** A denylist of common patterns lives in the
107+
`django-admin-rest-api` package and is applied **on top of** the
108+
`exclude`/`readonly_fields` rules (defense in depth).
110109
8. **Writes always go through the admin form.** Create and update must
111110
instantiate `ModelAdmin.get_form(request, obj=...)` and call
112111
`form.is_valid()`. No manual `setattr(obj, field, ...)` from JSON.
@@ -144,22 +143,14 @@ Every endpoint added must include all of these tests before merging:
144143
## 5. Secrets in the repository
145144

146145
- `.env`, `*.pem`, `*.key`, `*.crt`, and `secrets/` are gitignored.
147-
- Never paste a token, password, or API key into any file in this repo
148-
(including `docs/agents/`, PR descriptions, Issues, Discussions, commit
149-
messages). **Partial / redacted token references** (e.g., `ghp_…XYZ`)
150-
are also forbidden and detected by the pre-commit hook +
151-
`tests/test_security.py`.
152-
- If a secret is accidentally committed, the response is:
153-
1. Rotate the secret immediately on the upstream provider.
154-
2. **Wait for human approval** before rewriting history. No agent may
155-
`git push --force` autonomously. Once approved, force-push the
156-
rewritten history that removes the secret and notify downstream
157-
consumers.
158-
3. Open a GitHub Issue labelled `incident:secret-leak` describing what
159-
happened and what was rotated. The Issue itself is the durable
160-
record; an Issue with that label active is a "kill switch" entry
161-
that disables auto-merge per
162-
`docs/agents/autonomy-policy.md` §3.
146+
- Never paste a token, password, or API key into any file in this repo,
147+
PR description, Issue, Discussion, or commit message. **Partial /
148+
redacted token references** (e.g., `ghp_…XYZ`) are also forbidden and
149+
detected by the pre-commit hook.
150+
- If a secret is accidentally committed: (1) rotate it immediately on
151+
the upstream provider; (2) request approval to rewrite history; (3)
152+
open a GitHub Issue labelled `incident:secret-leak` as the durable
153+
record.
163154
- A pre-commit hook (`.pre-commit-config.yaml`) runs `gitleaks` plus a
164155
custom `pygrep` for partial token patterns. Enable it locally with:
165156
`pre-commit install`.
@@ -176,12 +167,9 @@ Every endpoint added must include all of these tests before merging:
176167
the same.
177168
- Dev dependencies are pinned in `pyproject.toml` and locked with Poetry.
178169
Frontend dev dependencies are locked with `pnpm-lock.yaml`.
179-
- Every new third-party dependency (runtime **or** dev) requires a
180-
matching entry in `docs/agents/decisions.md` explaining why and what
181-
alternative was rejected.
182-
- Run `./scripts/audit-deps.sh` before every release. CI is intentionally
183-
absent (repo-owner direction); the dep audit is a local gate that the
184-
Merger / Releaser owns.
170+
- Every new third-party dependency (runtime **or** dev) goes through PR
171+
review explaining why and what alternative was rejected.
172+
- Run `./scripts/audit-deps.sh` before every release.
185173

186174
## 7. Build & release
187175

@@ -193,20 +181,17 @@ Every endpoint added must include all of these tests before merging:
193181
- The PyPI token lives in environment variables only
194182
(`POETRY_PYPI_TOKEN_PYPI`), never in any file in the repo. The token
195183
is **never** echoed or logged by `scripts/deploy.sh`.
196-
- Releases require a **human maintainer** (tier 6 in
197-
`docs/agents/autonomy-policy.md`). Agents do not tag, do not publish,
198-
do not auto-bump the version.
184+
- Releases require a **human maintainer**. The publish is driven by the
185+
`release.yml` workflow (OIDC Trusted Publishing — no stored token);
186+
the maintainer triggers it by publishing a GitHub Release.
199187
- TestPyPI may be used for verification by the maintainer with a
200188
separate token; same hygiene rules apply.
201189

202190
## 8. Static analysis (local + CI)
203191

204-
The earlier "local-only, no CI in v0.x" posture was revisited and
205-
reversed (issue #452 — regressions were slipping onto `main` under
206-
CodeQL-only gating; see `docs/agents/decisions.md`). **The test suites
207-
now run server-side in CI** (`.github/workflows/ci.yml`): backend
208-
`pytest` and the frontend `pnpm` gate (typecheck + lint + test + build),
209-
so a red suite cannot merge.
192+
**The test suites run server-side in CI**
193+
(`.github/workflows/ci.yml`): backend `pytest` and the frontend `pnpm`
194+
gate (typecheck + lint + test + build), so a red suite cannot merge.
210195

211196
Enforcing the **Python lint gate** in CI is a near-term follow-up:
212197
`scripts/lint.sh` currently runs two formatters (`ruff format` + `black`)
@@ -377,12 +362,13 @@ Three things remain the **consumer's** responsibility:
377362
[`MartinCastroAlvarez/django-admin-api`](https://github.com/MartinCastroAlvarez/django-admin-api/blob/main/SECURITY.md)
378363
— every API-side concern (each `/api/v1/...` endpoint, the
379364
serializer denylist, the permission gates) lives there.
380-
- [`docs/threat-model.md`](docs/threat-model.md) — STRIDE pass per
381-
endpoint group.
382-
- [`docs/agents/security-expert/AGENT.md`](docs/agents/security-expert/AGENT.md)
383-
— Security Lead role contract.
384-
- [`docs/agents/security-expert/REVIEW_CHECKLIST.md`](docs/agents/security-expert/REVIEW_CHECKLIST.md)
385-
— what Security checks on every PR.
365+
- [`README.md`](README.md) — install + three-repo cross-links.
366+
- [`ARCHITECTURE.md`](ARCHITECTURE.md) — what lives in this repo
367+
vs. the API / MCP siblings.
368+
- The **API package's** own `SECURITY.md`
369+
[`MartinCastroAlvarez/django-admin-api`](https://github.com/MartinCastroAlvarez/django-admin-api/blob/main/SECURITY.md)
370+
— for every API-side gate (each `/api/v1/...` endpoint, the
371+
serializer denylist, the permission checks).
386372

387373
## 11. Disclosure timeline
388374

docs/README.md

Lines changed: 11 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,14 @@
1-
# docs/ — long-form documentation
1+
# docs/
22

3-
What lives here:
3+
Only one subfolder lives here:
44

5-
- [`api-contract.md`](api-contract.md) — the stable wire contract between
6-
the Django backend and the React frontend. Endpoint paths,
7-
request/response shapes, error codes, ordering/search/pagination rules.
8-
- [`threat-model.md`](threat-model.md) — STRIDE threat model per endpoint
9-
+ supply-chain / logging / privacy sections. The security source of
10-
truth alongside [`SECURITY.md`](../SECURITY.md).
11-
- [`extensions.md`](extensions.md) — how consumers extend the UI without
12-
writing React (`register_field_type`, the per-model panel hook).
13-
- [`data-layer.md`](data-layer.md) — the `@dar/data` one-way data-flow
14-
rules (the only package that talks to `@dar/api`).
15-
- [`ux/`](ux/) — the UX contract the SPA implements: principles,
16-
navigation, primary flows, responsive, theming, accessibility, PWA,
17-
loading/error states.
18-
- [`consumer/`](consumer/) — real-adopter feedback + pilot requirements
19-
(input that drives the roadmap; **not** a usage guide).
20-
- [`screenshots/`](screenshots/) — UI screenshots embedded in the README.
21-
- [`agents/`](agents/) — durable inter-agent coordination artifacts:
22-
- [`decisions.md`](agents/decisions.md) — append-only log of accepted
23-
architectural decisions.
24-
- [`open-questions.md`](agents/open-questions.md) — questions awaiting
25-
resolution.
26-
- [`pr-workflow.md`](agents/pr-workflow.md) — the author/reviewer/merger
27-
protocol for autonomous PR ops.
28-
- [`autonomy-policy.md`](agents/autonomy-policy.md) — tier rules + kill
29-
switches governing what may be auto-merged vs. human-gated.
30-
- Per-role subteam docs live under `agents/` (product-manager,
31-
security-expert, software-architect, consumer).
5+
- [`screenshots/`](screenshots/) — the PyPI / GitHub landing-page
6+
screenshots referenced from the root `README.md`. The images are
7+
raw-served via GitHub from `main` so the PyPI long-description renders
8+
them. See `screenshots/README.md` for the capture contract.
329

33-
What does **not** belong here:
34-
35-
- Status / progress / changelog data — that lives on the
36-
[Project board](https://github.com/users/MartinCastroAlvarez/projects/3),
37-
in the [Issues](https://github.com/MartinCastroAlvarez/django-admin-react/issues)
38-
list, and as merged PR history.
39-
- Announcements / Q&A / community chatter — that goes in
40-
[GitHub Discussions](https://github.com/MartinCastroAlvarez/django-admin-react/discussions).
41-
- Per-PR review conversation — that goes on the PR itself.
42-
- Code or configuration — those live in their own directories.
43-
- Folder READMEs — each folder owns its own.
44-
- Secrets, tokens, or anything sensitive. This directory is committed
45-
and public.
46-
47-
Future docs (added when their PRs land):
48-
49-
- `installation.md` — deep-dive install + customization guide (the
50-
[README](../README.md) quickstart is the current entry point).
51-
- `release.md` — the release procedure (gated by repo owner; see
52-
[`SECURITY.md`](../SECURITY.md) §6–§7 for the current gated process).
10+
Everything else lives at the repo root: [`../README.md`](../README.md)
11+
(product), [`../ARCHITECTURE.md`](../ARCHITECTURE.md),
12+
[`../SECURITY.md`](../SECURITY.md). The wire contract for
13+
`django-admin-rest-api` (this package's API dependency) lives in the
14+
**[API repo](https://github.com/MartinCastroAlvarez/django-admin-api)**.

docs/agents/README.md

Lines changed: 0 additions & 95 deletions
This file was deleted.

0 commit comments

Comments
 (0)