CAPTURE WAVE1 IMPLEMENTATION PROMPT
You are implementing one focused acquisition lane in:
Presentation-only rendering. Counterpedia preserves this document’s source Markdown bytes exactly and formats them for reading here. This does not admit the document, verify its claims, or convert it into a governed Counterpedia entry.
You are implementing one focused acquisition lane in:
thelaplage/counterpedia-acquisition
Binding preflight
Expected base:
main = eac638def41922fdaacfa04d1b0302de9d2ed5e7
Target:
branch:
feat/demo-corpus-capture-wave1-v0-1worktree:
~/Developer/worktrees/counterpedia-acquisition-demo-corpus-capture-wave1-v0-1
There is currently a separate docs-only open PR #9 (chore/claude-md-authority-header-v0-1) based on the same main. Re-check live state before editing. If origin/main has moved from the expected SHA, STOP and report the new full SHA rather than silently rebasing this frozen pack.
Read first:
README.mdNON_AUTHORITY.mdsrc/acquisition/capture.pysrc/acquisition/fetch.pysrc/acquisition/fs_store.pysrc/acquisition/program.pyexisting schema-generation/tests
The current acquisition design is authoritative for this lane. Do not redesign identity or authority.
Inputs copied into the worktree
Under:
docs/demo-corpus-capture-wave1/
you will receive:
CAPTURE_WAVE1_CONTRACT.mdCAPTURE_WAVE1_P0_MANIFEST.jsonCAPTURE_WAVE1_P0_MANIFEST.tsvMANIFEST_SUMMARY.mdall 12 research dossiers
final capability matrix
One job
Implement a bounded local corpus capture runner that uses the already-merged acquisition primitives to execute the P0 manifest and export exact capture evidence.
Do NOT add admission, standing, publication, claim adjudication, confidence scoring, or canonical Counterpedia identity.
Required implementation
1. scripts/run_demo_corpus_capture.py
CLI contract:
python3 scripts/run_demo_corpus_capture.py \
--manifest docs/demo-corpus-capture-wave1/CAPTURE_WAVE1_P0_MANIFEST.json \
--output /ABSOLUTE/RUN/DIR \
[--subject SUBJECT_KEY ...] \
[--batch technical|legal|measurement] \
[--max-bytes 134217728] \
[--timeout-s 120]Requirements:
default run attempts every eligible P0 entry once;
use
AcquisitionProgramV0_1+AcquisitionController;use
HttpFetcher;use
FilesystemObjectStorerooted under the run directory;use
CrawlPolicy.SINGLE_FETCH;no autonomous open-web crawl;
do not call model observer / candidate projection / content proposal;
no live network in tests;
every locator disposition must appear in output;
blocked/discovery-only modes must not be silently converted to fetch success.
2. durable run export
Create:
run.json
program.json
manifest.snapshot.json
attempts.jsonl
receipts.jsonl
failures.jsonl
lineage_hints.jsonl
anchors.jsonl
objects/manifest.snapshot.json must be exact input bytes or byte-identical canonical copy with its sha256 recorded in run.json.
Receipt JSON must serialize the canonical existing CaptureReceipt, not a competing receipt type.
3. passage anchoring
Add the narrowest deterministic extraction code needed for non-authoritative passage location.
A suitable module name:
src/acquisition/passage_anchor.py
Requirements:
frozen Pydantic model;
extra="forbid";schema version constant;
binds to
capture_id+exact_bytes_sha256;records extractor ID/version;
no truth/confidence/standing fields;
no claim semantics.
HTML:
exact HTTP bytes are the source;
deterministic text extraction;
source byte artifact remains authoritative.
PDF:
deterministic page text extraction;
add a small, explicit runtime dependency only if needed;
record dependency/extractor version;
NO OCR in v0.1;
image/graph-only pages get page/figure anchors or explicit
ANCHOR_UNAVAILABLE_IMAGE_ONLY;Titan
TIT-S07andTIT-S08are regression fixtures for image-heavy PDFs once live execution occurs.
Do not derive "best passages." Export mechanical page/text spans. Research/adjudication will select them later.
4. research lineage hints
Do NOT create canonical SourceEdition.
Export manifest-declared relation hints after digest resolution.
A hint may bind:
source inventory key A/B;
artifact digest A/B where known;
relation string from manifest;
status
research_hint_only.
Known regression examples:
LEH-S02issame_artifact_sectionofLEH-S01;CA-S23issame_artifact_sectionofCA-S11;COV-S15is a formal erratum/correction child ofCOV-S14;current WHO/COVID rows include corrected/updated-edition warnings;
Theranos
TH-S09current amended Ninth Circuit opinion must not silently equal the earlier opinion.
5. capture-mode discipline
Implement explicit handling for manifest modes.
FETCH_DIRECT
fetch exactly requested URL.
DISCOVERY_PAGE / DISCOVERY_INDEX
fetch the page only; do not recursively fetch every link.
MULTI_ARTIFACT_SOURCE
fetch the requested/landing artifact and emit
child_resolution_required=true.no recursive crawler in this PR.
DISCOVERY_REQUIRED
no fake fetch; disposition must say unresolved.
ORIGIN_REQUIRED
no mirror substitution. If requested locator is a recon/mirror landing, emit origin-resolution requirement unless the manifest explicitly permits direct origin.
EXPAND_LINKED_PACKAGE
capture landing page only in this PR and emit an operator-approved child queue. No unrestricted recursion.
SAME_ARTIFACT_SECTION
do not fetch; resolve after referenced artifact is captured and emit passage-section anchor/hint.
BLOCKED_PRIMARY_BYTES
record blocked and continue.
6. test requirements
No live network.
Add synthetic local HTTP server fixtures and deterministic PDF/HTML fixtures sufficient to test:
200 success → bytes in FilesystemObjectStore → receipt serialized;
redirect final URL preserved while source identity remains original URL-derived;
same bytes from two attempts → one object file, two receipts;
failed fetch → no object, no fake receipt;
manifest validation rejects duplicate capture keys;
non-http(s) requested locators rejected;
BLOCKED_PRIMARY_BYTESdoes not fetch;SAME_ARTIFACT_SECTIONdoes not fetch;MULTI_ARTIFACT_SOURCEfetches landing only and flags child resolution;run export deterministic ordering;
passage anchors bind exact artifact digest and capture ID;
extractor/version recorded;
image-only PDF/page yields explicit unavailable/figure state, no invented text;
lineage hints have no authority fields;
no
admit,approve,publish,standing,canonical_id,cp:identifiers added;git diff --check.
Run full suite.
Files/data boundary
Captured real-world bytes and generated run directories MUST NOT be committed to git.
If needed, add a narrow ignore rule such as:
capture-runs/
but do not ignore test fixtures or manifest files.
The manifest/dossiers are input docs and may be committed as the lane's reproducible run contract.
Commit / PR discipline
One focused commit.
Suggested commit:
feat(acquisition): add Demo Corpus P0 capture wave runner v0.1
Push branch and open a draft PR.
Do not merge.
PR body must state:
exact base SHA;
manifest entry count = 112;
authority boundary unchanged;
no adjudication;
real-world network capture was NOT part of unit tests;
generated source bytes are not committed;
full local test result;
git diff --checkresult;any implementation STOP/HOLD.
Final report
Return:
base SHA verified;
branch/worktree;
files changed;
test counts;
exact commit SHA;
draft PR URL;
any blockers;
exact command to run the first real P0 capture after review.