Skip to content

T5-P6-A10-WP1 Unknown-NDJSON-Vocabulary Counters#4120

Merged
Trecek merged 3 commits into
developfrom
t5-p6-a10-wp1-make-unknown-ndjson-vocabulary-occurrences-mac/4045
Jun 27, 2026
Merged

T5-P6-A10-WP1 Unknown-NDJSON-Vocabulary Counters#4120
Trecek merged 3 commits into
developfrom
t5-p6-a10-wp1-make-unknown-ndjson-vocabulary-occurrences-mac/4045

Conversation

@Trecek

@Trecek Trecek commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add ndjson_unknown_event_count and ndjson_unknown_item_count integer counters to the Codex NDJSON parsing pipeline. The counters originate at two parser layers (_CodexParseAccumulator for batch parsing, CodexStreamParser for streaming), flow through AgentSessionResult.raw, and land on ClaudeSessionResult via _adapt_agent_result. This makes unknown-vocabulary occurrences machine-readable for downstream WPs (P6-A10-WP2+) without log scraping.

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260626-235325-737964/.autoskillit/temp/make-plan/t5_p6_a10_wp1_unknown_ndjson_counters_plan_2026-06-26_235500.md

Closes #4045

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
plan* opus[1m] 1 59 16.6k 892.4k 98.0k 43 84.0k 14m 40s
verify* sonnet 1 92 9.9k 517.6k 59.6k 29 41.1k 4m 21s
implement* MiniMax-M3 1 97.8k 11.5k 2.5M 0 97 0 4m 50s
audit_impl* sonnet 1 44 13.6k 165.6k 44.3k 13 42.1k 7m 33s
prepare_pr* MiniMax-M3 1 42.6k 1.9k 112.4k 43.9k 11 0 37s
compose_pr* MiniMax-M3 1 36.0k 2.1k 142.6k 0 11 0 35s
review_pr* sonnet 1 118 57.7k 933.4k 107.5k 42 90.9k 12m 39s
resolve_review* sonnet 1 391 18.0k 3.0M 84.4k 106 66.6k 7m 49s
Total 177.1k 131.4k 8.3M 107.5k 324.6k 53m 7s

* Step used a non-Anthropic provider; caching behavior may differ.

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
plan 0
verify 0
implement 129 19020.4 0.0 89.1
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 46 66123.5 1446.8 392.3
Total 175 47196.0 1854.8 750.7

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 59 16.6k 892.4k 84.0k 14m 40s
sonnet 4 645 99.2k 4.7M 240.6k 32m 24s
MiniMax-M3 3 176.4k 15.5k 2.7M 0 6m 2s

Trecek added 3 commits June 27, 2026 00:17
…unters

T5-P6-A10-WP1: Surface unknown NDJSON vocabulary occurrences as machine-readable
counters instead of relying on log scraping.

Counter origin sites (parser layers):
- _CodexParseAccumulator: ndjson_unknown_event_count / ndjson_unknown_item_count
  incremented at CodexEventType.UNKNOWN / CodexItemType.UNKNOWN warning sites.
- CodexStreamParser: ndjson_unknown_event_count / ndjson_unknown_item_count
  init=False fields with public unknown_event_count / unknown_item_count
  properties, incremented at unknown fallthrough sites.

Data flow:
- _CodexParseAccumulator fields -> CodexResultParser.parse_stdout raw dict.
- CodexResultParser raw dict -> AgentSessionResult.raw (preserved by adapter).
- AgentSessionResult.raw -> ClaudeSessionResult via _adapt_agent_result ->
  seen_ndjson_unknown_event_count / seen_ndjson_unknown_item_count.

Defaults are 0, so existing call-sites and ClaudeSessionResult constructors
compile without changes.

Tests:
- TestCodexUnknownCounters: 4 stream/accumulator counter tests.
- test_adapt_agent_result: 4 counter round-trip tests + completeness updates.
- test_codex_result_parser: 2 raw dict shape tests + completeness updates.
…liases from CodexStreamParser

The properties were trivial one-liner aliases for ndjson_unknown_event_count /
ndjson_unknown_item_count, creating a naming inconsistency (dropping the ndjson_
prefix). Remove them and update test assertions to use the backing field names
directly, unifying the naming convention across the class.
…r test to correct file

test_ndjson_unknown_counters_default_zero duplicated assertions already present in
test_hardcoded_thinking_defaults (L61-62). Removed to avoid double maintenance.

test_scan_codex_ndjson_accumulator_counters_increment_independently tests
_scan_codex_ndjson (a batch parser) but was placed in test_codex_stream_parser.py.
Moved to TestScanCodexNdjson in test_codex_result_parser.py where all
_scan_codex_ndjson tests live.
@Trecek Trecek added this pull request to the merge queue Jun 27, 2026
Merged via the queue into develop with commit c6c6551 Jun 27, 2026
0 checks passed
@Trecek Trecek deleted the t5-p6-a10-wp1-make-unknown-ndjson-vocabulary-occurrences-mac/4045 branch June 27, 2026 08:03
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.

1 participant