Skip to content

refactor(types): make API and snapshot value boundaries explicit - #176

Merged
codeasier merged 1 commit into
mainfrom
refactor/issue-165-types
Oct 3, 2026
Merged

codeasier merged 1 commit into
mainfrom
refactor/issue-165-types

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

Implement the incremental type-governance item in #165, prioritizing public API, core result structures and snapshot data boundaries.

  • Add TypedDict result envelopes for list_templates and execute_query, preserving ordinary dictionary results and keys.
  • Replace Any with object at API/model/representation value boundaries; annotate analyzer-owned services.
  • Explicitly narrow snapshot container values and annotate existing format assumptions at adaptor consumers; no runtime coercions or schema changes.
  • Promote Any/Unknown diagnostics to errors in api.py, core/models.py and snapshot/representation.py, retaining the whole-package zero-error gate.
  • Document static result typing in both languages and append runtime provenance.

🔗 Related Issue

Refs #165. CLI decomposition is the remaining item before closure.

🧪 Testing

  • Existing CLI/API, snapshot, import and split contracts exercised
  • Fixture provenance: 7 passed before deserializing tests.
  • Full suite: 1186 passed under strict resource-warning policy.
  • basedpyright: 0 errors; 831 -> 782 warnings in the same environment, with stricter gates on the selected boundaries.
  • Ruff, Black and whitespace checks passed.

✅ Checklist

  • Code follows project guidelines
  • English/Chinese API documentation updated
  • Changes tested locally

Snapshot Runtime Provenance

  • Snapshot provenance evaluation completed
    Snapshot provenance decision: updated

📋 Additional Notes

This completes the requested incremental boundary-focused typing pass, not a claim that all third-party and internal typing warnings are eliminated. Unsupported-format runtime guards remain intentionally present.

@codeasier
codeasier merged commit 6c98056 into main Oct 3, 2026
6 checks passed
@codeasier
codeasier deleted the refactor/issue-165-types branch October 3, 2026 19:18
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