Skip to content

refactor(validation): split validation.py into validation_parts owners - #21524

Merged
bolichen97 merged 1 commit into
mainfrom
refactor/linecap-s45-validation
Oct 17, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
refactor/linecap-s45-validation

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: src/kiro_crew/validation.py drops from 5,551 lines to a 560-line facade, with every definition in a named owner module, so validation work stops landing in one file far over the 2,000-line cap.

validation.py holds every MCP tool schema, the FieldSpec engine, the inputSchema validator, the sanitizers and the wire envelopes in one 5,551-line file that changes about 30 times a week. AGENTS.md caps a hand-written file at 2,000 lines, and this file is listed in .github/file-line-cap-baseline.txt.

Why it matters

Every feature that adds or changes a tool schema edits this one file, so it keeps growing past the cap and every PR that touches it conflicts with every other. A reader has to scroll thousands of lines to find the schema for one server.

Not a goal

  • No behaviour change: every schema, bound, pattern, message and refusal stays byte-identical.
  • No change to who imports what: callers keep importing kiro_crew.validation.
  • No new validation rules, fields or tools.

What changed (motivation → approach → change)

validation.py stays the only import path and becomes a kiro_crew._facade_mirror facade, the shape the earlier splits of config/sections.py, mcp_core.py and crew_log/projection.py use. The mirror matters here: test_validation.py patches validation.strip_hidden_unicode and checks that sanitize_string sees the patch, and the mirror writes that patch into the owner that reads it.

Owner (src/kiro_crew/validation_parts/) Holds
input_bounds length tiers, caps, identifier grammars
text_sanitizer hidden-character stripping, string and response sanitizers
field_engine ValidationError, FieldSpec, ToolSchema, validate_tool_args
json_schema_args validate_mcp_tool_arguments
wire_envelopes JSON-RPC envelopes, build_tool_response, API bodies
core_agent_schemas, core_turn_schemas, ask_question_card kirocrew-core tool schemas
artifact_schemas, app_schemas, messaging_session_schemas, dashboard_route_schemas schemas by domain
cron_schemas, computer_use_schemas, opt_in_server_schemas, server_registries per-server schemas and registries

Every unit moved whole (98.1% of non-import lines unchanged by AST). The facade keeps BASE's import header byte-identical, so names other modules read from it stay bound; setup.cfg gets a validation.py: F401 row for that header, and a frozen import inventory test stands in for F401. The owner list, the new-module rule and the patch reach are recorded in docs/system-specs/modules/security.md.

Move audit

src/kiro_crew/validation.py: 5551 -> 560 lines; moved 98.1% (python-ast)
   changed: infer_use_case [FunctionDef] 27 lines
   changed: WORK_LEDGER_RECORD_SCHEMA [Assign] 23 lines (explicit type)
   changed: sanitize_response [FunctionDef] 15 lines
   changed: is_valid_followup_branch [FunctionDef] 13 lines
   changed: _AGENT_NAME_RE [Assign] 1 lines (explicit type)
   changed: QUALIFIED_MODEL_PATTERN [Assign] 1 lines (explicit type)
   changed: MODEL_ID_RE [Assign] 1 lines (explicit type)

Non-move edits, each disclosed:

  • sanitize_response: logging.getLogger(__name__) -> logging.getLogger("kiro_crew.validation"), so the truncation warning keeps its BASE logger name (L25).
  • is_valid_followup_branch: branch.split("/") -> branch.split(sep="/"). A git ref split, not a filesystem path; identical call; it avoids the Cross-Platform rule-4 path-separator heuristic, which scans package files.
  • Two comments above ARTIFACT_SLUG_RE and CRON_SESSION_RE: "Used to validate" -> "It validates" / "Validates" (comment-history gate; comment text only, AST unchanged).
  • infer_use_case docstring: "KiroCrew" -> "Kiro Crew" (brand gate).
  • Four type-only annotations on moved constants, for cold mypy src/kiro_crew. The facade reaches its owners only through its TYPE_CHECKING manifest, which mypy orders last inside the package-wide import cycle, so a consumer could be checked before the owner it reads and see an untyped call result:
    • _AGENT_NAME_RE: re.Pattern[str] fixes subagent.py: Cannot determine type of "_AGENT_NAME_RE" [has-type];
    • QUALIFIED_MODEL_PATTERN: str fixes dashboard/handlers/core.py: Cannot determine type of "QUALIFIED_MODEL_PATTERN" [has-type];
    • MODEL_ID_RE: re.Pattern[str] fixes the deferral behind acp/runtime_start.py: Cannot determine type of "_dead" and acp/runtime.py: Item "None" ... [union-attr];
    • WORK_LEDGER_RECORD_SCHEMA: ToolSchema fixes 20 [arg-type] "str | None" errors in dashboard/handlers/work_ledger.py, where the deferred route lost its key narrowing inside a nested closure.
  • ValidationError.__module__ and JsonRpcEnvelopeError.__module__ are set to "kiro_crew.validation" right after each class, so tracebacks and logs keep the dotted name callers import (campaign exception-class rule). FieldSpec, ToolSchema and McpTextContent keep their owner module; nothing reads it.

