STEP 1648 — Phase 3 Archify IR emit spike LLM 判定経路 なし test 108/108 実 render 未検証

2026-09-01 · chat-Claude 2026-08-31 Archify arc の 実質的 endpoint · src/archify-emit/ 4 file + scripts/archify-emit/emit-harvest-lag.ts CLI + data/archify-ir/harvest-lag-latest.architecture.json 実 artifact · npm archify:emit-harvest-lag / test:step1648

Overview — chat-Claude arc の 実質的 endpoint

chat-Claude 2026-08-31: 「IRさえ書ければエージェントは不要なので、 connector-inventory や comparator の 出力 JSON から IR を 機械的に 生成する経路が 作れます。 それができれば 完全に ローカル・無料・LLM なしで 図が 出ます」

本 STEP 1648 で 実装: rei-aios comparator harvest_lag report (data/comparator/harvest-lag-latest.json、 STEP 1626 v1.0 gauge) を 入力に、 Archify architecture IR を 決定的に emit。 判定経路に LLM なし、 変換規則は 全て src/archify-emit/emit-harvest-lag.ts に code として 座る (chat-Claude 「著作物ではなく 被測定を 測った結果」 の 実装条件 満たすため、 SRC evidence mode = repository URL + 40-hex commit SHA + component 単位 file:line pin を 前提化)。

1. Module 構成

File役割Side effect
src/archify-emit/types.tsArchify IR TS types (schema authoritative subset)、 id/SHA regex validatorなし
src/archify-emit/src-evidence.tsgetEvidenceContext() = git rev-parse HEAD + status --porcelain で dirty-tree 検知、 makeSource() helpergit subprocess (read-only)
src/archify-emit/emit-harvest-lag.tsemitHarvestLagIR({report, cwd?}) = 7 component + 8 connection + 2 boundary + 3 view IR 生成、 決定的 (input 同一 → output byte-identical)なし (git 呼出は src-evidence 経由のみ)
src/archify-emit/index.tsPublic re-exportなし
scripts/archify-emit/emit-harvest-lag.tsCLI runner: latest.json 読取 → IR 出力 + honest-scope.txt 併記fs write (data/archify-ir/)

2. 生成 IR schema 適合

Authoritative schema: architecture.schema.json + common.schema.json (2026-09-01 fetch、 gh api 経由 raw content)。

本 emitter で 満たしている 制約:

3. 生成 IR (Pipeline overview)

meta.title:      harvest_lag gauge pipeline — v1.0-oracle-ok-nullable-scope-note
meta.subtitle:   arxiv-recent × 9 feeds → arxiv-api oracle → 5-verdict emitter
meta.repository: https://github.com/fc0web/rei-aios
meta.revision:   535ee3f02c8b87133e11152f8fbf3a573ba77f86  (Archify verify 対象)
visual_preset:   signal-flow
animation:       trace

components (7):
  feed-source      (external)   arxiv-recent × 9 feeds
  harvester        (backend)    ← SRC scripts/comparator/run-harvest-lag-v02.ts + gauges/harvest_lag_v02.ts:196-210
  retention-gate   (security)   ← SRC gauges/harvest_lag_v02.ts:238-240 (retentionOk gate)
  oracle-arxiv-api (cloud)      ← SRC scripts/comparator/lib/oracle-arxiv.ts (createArxivOracle)
  comparator       (backend)    ← SRC gauges/harvest_lag_v02.ts:245-300 (windowCompared derivation)
  verdict-emitter  (backend)    ← SRC gauges/harvest_lag_v02.ts:240-355 (verdict decision table)
  sink-latest-json (database)   ← SRC data/comparator/harvest-lag-latest.json

connections (8):
  feed-source → harvester             "publish"
  harvester → retention-gate          "internal IDs"
  retention-gate → oracle-arxiv-api   "oracle window (if retentionOk)"  [emphasis]
  retention-gate → verdict-emitter    "skip → N/A (if retention short)" [dashed]  ← STEP 1626 v0.9 短絡
  oracle-arxiv-api → comparator       "external IDs"
  harvester → comparator              "top-N internal"
  comparator → verdict-emitter        "diff"
  verdict-emitter → sink-latest-json  "report JSON"

boundaries (2):
  region         "Measurement pipeline"  wraps harvester/retention-gate/comparator/verdict-emitter
  security-group "Oracle domain (external)" wraps oracle-arxiv-api

views (3):
  happy-path        6 focus ids  "retentionOk → oracle → 5-verdict emit"
  retention-skip    4 focus ids  "retention short → oracle skipped → verdict N/A (8/9 feeds at report time)"
  provenance        3 focus ids  "source → harvester → sink JSON (input & output traceable)"

SRC evidence: 8 source refs across components

4. Test 結果 108/108 PASS

Section内容件数
1. type validatorsisValidArchifyId (5 pass/fail cases) + isValidCommitSha (5 cases)12
2. src-evidencegetEvidenceContext (live git + dirty detection) + makeSource helper (line/end_line/label)10
3. emit against real reportschema_version + diagram_type + meta.title / repository / preset / component 7 全て存在~20
4. connection integrity各 connection の from/to が valid id、 variant enum、 dashed 分岐 (retention-skip) 検出~18
5. views (≤5)3 view 全て id/focus/note、 focus ids は component id で存在~15
6. boundaries wrap valid2 boundary、 kind enum、 wraps 全 id が component 存在~10
7. honest scope + dirty-tree honesty≥5 items、 schema/render 制限 mention~5
8. determinism同一 input で byte-identical output (JSON stringify 比較)3
9. synthetic edge casesempty perFeed / all-N/A report で tag が counts 反映~15

Total: 108 pass / 0 fail。 実行: npm run test:step1648。 STEP 1639 (88/88) + STEP 1644 (52/52) regression clean。

5. SRC evidence 運用 discipline (STEP 1625 陰性対照 と 同族)

chat-Claude 2026-08-31: 「READMEが明示しているとおり、 reach やルートは 『authored (書かれた通り)』 であって、 コードから 検証されたものではありません。 (中略) SRC マーク付きの evidence モードだけが commit 固定の ソース参照を 持ちます。 つまり既定では、 この図は 被測定を 測った結果ではなく、 著作物です」

本 emitter の discipline:

6. Honest scope (Phase 3 spike で 意図的に やっていないこと)

7. 次 STEP candidate

  1. Archify CLI 実 install + render 検証 (藤本さん judgment): clone tt-a1i/archify + node bin/archify.mjs validate/preview/deliver data/archify-ir/harvest-lag-latest.architecture.json で 実 HTML 確認、 schema validation の runtime pass も 副次的に verify 可
  2. 他 gauge emitter (freshness / feed-cadence): emit-harvest-lag.ts と 共通化する 抽象 layer 設計、 3 gauge 揃うと 一般 pattern が 見えて refactor 妥当性 判断可
  3. SRC evidence drift auditor: line 番号 drift 検知 script、 CI 化で 「file 編集で source pin が ずれた」 を automated catch
  4. Phase 2.5 verify tool: agent-connector の verify tool、 前提 (exit code semantics 実測 + verdict vocabulary) を 別 arc で 詰める
  5. connector-inventory 経路: chat-Claude 提案の もう 1 側、 rei-aios の internal connector 一覧 → IR (別 diagram type: dataflow or lifecycle 検討)