ahnaftaz's picture
Add dataset card metadata
9db86c6 verified
|
Raw
History Blame Contribute Delete
5.47 kB
---
pretty_name: Locus Repository Code Pool
language:
- code
license: other
task_categories:
- text-generation
size_categories:
- 1M<n<10M
---
# Locus repository code pool
The Locus repository code pool contains curated repository-version documents
for code-language-model research. Each row combines the useful files from one
Git repository snapshot into a single deterministic text document while
retaining source provenance, file order, language and test signals, health
evidence, and stable content hashes.
This release is a **candidate acquisition pool**, not a ready-made training
split. Use a globally deduplicated manifest before training.
## Source and curation
Rows were derived from
[`HuggingFaceCode/stack-v3-train`](https://huggingface.co/datasets/HuggingFaceCode/stack-v3-train)
at pinned revision
`80a7f793eb87d89a7835c3585090427039da0ad3`.
The pipeline:
1. grouped complete repository versions;
2. removed holdout-matching, vendored, generated, lock, binary, minified,
secret-marked, empty, pathological, and exact-duplicate files;
3. bounded unusually long files;
4. annotated language, file purpose, parser health, redaction damage, tests,
and derived health bands;
5. rendered surviving files in deterministic path order; and
6. uploaded JSONL shards, then verified their immutable bytes, hash, and row
count from Hugging Face.
No model-generated code is added by this pipeline.
## Dataset size
Final acquisition accounting on 13 August 2026:
| Measure | Value |
|---|---:|
| Immutable-verified physical rows | 4,216,896 |
| Globally reconciled unique repository documents | 3,879,232 |
| Exact repeated physical rows | 337,664 |
| Stable-ID/content conflicts | 0 |
| Stored data | 200,455,341,421 bytes (186.689 GiB) |
The rough planning estimate is 27.543B unique tokens using 7,100 tokens per
document. This is **not an exact tokenizer count** and is not a claim about
tokens consumed in training.
## Row format
Every JSONL line uses the `locus.item/v1` envelope:
```json
{
"schema_version": "locus.item/v1",
"id": "repository_<stable digest>",
"parents": ["<included file IDs>"],
"provenance": {
"dataset": "HuggingFaceCode/stack-v3-train",
"revision": "<pinned revision>",
"repository_name": "owner/repository",
"commit_id": "<commit>",
"content_sha256": "<payload hash>",
"shape": "repository"
},
"meta": {
"file_count": 12,
"file_order": ["README.md", "src/main.py"],
"programming_languages": ["markdown", "python"],
"has_tests": true,
"repository_health_band": "B"
},
"annotations": {
"programming_languages": ["markdown", "python"],
"has_tests": true,
"repository_health_band": "B"
},
"payload": "<|repo_start|>owner/repository@commit\n<|file_start|>README.md\n..."
}
```
`payload` is the model-facing text. It uses explicit repository and file
boundaries: `<|repo_start|>`, `<|repo_end|>`, `<|file_start|>`, and
`<|file_end|>`.
## Loading the JSONL
For a private checkout, authenticate with Hugging Face first, then load the
shards as JSON:
```python
from datasets import load_dataset
dataset = load_dataset(
"json",
data_files="hf://datasets/ahnaftaz/locus-repo-code-pool-v2/**/*.jsonl",
split="train",
)
print(dataset[0]["payload"])
```
Before training, collapse exact repeated rows by stable `id` and canonical row
hash, fail closed on any same-ID/different-content pair, tokenize the selected
payloads exactly, and freeze the selected IDs and weights in a corpus manifest.
For causal-language-model training, preserve repository/file boundaries while
packing. Long rows should be split deterministically at file boundaries where
possible, with the repository header and parent document ID retained for each
window. The four literal boundary strings may be kept as normal tokenizer input
or registered as reserved tokens; whichever choice you make should be versioned
with the training manifest. Fill-in-the-middle and repository-context objectives
are reasonable experiments, but they are not baked into the stored dataset.
## Intended uses
- pretraining and continued pretraining for code models;
- repository-aware completion and retrieval experiments;
- language, file-purpose, quality, and repository-context mixture studies; and
- data-quality research using the structured provenance and health fields.
## Limitations and responsibility
- The data represents repository snapshots, not Git histories, commits, pull
requests, issue discussions, or execution traces.
- Marker-based holdout filtering reduces known overlap but does not prove full
benchmark decontamination.
- Some early rows contain less detailed lineage metadata than the latest
recipe; treat missing evidence as unknown, not false or zero.
- Stack v3 redacts PII upstream, which can occasionally damage source text.
- Health bands are heuristics and should not be treated as correctness labels.
- Source code remains governed by its original repository/file licenses and
attribution requirements. Stack v3's dataset terms do not replace them.
- Do not train directly on the physical row count: the pool contains exact
cross-lane repeats that must be removed or intentionally weighted.
## Acknowledgements
The source corpus is The Stack v3 by the BigCode/Hugging Face community. Locus
adds deterministic repository assembly, conservative filtering, structured
evidence, durable upload verification, and global reconciliation.