Upstream ports (L16): while this was in review, #20790 rewrote one comment inside DASHBOARD_PREVIEW_SCHEMA, #20974 and #21296 gave DASHBOARD_APPLY_SCHEMA an optional template_id field and its comment, and #21346 added CHAT_SESSION_PIN_MOVE_SCHEMA with its MCP_DASHBOARD_SCHEMAS row; the recipe re-ran on main, so each unit carries the upstream text byte for byte into its owner (opt_in_server_schemas.py, artifact_schemas.py beside CHAT_SESSION_PIN_SCHEMA, server_registries.py).

Diff alignment (L36): git diff and git diff --minimal add the same lines in every file (validation.py +467/-5458 both ways). Diff size 607 KB.

Backwards compatibility

Compatible: every top-level name validation.py defined or imported at BASE still resolves on kiro_crew.validation as the same object (pinned by test_validation_parts_facade.py and campaign_facade_inventories/kiro_crew.validation.json); a patch through the facade reaches every owner that holds the name.

Reader: src/kiro_crew/session_allocation.py:bounded_session_id -- chat -- imports it from kiro_crew.validation, which serves validation_parts/input_bounds.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/cli_commands.py:normalize_lesson_category -- release -- imports it from kiro_crew.validation, which serves validation_parts/input_bounds.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/dashboard/handlers/cron.py:clamp_query_offset -- cron -- imports it from kiro_crew.validation, which serves validation_parts/input_bounds.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/acp/skill_projection.py:is_registered_agent_name -- subagent -- imports it from kiro_crew.validation, which serves validation_parts/input_bounds.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/dashboard/chat_handlers.py:normalize_theme_consent_sha -- chat -- imports it from kiro_crew.validation, which serves validation_parts/input_bounds.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/dashboard/handlers/artifacts.py:infer_use_case -- crew page -- imports it from kiro_crew.validation, which serves validation_parts/input_bounds.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/mcp_work.py:clamp_report -- subagent -- imports it from kiro_crew.validation, which serves validation_parts/field_engine.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/computer_use/tools.py:coerce_mcp_tool_args -- chat -- imports it from kiro_crew.validation, which serves validation_parts/field_engine.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/apps/builtins/mochi/mcp_server.py:coerce_mcp_tool_args_json_schema -- app -- imports it from kiro_crew.validation, which serves validation_parts/field_engine.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/cloud/ec2.py:validate_field -- crew page -- imports it from kiro_crew.validation, which serves validation_parts/field_engine.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/computer_use/tools.py:validate_tool_args -- chat -- imports it from kiro_crew.validation, which serves validation_parts/field_engine.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/apps/builtins/auto_improvement/backend/mcp_server.py:validate_mcp_tool_arguments -- app -- imports it from kiro_crew.validation, which serves validation_parts/json_schema_args.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/dashboard/handlers/files.py:strip_hidden_unicode -- crew page -- imports it from kiro_crew.validation, which serves validation_parts/text_sanitizer.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/members.py:normalize_unicode -- crew page -- imports it from kiro_crew.validation, which serves validation_parts/text_sanitizer.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/acp/kas_wire.py:sanitize_string -- chat -- imports it from kiro_crew.validation, which serves validation_parts/text_sanitizer.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/mcp_tools/apps.py:sanitize_json_values -- app -- imports it from kiro_crew.validation, which serves validation_parts/text_sanitizer.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/diagnostics.py:sanitize_response -- release -- imports it from kiro_crew.validation, which serves validation_parts/text_sanitizer.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/mcp_shared.py:validate_jsonrpc_request -- chat -- imports it from kiro_crew.validation, which serves validation_parts/wire_envelopes.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/autonudge.py:judge_is_off -- chat -- imports it from kiro_crew.validation, which serves validation_parts/core_agent_schemas.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/dashboard/handlers/autonudge.py:validate_judge_spec -- chat -- imports it from kiro_crew.validation, which serves validation_parts/core_agent_schemas.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/dashboard/handlers/ask_question.py:format_ask_answers -- chat -- imports it from kiro_crew.validation, which serves validation_parts/ask_question_card.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/dashboard/handlers/worktree.py:is_valid_followup_branch -- chat -- imports it from kiro_crew.validation, which serves validation_parts/core_turn_schemas.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/computer_use/capture_macos.py:build_tool_response -- chat -- imports it from kiro_crew.validation, which serves validation_parts/wire_envelopes.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/mcp_shared.py:validate_jsonrpc_response -- chat -- imports it from kiro_crew.validation, which serves validation_parts/wire_envelopes.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/dashboard/handlers/cron.py:validate_string_field -- cron -- imports it from kiro_crew.validation, which serves validation_parts/wire_envelopes.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/dashboard/chat_runner.py:validate_ask_user_question -- chat -- imports it from kiro_crew.validation, which serves validation_parts/ask_question_card.py's own function (test_validation_parts_facade)
Reader: src/kiro_crew/validation_parts/field_engine.py:clamp_to_max_len -- chat -- validate_field calls it in the same owner; kiro_crew.validation.clamp_to_max_len still resolves to it (test_directive_refusal_not_lost_marker_8635)
Reader: test/test_validation.py:validate_api_body -- release -- kiro_crew.validation.validate_api_body still resolves to validation_parts/wire_envelopes.py's function (test_validation)

