Skip to content

docs(taxonomy): #600 link_* apply harness — dry-run, drift-free (#595), gated post-release - #622

Merged
jsboige merged 1 commit into
masterfrom
docs/600-link-apply-harness
Jul 1, 2026
Merged

docs(taxonomy): #600 link_* apply harness — dry-run, drift-free (#595), gated post-release#622
jsboige merged 1 commit into
masterfrom
docs/600-link-apply-harness

Conversation

@jsboige

@jsboige jsboige commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

SECONDAIRE of ai-01 deep-queue supersede #3 (msg-…v95b6l): the apply harness for the #600 step "ratify → apply" (§6), built from the #618 sidecar (2934 candidate link_<lang> URLs). Dry-run only — 0 write Cards/ (pre-tag freeze).

The gated post-release --apply path is wired but not exercised this tick.

What it delivers

Headline result — apply is safe, drift-free, zero-clobber

Every one of the 2934 candidates targets a cell that is currently emptyskip-nonempty = 0, i.e. the gated apply would overwrite nothing. Combined with 0 orphan-PK, 0 col-missing, 0 duplicate-(key,lang), and both CSVs verified #595 drift-safe, the apply is a clean additive fill.

Metric Count
cands 2934
would-apply 2934
skip-nonempty 0
orphan-PK 0
col-missing 0
homonym 0

CSV dialect (drift-safety)

dataset BOM records CRLF-records intra-cell-LF (benign) #595 drift-safe
fallacies False 1409 1409 144 ✅ yes
virtues False 224 224 0 ✅ yes

(The 144 lone LFs in fallacies are intra-cell newlines in quoted multiline cells, not record terminators — CRLF-count = record-count exactly. Preserved by the csv round-trip.)

Spot-validation (§6.4, AR/FA/ZH)

All 2754 fallacies URLs host-match their declared language ({lang}.wikipedia.org, 0 mismatch). Decoded sample correct in script and concept — ar احتكام إلى الجهل (ignorance), zh 合成謬誤 (composition), zh 定錨效應 (anchoring). No English-homonym leaks (homonym = 0), consistent with the #618 resolver's own §6.4 scan.

How to apply (gated, post-release)

python docs/taxonomy/600-link-apply.py            # dry-run (0 write)
python docs/taxonomy/600-link-apply.py --apply     # drift-free fill, skips non-empty
python docs/taxonomy/600-link-apply.py            # verify: would-apply → ~0

Safety / scope

  • docs/taxonomy/ only — harness + report. 0 write Cards/, 0 AssetConverter code change (pre-tag safe). Base d0856aa4.
  • ✅ PK detection is case-insensitive (Fallacies=PK, Virtues=pk).

Relates to #600, #618, #595, #192.

…free, gated post-release

SECONDAIRE of ai-01 deep-queue supersede #3 (msg-...v95b6l): the apply
harness for the #600 step "ratify -> apply" (§6), built from the #618
sidecar (2934 candidate link_<lang> URLs). Dry-run only — 0 write Cards/.

What it delivers:
  - drift-free write path (#595: QUOTE_MINIMAL + quotechar " + CRLF +
    UTF-8 no-BOM), verified to match the on-disk dialect of both CSVs.
  - skip-non-empty — refuses to overwrite any filled link_<lang> cell.
  - spot-validation ~5% of the AR/FA/ZH residue (§6.4 homonym risk):
    80 candidates inspected.

Dry-run headline (master d0856aa):
  - cands=2934, would-apply=2934, skip-nonempty=0 -> zero clobber.
  - 0 orphan-PK, 0 col-missing, 0 duplicate-(key,lang), 0 homonym.
  - Both CSVs #595 drift-safe (Fallacies: 1409 records = 1409 CRLF +
    144 intra-cell-LF benign; Virtues: 224 = 224 CRLF, 0 intra-cell-LF).
  - All 2754 fallacies URLs host-match their declared language (0 mismatch).
  - Spot-sample decoded correct: ar احتكام إلى الجهل (ignorance),
    zh 合成謬誤 (composition), zh 定錨效應 (anchoring) — no English leak.

The --apply path is wired but NOT exercised (freeze forbids Cards/
write). Post-release: `python docs/taxonomy/600-link-apply.py --apply`.

PK detection is case-insensitive (Fallacies='PK', Virtues='pk').

Scope: docs/taxonomy/600-link-apply.py + 600-link-apply-report.md only.
0 write Cards/, 0 AssetConverter code change. Base d0856aa.

Relates to #600, #618, #595, #192.

Co-Authored-By: Claude-Code <noreply@anthropic.com>

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NanoClaw]

LGTM deep-tier — #600 link_* apply harness, DRY-RUN by default, drift-free (#595) ready. Scope = docs/taxonomy/ only, 0 write Cards/ committed.

Vérifié firsthand (code lu ligne-par-ligne au head)

1. DRY-RUN default = 0 write ✓ : audit() (l.111-191) est strictement read-only (seul os.path.exists, aucun open(…w)/subprocess/write). Le seul write du script (os.fdopen(fd,"w") l.271) est dans apply_changes() (l.230), appelé UNIQUEMENT si --apply (l.290 if a.apply:). Sans flag → audit() pur read.

2. Drift-free method sound (#595) ✓ : tempfile.mkstemp + os.replace (atomic), csv.writer(quoting=QUOTE_MINIMAL, quotechar='"', lineterminator='\r\n'), UTF-8 no-BOM — matche exactement le spec #595 + la dialect on-disk des CSVs.

3. Skip-non-empty (drift-free sémantique) ✓ : if is_filled(cur) and not force_clobber: skipped+=1; continue — refuse d'écraser toute cellule déjà remplie. --force-clobber explicit + "DANGEROUS" off par défaut.

4. Sidecar = #618 : SIDECAR = {fallacies: 600-link-resolve-fallacies.csv, virtues: …virtues.csv}, schema dataset,key,link_lang,resolved_url. Cible link_<lang> (ru/pt/es/ar/fa/zh), link_en excluded (déjà 100% — cohérent census #619).

5. Report arithmétiquement self-consistent ✓ (pas fabriqué) : per-dataset×lang = fallacies 547+488+434+426+367+492 = 2754 ; virtues 56+25+46+4+4+45 = 180 ; total 2754+180 = 2934 = headline claim exact. skip_nonempty=0 (tous ciblent cellules vides = fill additif propre), orphan_pk=0, col_missing=0, homonym=0.

△ Concern mineur (non bloquant, info) : la claim « 2934/2934 ciblent cellules vides » est forte (skip_nonempty=0). Plausible — les colonnes link_ non-EN étaient les cibles backfill (EN prioritaire déjà 100%), donc vides par construction. Mais seule l'exécution réelle contre les CSVs live le confirmerait à 100% ; le report est l'output d'audit runné (date 2026-07-01, base d0856aa), pas une prédiction. Si tu veux durcir : re-run python 600-link-apply.py post-pull et diff les totals vs le report commité.

@jsboige
jsboige merged commit e7b0ea7 into master Jul 1, 2026
3 checks passed
@jsboige
jsboige deleted the docs/600-link-apply-harness branch July 1, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants