Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion plan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Current contributor commands and invariants live in `AGENTS.md`, `CLAUDE.md`,
| Pre-1.0 stability rituals | Active upkeep | `plan/epic-pre-1.0-stabilization.md` |
| Kida/Milo marketplace and external dogfooding | Active; external publication and PR work remains | `plan/epic-kida-milo-integration.md` |
| Large-app ergonomics | Proposed; stop-and-ask items are not approved by the plan | `plan/epic-large-app-ergonomics.md` |
| Parser/compiler/analysis ty override debt | Active issue | [#142](https://github.com/lbliii/kida/issues/142) |
| Runtime-helper `Any` reduction | Active; baseline refreshed and first bounded slice implemented | [#146](https://github.com/lbliii/kida/issues/146) |

## Historical Type-Checking Sequence
Expand Down
14 changes: 7 additions & 7 deletions plan/rfc-mixin-protocol-typing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RFC: Type-Safe Mixin Patterns via Hybrid Protocol + Inline Declarations

**Status**: Foundation implemented — remaining ty override debt tracked in GitHub issue #142
**Status**: Implemented — core ty override debt removed in #142/#176

| Field | Value |
|-------|-------|
Expand All @@ -15,12 +15,12 @@
> [!NOTE]
> `ParserCoreProtocol`, `CompilerCoreProtocol`, and inline `TYPE_CHECKING`
> declarations shipped. The original success gate targeted mypy, which Kida no
> longer uses. Current ty still needs scoped `unresolved-attribute = "warn"`
> overrides for parser, compiler, and analysis mixin/visitor boundaries; the
> remaining work is tracked in
> [GitHub issue #142](https://github.com/lbliii/kida/issues/142). The mypy
> commands and unchecked migration checklist below are historical, not an
> active implementation plan.
> longer uses. The parser, compiler, and analysis `unresolved-attribute`
> overrides were removed in
> [GitHub issue #142](https://github.com/lbliii/kida/issues/142) and
> [PR #176](https://github.com/lbliii/kida/pull/176). The mypy commands and
> unchecked migration checklist below are historical, not an active
> implementation plan.

## Executive Summary

Expand Down
5 changes: 3 additions & 2 deletions plan/rfc-type-checking-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
> [!NOTE]
> This RFC records a completed, intermediate migration and is not current
> operational guidance. Kida now runs Astral ty via `make ty`; the live
> configuration is in `pyproject.toml`. Remaining parser/compiler/analysis
> override debt is tracked in [GitHub issue #142](https://github.com/lbliii/kida/issues/142).
> configuration is in `pyproject.toml`. Parser/compiler/analysis override debt
> was completed in [GitHub issue #142](https://github.com/lbliii/kida/issues/142)
> and [PR #176](https://github.com/lbliii/kida/pull/176).
> The mypy commands, counts, configuration, and unchecked follow-ups below are
> retained only as historical decision context.

Expand Down
12 changes: 6 additions & 6 deletions plan/rfc-type-suppression-reduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RFC: Type Suppression Reduction

**Status**: Historical — mypy-era reduction completed; current ty debt is tracked separately
**Status**: Historical — mypy-era reduction and core ty override cleanup completed
**Created**: 2026-01-04
**Updated**: 2026-02-08
**Depends On**: `rfc-type-checking-strategy.md` (Implemented)
Expand All @@ -10,11 +10,11 @@
> [!NOTE]
> This RFC's implementation phases and suppression counts describe the former
> mypy configuration. Kida now uses ty, configured in `pyproject.toml`, with
> narrowly scoped overrides for safe-string method covariance, cross-mixin
> attributes, analysis visitors, and optional integrations. Current mixin and
> visitor override reduction is tracked in
> [GitHub issue #142](https://github.com/lbliii/kida/issues/142); runtime-helper
> `Any` reduction is tracked in
> narrowly scoped overrides only for safe-string method covariance and
> optional integrations. Core parser, compiler, and analysis override debt was
> completed in [GitHub issue #142](https://github.com/lbliii/kida/issues/142)
> and [PR #176](https://github.com/lbliii/kida/pull/176). Runtime-helper `Any`
> reduction is tracked in
> [GitHub issue #146](https://github.com/lbliii/kida/issues/146). Use `make ty`
> for current verification. The body below remains historical evidence.

Expand Down
6 changes: 4 additions & 2 deletions src/kida/compiler/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ Represent correctness, source mapping, compile-time optimization, and the perfor
- Partial evaluation safety: only pure deterministic filters fold at compile time.
- Component inlining and block recompilation semantics.
- StringBuilder-style O(n) output accumulation and streaming chunk boundaries.
- Compiler mixin protocols and existing ty override boundaries.
- Compiler mixin protocols and default ty error severity without core
`unresolved-attribute` overrides.

## Contract Checklist
- Codegen changes inspect parser node shape, generated AST/source locations, runtime helper contracts, escaping placement, and diagnostics.
- Optimization changes inspect purity analysis, partial-eval tests, output-regression tests, and benchmark evidence or a clear no-benchmark reason.
- Render-mode changes compare render, block render, render-with-blocks, streaming, async rendering, and terminal/markdown parity where applicable.
- Mixin/dispatch changes inspect `pyproject.toml` ty overrides and avoid expanding unresolved-attribute exceptions without a follow-up.
- Mixin/dispatch changes run ty at default severity and must not restore core
`unresolved-attribute` overrides without an explicit contract review.

## Advocate
- Compile-time simplification when it is provably semantics-preserving.
Expand Down
6 changes: 4 additions & 2 deletions src/kida/parser/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ Represent template authors, migrators from Jinja2, agents bulk-editing templates
- Top-level-only `{% def %}` and `{% region %}` rules.
- `{% call %}`, `{% slot %}`, scoped slots, and `{% yield %}` composition semantics.
- Precise token positions, template names, actionable parse errors, and migration hints.
- Parser mixin boundaries documented in `pyproject.toml` ty overrides.
- Parser mixin boundaries typed at default ty severity without core
`unresolved-attribute` overrides.

## Contract Checklist
- Syntax changes inspect lexer tokens, parser blocks/statements/expressions, node definitions, compiler support, formatter output, analysis agreement, and syntax docs.
- Error changes inspect `ErrorCode`, location metadata, diagnostic snapshots, malformed-source tests, and migration hints in docs.
- Scoping/composition changes inspect def/call/slot/region tests, examples, README/CLAUDE syntax references, and render-surface parity cases.
- Mixin or dispatch changes inspect `pyproject.toml` ty overrides and avoid growing ignores without a plan.
- Mixin or dispatch changes run ty at default severity and must not restore
core `unresolved-attribute` overrides without an explicit contract review.

## Advocate
- Early, specific parse errors that suggest `kida check <dir> --strict --validate-calls` for nested or bulk-edit failures.
Expand Down
18 changes: 18 additions & 0 deletions tests/test_type_config_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Contracts for the repository's static type-check configuration."""

import tomllib
from pathlib import Path

ROOT_DIR = Path(__file__).parent.parent


def test_core_modules_do_not_restore_unresolved_attribute_overrides() -> None:
"""Parser, compiler, and analysis mixins pass ty at default severity."""
config = tomllib.loads((ROOT_DIR / "pyproject.toml").read_text(encoding="utf-8"))
overrides = config["tool"]["ty"].get("overrides", [])

unresolved_attribute_overrides = [
override for override in overrides if "unresolved-attribute" in override.get("rules", {})
]

assert unresolved_attribute_overrides == []
Loading