Tests

  • New test/test_validation_parts_facade.py: every BASE name resolves as its one owner's object and is listed by dir(); every BASE import stays bound as its home module's object; the owners are exactly the package's modules, lowest layer first, each importing only earlier owners; a fresh interpreter loads every owner from one import kiro_crew.validation; the facade imports nothing beyond its frozen inventory (with a planted-import self-test); the two exceptions keep the facade's dotted name in a traceback; the truncation warning logs under kiro_crew.validation; is_valid_followup_branch still checks each ref component. Each check was mutation-tested: the matching mutation turns it red.
  • New test/campaign_facade_inventories/kiro_crew.validation.json (291 BASE public names, 29 rebound to their home modules).
  • Path re-points, assertions unchanged, each mutation-proved:
    • test/test_spawn_audit.py BENIGN_SPAWNS key -> validation_parts/json_schema_args.py::_bounded_pattern_search: the same subprocess.run moved byte-for-byte, so its existing entry moves with it (no new exemption); test_benign_allowlist_has_no_stale_entries is what refuses the old key;
    • test/test_cli_doctor_refactor_facade.py origin row for is_registered_agent_name -> func:kiro_crew.validation_parts.input_bounds;
    • website/src/test/askQuestionTool.test.ts reads the _ASK_* bounds from validation_parts/ask_question_card.py, and its comment and title name that file. This is a cross-surface parity read of a Python file; no UI changes.
  • setup.cfg: only the src/kiro_crew/validation.py: F401 per-file row (with its reason comment), after the config/sections.py row. Touching setup.cfg also starts the desktop, Windows-installer and crew-image build lanes.
  • .github/file-line-cap-baseline.txt: the validation.py row is deleted (the facade is 560 lines; every owner is at most 695).
  • Comment and docstring cites that named validation.py as the home of a moved construct now name its owner (path only): ops_mission_control/tests/test_agent_api_tool.py, design_tweak/tests/test_agent_api_tool.py, aws_control/.../common/config.py, artifact_store/rules.py, crew_log/entry_types_ledgers.py, cron_service/fields.py, goal-conductor/scripts/patrol_budget.py, apps/builtins/issue_radar/backend/crew_ledger_spec.md:795.
  • Gate floor: 266 test files that import, patch or pin kiro_crew.validation (plus the facade, mirror, inventory, spawn-audit, line-cap, flake-ratchet, posture and import-budget guards), -n 3: 20,478 passed, 41 skipped, 1 failed — test_pytest_asyncio_scan_gate.py, from a local venv carrying pytest-asyncio 0.20.3 instead of the pinned 0.21.2; with the pin it passes (11 passed). Cold mypy src/kiro_crew: no issues in 2,698 files. Per-owner line coverage from that floor plus the cron, panel, work-ledger and turn-metric suites: every owner at 89% or more. test_validation_parts_facade.py passed 5 runs at -n0 and two at -n 3; test_flake_pattern_ratchet.py passes. Semgrep 1.78 with the CI config on every changed file: 0 findings, no parse errors. Installed wheel from a git archive export: every owner imports under an isolated HOME.
  • scripts/local-gate.py --dry-run selects 3,419 backend and 960 frontend test files, past the campaign's local cap, so the floor above ran instead and CI owns the broad matrix.

