diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..0013601c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,48 @@ +# .gitattributes +# Controls git archive exports and helps categorize repo contents. +# export-ignore: excluded from `git archive` tarballs and sparse-export contexts. +# +# For agents blocked by repo size on clone, see CONTRIBUTING.md §"Large-Repo Clone Strategy". + +# ── Documentation & reports (not needed for runtime or tests) ────────────────── +docs/ export-ignore +reports/ export-ignore +audits/ export-ignore +reviews/ export-ignore +paper/ export-ignore +scaffold/ export-ignore +playground/ export-ignore +examples/ export-ignore +intelligence/ export-ignore + +# Root-level narrative docs (keep CLAUDE.md, README.md, CONTRIBUTING.md) +FINDINGS-*.md export-ignore +FIRST_LIGHT_REPORT*.md export-ignore +INVESTIGATION_*.md export-ignore +LEGACY_MATRIX_AUDIT.md export-ignore +SOUL.md export-ignore +POLICY.md export-ignore +BROWSER_CONTRACT.md export-ignore +EVENNIA_NEXUS_EVENT_PROTOCOL.md export-ignore +GAMEPORTAL_PROTOCOL.md export-ignore +DEVELOPMENT.md export-ignore + +# ── Operation-specific directories ──────────────────────────────────────────── +operation-get-a-job/ export-ignore +operations/ export-ignore +org/ export-ignore +concept-packs/ export-ignore +evolution/ export-ignore + +# ── Assets (binary/media files not needed for CI) ───────────────────────────── +assets/ export-ignore +icons/ export-ignore + +# ── Linguist overrides (GitHub/Gitea language stats) ────────────────────────── +docs/ linguist-documentation +scaffold/ linguist-documentation +paper/ linguist-documentation +reports/ linguist-documentation +audits/ linguist-documentation + +*.md linguist-documentation diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 70ccff2c..e23dab4d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -136,6 +136,44 @@ Hotfixes require: --- +## Large-Repo Clone Strategy + +Some repos in this org (hermes-agent, the-nexus as it grows) can exceed 1000 tracked files, which causes `git clone --depth 1` to time out and also hits the Gitea tree-API cap of 1000 entries. + +### Recommended clone patterns for agents + +**Blobless partial clone** — fastest overall; metadata arrives immediately, blobs are fetched on demand: +```sh +git clone --filter=blob:none --depth 1 +``` + +**Treeless partial clone** — skips tree objects for past commits; best when you need full working tree but not history: +```sh +git clone --filter=tree:0 +``` + +**Sparse checkout** — only materialise the subdirectories you actually need: +```sh +git clone --filter=blob:none --no-checkout myrepo +cd myrepo +git sparse-checkout init --cone +git sparse-checkout set nexus tests # only check out these dirs +git checkout main +``` + +### Gitea tree API workaround + +When the tree endpoint returns exactly 1000 entries and you suspect truncation, pass `recursive=1` and page through with the `page` parameter: +``` +GET /api/v1/repos/{owner}/{repo}/git/trees/{sha}?recursive=1&page=2 +``` + +### Why `.gitattributes` export-ignore exists + +Directories marked `export-ignore` in `.gitattributes` are excluded from `git archive` tarballs and future sparse-export tooling. This reduces the surface area for export-based agent workflows. It does **not** affect `git clone` directly — use the partial-clone flags above for that. + +--- + ## Stale PR Policy A cron job runs every 6 hours and auto-closes PRs that are: