atif-sql · Sequences
Section titled “atif-sql · Sequences”materialize
Section titled “materialize”Sources, in dispatch order:
- CLI materialize:
packages/atif-cli/src/atif_cli/app.py:878; report rendered at:1042. - materialize UC:
packages/atif-corpus/src/atif_corpus/application/materialize.py:1497;read_watermarkat:424called from:1620,scan_sourcescalled at:1622,build_plancalled at:1696,_write_sessionat:612called from:777, watermark advanced at:1776-1779, report built at:1791. - scanner:
packages/atif-corpus/src/atif_corpus/infrastructure/scanner.py:206. - build_plan:
packages/atif-corpus/src/atif_corpus/domain/sessions.py:169. - RealConverter:
packages/atif-cli/src/atif_cli/converter_adapter.py:80, callingpackages/atif-converter/src/atif_converter/application/convert_and_audit.py:220. - converter: our ported Claude Code converter,
packages/atif-converter/src/atif_converter/domain/claude_code_conversion.py:981, reached from the seam atpackages/atif-converter/src/atif_converter/infrastructure/harbor_adapter.py:128; the ATIF data classes and the validator the seam checks with (:76) are harbor’s, vendored underatif_converter.domain.atif. - corpus artifacts: path arithmetic in
packages/atif-corpus/src/atif_corpus/domain/layout.py:65; the artifacts written and the directory swapped atpackages/atif-corpus/src/atif_corpus/application/materialize.py:691-733throughwrite_json_atomic(packages/atif-corpus/src/atif_corpus/infrastructure/atomic.py:72), its zstd siblings (:142,:159), andreplace_dir_atomic(:165).
Sources, in dispatch order:
- CLI query:
packages/atif-cli/src/atif_cli/app.py:1389;duckdb.connect()at:1564, the lake attached at:1570when it holds the corpus,registercalled at:1574,_harden_query_connectionat:537called from:1583, caller SQL executed at:1605, emit at:1611. - atif_duck register:
packages/atif-duck/src/atif_duck/infrastructure/registry.py:2185, whose documented order is fixed at:2205-2213:register_raw:637(register_lake_rawinstead when the lake is attached),register_views:1024,register_vss:1642,register_macros:1946, then the authorship surface and the analytics pair. - DuckDB in-process: the connection opened by the CLI; the sandbox settings and
lock_configurationare issued against it atpackages/atif-cli/src/atif_cli/app.py:597-606. - corpus artifacts: on the per-session path, session globs read through
read_jsonatpackages/atif-duck/src/atif_duck/infrastructure/registry.py:754-769; the analytics parquets bind throughpackages/atif-duck/src/atif_duck/infrastructure/analytics.py:119, with the analytics macros at:236. - Lance store: written by atif-embed and read here, both through DuckDB’s lance extension;
packages/atif-duck/src/atif_duck/infrastructure/registry.py:1703-1722loads it and ATTACHes the store (installing it isinstall_lance_extensionat:1626, behindatif-sql embed); the stamped(model, dim)identity is read at:1767and checked bypackages/atif-duck/src/atif_duck/domain/embedding_guard.py:51. - stdout emitter:
packages/atif-cli/src/atif_cli/output.py:158; a registration failure routes throughpackages/atif-cli/src/atif_cli/duck_errors.py:67instead.
analyze
Section titled “analyze”Sources, in dispatch order:
- CLI analyze:
packages/atif-cli/src/atif_cli/app.py:1725; settings resolved at:1791-1798,run_analyzecalled at:1809. - run_analyze:
packages/atif-analytics/src/atif_analytics/application/analyze.py:37; thestageslist at:103-108, each stage invoked at:129. - CorpusReader:
packages/atif-analytics/src/atif_analytics/infrastructure/corpus_reader.py:314, constructed once per run atpackages/atif-analytics/src/atif_analytics/application/analyze.py:62;session_textatpackages/atif-analytics/src/atif_analytics/infrastructure/corpus_reader.py:484. - LLM stages: the classify exemplar at
packages/atif-analytics/src/atif_analytics/application/use_cases/classify.py:374; structured call dispatched atpackages/atif-analytics/src/atif_analytics/application/use_cases/classify.py:218, its user message the fenced transcript and request line built bypackages/atif-analytics/src/atif_analytics/application/prompts.py:742. - provider adapter: built once per stage by
packages/atif-analytics/src/atif_analytics/application/use_cases/_shared.py:36throughbuild_structured_provideratpackages/atif-models/src/atif_models/infrastructure/providers.py:20, which returnsOpenAiBedrockProviderfor the defaultopenaifamily (packages/atif-models/src/atif_models/infrastructure/openai_bedrock.py:81;classify_structuredat:149, response parsed into the schema instance at:201) andAnthropicBedrockProviderforanthropic(packages/atif-models/src/atif_models/infrastructure/anthropic_bedrock.py:130;classify_structuredat:185, response parsed at:239). - Bedrock runtime: blocking
invoke_modelatpackages/atif-models/src/atif_models/infrastructure/openai_bedrock.py:193andpackages/atif-models/src/atif_models/infrastructure/anthropic_bedrock.py:231, on thebedrock-runtimeclient both adapters build throughpackages/atif-models/src/atif_models/infrastructure/bedrock_common.py:88. - analytics dir:
<corpus_root>/analytics/, defined atpackages/atif-analytics/src/atif_analytics/domain/layout.py:51, holding both the sharded parquet caches (write_partpackages/atif-analytics/src/atif_analytics/infrastructure/parquet_cache.py:90, called atpackages/atif-analytics/src/atif_analytics/application/use_cases/classify.py:282) and the single SQLite WALstate.db(packages/atif-analytics/src/atif_analytics/domain/layout.py:81). - analytics dir, SQLite arm:
filter_unchangedpackages/atif-analytics/src/atif_analytics/infrastructure/sqlite_state/checkpointer.py:137called atpackages/atif-analytics/src/atif_analytics/application/use_cases/classify.py:115;mark_completedpackages/atif-analytics/src/atif_analytics/infrastructure/sqlite_state/checkpointer.py:300called atpackages/atif-analytics/src/atif_analytics/application/use_cases/classify.py:290; retry drainpackages/atif-analytics/src/atif_analytics/infrastructure/sqlite_state/retry_queue.py:265called atpackages/atif-analytics/src/atif_analytics/application/use_cases/classify.py:124.