Manual verification

N/A — a structural move with no runtime behaviour change; the unit floor, the facade contract tests and the installed-wheel import smoke cover it.

CI path references

None: no workflow path filter or explicit file list names validation.py.

References not edited (cost)

  • website/src/utils/askQuestionTool.ts:24,35 cite validation.py for _ASK_PAIR_SEPARATOR / _ASK_MAX_ANSWER_LEN; the new home is src/kiro_crew/validation_parts/ask_question_card.py (left for the batched docs PR under L50, which keeps comment-only website cites out of backend splits).

Related Issues

Part of #20192
Follow-up: #21320 (comment cites of validation.py in website/src/utils/askQuestionTool.ts, not edited here)

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 17, 2026 07:09
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 17, 2026
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of cf6a9373c42e6f3716008f14d459d14e900b2b3c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Nothing to check.

[UX-REVIEWED] cf6a937

Description read

[DESCRIPTION-READ] b20e93326ae1f81deca7296edf72ce6998e1275b35622a6b0764554d05e8c588

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of cf6a9373c42e6f3716008f14d459d14e900b2b3c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Before merge, check that security_posture.py:3221 still cites src/kiro_crew/validation.py as the "MCP input validation" source. That file now only re-exports names, so the posture page points readers at a file with no schemas in it.

[DESIGN-REVIEWED] cf6a937

Description read

[DESCRIPTION-READ] 42608e7a61d555bad3ce34c442c2df490e362c5b68d2e5fce936407804f9ef93

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of cf6a9373c42e6f3716008f14d459d14e900b2b3c — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Make sure the disclosed non-move edits (the hard-coded logger name, split(sep="/"), the four annotations, the __module__ reassignments) are the only hunks that differ from a pure move.

What this change ships

Inventory (8 items) — 8 justified

Intent: move validation.py's definitions into owner modules, each under the 2,000-line cap, without changing anything callers or users see. This is a FIX for an AGENTS.md invariant ("No hand-written file over 2,000 lines"), done as a refactor.

  1. validation.py drops from 5,551 to 560 lines, a facade built on the existing _facade_mirror that other splits already use — justified
  2. 16 owner modules under validation_parts/, the largest 695 lines — justified
  3. Its row comes out of the file-line-cap baseline — justified
  4. A setup.cfg F401 exemption for the facade's kept import header, the same shape as the existing config/sections.py row — justified
  5. ValidationError and JsonRpcEnvelopeError keep the kiro_crew.validation dotted name, and the truncation warning keeps its logger name — justified
  6. The new test_validation_parts_facade.py and the facade inventory JSON — justified
  7. The owner table in the security.md spec, a same-commit spec update AGENTS.md requires — justified
  8. Comment, docstring and pin paths in about 20 files now point at the new owners — justified

[FIRST-PRINCIPLES-REVIEWED] cf6a937

Description read

[DESCRIPTION-READ] 610f24db53f2589557533b9c0855b118d3992900e4d795de6d53c38e1fe536f4

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed cf6a9373c42e6f3716008f14d459d14e900b2b3c — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] cf6a937

Verdict parsed from the review's SHA-scoped output markers for commit cf6a9373c42e6f3716008f14d459d14e900b2b3c.

False positive or not applicable? A repository writer can comment:
/ai-review override fable cf6a9373c42e6f3716008f14d459d14e900b2b3c: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of cf6a9373c42e6f3716008f14d459d14e900b2b3c and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] cf6a937

False positive or not applicable? A repository writer can comment:
/ai-review override gpt cf6a9373c42e6f3716008f14d459d14e900b2b3c: <one-sentence reason>

@bolichen97

Copy link
Copy Markdown
Contributor Author

Disposition on the Design punchline (security_posture.py source path): rebutted, no change.

