scripts: add relation_export.py to re-export the call catalog #2
Loading…
Reference in a new issue
No description provided.
Delete branch "findings/relation-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a re-runnable exporter so the GET_RELATION / PUT_RELATION catalog can be
refreshed after an ERP update, and regenerates the artifacts with it so the
committed files are byte-exactly what the script produces.
boundaries only where the signature occurs, parses the ",,,,"-delimited record
grammar, and writes both findings artifacts. --check reports counts without
writing; --diff <old.tsv> reports ids added / removed / retitled, which is the
intended way to see what an ERP update changed:
python scripts/relation_export.py --check --diff findings/relation-api-index.tsv
(1994 entries, GET 1532 / PUT 462). Verified idempotent - a second run diffs
0 added / 0 removed / 0 retitled - and the index is structurally clean
(1994 rows, every row 4 fields, no bare CR).
Bugs found and fixed while porting the extraction from PowerShell to Python:
for 1994 entries); CR/LF/TAB are now flattened out of titles before writing
recovered two entries that previously failed the title filters
Corrects an earlier figure: the "96 sections carry residual garbage" number came
from a density check that counted newlines as non-text characters. Measured
correctly, 15 of 1994 entries carry any residue, none exceeds 20 characters, and
the worst two (PUT 850, GET 861) are damaged in the vendor's own record.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01SMfjq7F6zwbmxDNW6kuerx
Adds a re-runnable exporter so the GET_RELATION / PUT_RELATION catalog can be refreshed after an ERP update, and regenerates the artifacts with it so the committed files are byte-exactly what the script produces. - scripts/relation_export.py: read-only on C:\ERP. Strips 2048-byte block boundaries only where the signature occurs, parses the ",,,,"-delimited record grammar, and writes both findings artifacts. --check reports counts without writing; --diff <old.tsv> reports ids added / removed / retitled, which is the intended way to see what an ERP update changed: python scripts/relation_export.py --check --diff findings/relation-api-index.tsv - findings/relation-api-catalog.md, findings/relation-api-index.tsv: regenerated (1994 entries, GET 1532 / PUT 462). Verified idempotent - a second run diffs 0 added / 0 removed / 0 retitled - and the index is structurally clean (1994 rows, every row 4 fields, no bare CR). - findings/relation-api.md: counts and imperfection figures corrected to match. Bugs found and fixed while porting the extraction from PowerShell to Python: - a title containing a bare CR split its own row in the index (1995 file lines for 1994 entries); CR/LF/TAB are now flattened out of titles before writing - a match whose title had no letter at all (e.g. ",") was kept as a definition - dense runs of binary bleed are now cut back to the readable prefix, which also recovered two entries that previously failed the title filters Corrects an earlier figure: the "96 sections carry residual garbage" number came from a density check that counted newlines as non-text characters. Measured correctly, 15 of 1994 entries carry any residue, none exceeds 20 characters, and the worst two (PUT 850, GET 861) are damaged in the vendor's own record. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SMfjq7F6zwbmxDNW6kuerx