Skip to content

Complete SOW-0049 Opencode complexity reduction#60

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

Complete SOW-0049 Opencode complexity reduction#60
ktsaou merged 1 commit into
masterfrom
codex/sow-0049-opencode-adapter-complexity

Conversation

@ktsaou

@ktsaou ktsaou commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Complete SOW-0049 Opencode adapter complexity reduction.
  • Add deterministic Opencode scan and tail benchmarks, plus benchmark-gate inventory updates.
  • Harden read-only SQLite DSN handling, CLI source path normalization, source identity propagation, and cursor target guards.
  • Move SOW-0049 to completed.

Validation

  • ./scripts/gates.sh passed locally.
  • git diff --check && git diff --cached --check passed.
  • scripts/spec-drift.sh passed.
  • scripts/scan-secrets.sh passed.
  • External review converged through Round 12.

Summary by cubic

Completes SOW-0049 by simplifying the opencode adapter and hardening its read‑only SQLite handling. Adds deterministic Scan/Tail benchmarks and raises the performance gate to 11 required benchmarks.

  • Refactors
    • opencode: split complex paths into helpers (batch collection, row handlers, WAL watcher, LLM op close) for clearer control flow and fewer branches.
    • Cursor safety: added TargetHash; scan/tail now guard against DB target changes and reset watermarks when mismatched; snapshot seeds the hash.
    • Source identity: introduced AdapterOptions.SourceID; all adapters default to format:location when unset; CLI normalizes opencode locations to absolute paths and passes a stable SourceID.
    • Read‑only DSN: rebuilt via strict allowlist; bare paths treated as opaque; supports literal ?/:memory: in filenames; new normalization/validation and tests.
    • Benchmarks/gates: added opencode Scan/Tail benchmarks; stabilized internal/notify bench; updated bench/baseline.txt, scripts/check-bench.sh, and CI to enforce 11 benchmarks; docs/specs updated; SOW moved to done.

Written for commit 7502ce8. Summary will update on new commits.

Review in cubic

Reduce Opencode adapter complexity, add deterministic scan and tail benchmarks, harden read-only SQLite source handling, and align source identity and cursor guards.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 220 complexity · 28 duplication

Metric Results
Complexity 220
Duplication 28

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 48 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 e783894 into master Jun 6, 2026
14 checks passed
@ktsaou ktsaou deleted the codex/sow-0049-opencode-adapter-complexity branch June 6, 2026 23:01
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