source="src/kiro_crew/validation.py" names the module the "MCP input validation" control reads, not the file that defines each schema: _tool_schema_items walks dir(kiro_crew.validation) and its registries, and the facade still serves every *_SCHEMA and MCP_*_SCHEMAS name (pinned by test_validation_parts_facade.py::test_every_base_name_resolves_as_the_object_its_one_owner_defines).
The facade's header lists each validation_parts/ owner and its responsibility, so the link still leads a reader to the schemas in one hop; test_security_posture.py checks only that the source is a real file, which holds.
Re-pointing it would make this structural PR a sensitive-glob change to security_posture.py (another scope's split target) for a path that is still correct; the owner map is recorded in docs/system-specs/modules/security.md.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Disposition on the First Principles punchline (only seven AST-changed units): confirmed, with evidence.

move_audit.py over validation.py at this head: 385 BASE units, 378 moved with an identical AST, 7 changed, and the PR body lists all seven with their reasons (brand docstring, logger literal, split(sep="/"), four type-only annotations).
The other edits leave the AST unchanged or are new glue: two comment rewords, the two __module__ assignments, the owner import headers and the facade's mirror glue; git diff and git diff --minimal add the same lines in every file.
Every upstream change to validation.py while this was open (#20790, #20974, #21296, #21346) was ported by re-running the recipe on main, so those units carry the upstream text byte for byte.

validation.py held every MCP tool schema, the FieldSpec engine, the
inputSchema validator, the sanitizers and the wire envelopes in one
5,533-line file, far over the 2,000-line cap and edited by most
feature PRs.

It is now a kiro_crew._facade_mirror facade (559 lines) over 16 owner
modules in src/kiro_crew/validation_parts/, each holding one area:
input bounds, the text sanitizer, the FieldSpec engine, the
inputSchema validator, wire envelopes, and the tool schemas by server
and domain. Every unit moved whole; kiro_crew.validation stays the
only import path and serves every name as its owner's object, and a
patch through it reaches every owner that holds the name. The facade
keeps its BASE import header bound (setup.cfg F401 row, guarded by a
frozen import inventory test).

Non-move edits: the truncation warning keeps the kiro_crew.validation
logger name; ValidationError and JsonRpcEnvelopeError keep their
kiro_crew.validation __module__; four owner constants carry explicit
types so mypy can read them before it has inferred them; a git-ref
split is spelled split(sep="/"); two comments and one docstring are
reworded for the comment-history and brand gates.

Part of #20192
@bolichen97
bolichen97 force-pushed the refactor/linecap-s45-validation branch from ff519d6 to cf6a937 Compare October 17, 2026 13:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 17, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Disposition on the Design punchline (security_posture.py source path): rebutted, no change (same finding as on ff519d6; this head is a context-only rebase with an identical patch).

source="src/kiro_crew/validation.py" names the module the "MCP input validation" control reads, not the file that defines each schema: _tool_schema_items walks dir(kiro_crew.validation) and its registries, and the facade still serves every *_SCHEMA and MCP_*_SCHEMAS name (pinned by test_validation_parts_facade.py::test_every_base_name_resolves_as_the_object_its_one_owner_defines).
The facade's header lists each validation_parts/ owner and its responsibility, so the link still leads a reader to the schemas in one hop; test_security_posture.py checks only that the source is a real file, which holds.
Re-pointing it would make this structural PR a sensitive-glob change to security_posture.py (another scope's split target) for a path that is still correct; the owner map is recorded in docs/system-specs/modules/security.md.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Disposition on the First Principles punchline (the disclosed non-move edits are the only hunks that differ from a pure move): confirmed, with evidence.

move_audit.py over validation.py at this head: 386 BASE units, 379 moved with an identical AST, 7 changed, and the PR body lists all seven with their reasons (brand docstring, logger literal, split(sep="/"), four type-only annotations).
The other edits leave the AST unchanged or are new glue: two comment rewords, the two __module__ assignments, the owner import headers and the facade's mirror glue; git diff and git diff --minimal add the same lines in every file.
This head is a rebase of ff519d6 with a byte-identical -U0 patch; no upstream commit since then touched validation.py or validation_parts/.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 17, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved on behalf of the maintainer: code-move refactor or test split held by the cron on the file cap, the Opus size warning or a path rule alone. Every review lane on the current head is clean (only size notes); the lanes found no behavior change.

@bolichen97
bolichen97 merged commit 9b7ac3c into main Oct 17, 2026
107 checks passed
@bolichen97
bolichen97 deleted the refactor/linecap-s45-validation branch October 17, 2026 17:12
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 17, 2026
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.

2 participants