Skip to content

SOW-0048: reduce rollout adapter scan/tail complexity#59

Merged
ktsaou merged 1 commit into
masterfrom
codex/sow-0048-codex-adapter-complexity
Jun 6, 2026
Merged

SOW-0048: reduce rollout adapter scan/tail complexity#59
ktsaou merged 1 commit into
masterfrom
codex/sow-0048-codex-adapter-complexity

Conversation

@ktsaou

@ktsaou ktsaou commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Add deterministic scan and tail benchmarks to the adapter benchmark gate and CI benchmark inventory.
  • Split scanner and tailer hot paths into focused helpers while preserving cursor, source containment, EOF finalization, and watch behavior.
  • Complete SOW-0048 and draft SOW-0053 for residual mapper/parser/stream complexity.

Validation

  • ./scripts/gates.sh: PASS (593s)
  • Local changed-file static analysis: 0 issues across 7 tools
  • Second-opinion review: converged with no blocking findings

Summary by cubic

Reduces Codex adapter scan/tail complexity by splitting hot paths into focused helpers, and adds deterministic Scan/Tail benchmarks enforced in CI to guard performance.

  • New Features

    • Added deterministic Codex Scan and Tail benchmarks in internal/adapters/codex/bench_test.go using a synthetic corpus.
    • Wired Codex benchmarks into scripts/check-bench.sh and .github/workflows/ci.yml; baseline updated in bench/baseline.txt.
    • Quality gate docs updated to track 9 performance-critical benchmarks across 6 packages.
  • Refactors

    • Decomposed tailer into tailer_loop.go, tailer_events.go, tailer_watch.go, and tailer_flush.go; simplified tailer.go.
    • Streamlined scanner.go with cursor normalization, resolved-root handling, and focused helpers; progress emission kept deterministic.
    • Preserved cursor semantics, source containment, EOF finalization, and watch behavior; updated tests for new helper signatures.
    • Marked SOW-0048 complete and drafted SOW-0053 for residual mapper/stream complexity.

Written for commit b84d9b3. Summary will update on new commits.

Review in cubic

Add deterministic scan and tail benchmarks to the adapter benchmark gate and CI benchmark inventory.

Decompose scanner and tailer hot paths into focused helpers while preserving cursor, source containment, EOF finalization, and watch behavior.

Track residual mapper, parser, and stream complexity in SOW-0053.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 131 complexity · 12 duplication

Metric Results
Complexity 131
Duplication 12

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 18 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

@ktsaou ktsaou merged commit 732c6f6 into master Jun 6, 2026
14 checks passed
@ktsaou ktsaou deleted the codex/sow-0048-codex-adapter-complexity branch June 6, 2026 14:20
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