Skip to content

chore: format session.py (black baseline drift after #14483) - #14780

Merged
bolichen97 merged 1 commit into
mainfrom
fix/main-ratchet-drift-14768-14768
Sep 28, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/main-ratchet-drift-14768-14768

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Black-format session.py so the unbaselined file is black-clean on main again and the ratchet-gates black step stops flagging it.

The Main Ratchet Audit (run 36453125850) fails on main at b5dcaaa6c in step "Check formatting (black, baselined)":

::error file=src/kiro_crew/apps/builtins/meetings/backend/domain/session.py::not black-formatted. Run: black --target-version py310 src/kiro_crew/apps/builtins/meetings/backend/domain/session.py
black gate FAILED: 1 new offender(s), 0 graduated entr(y/ies) to prune.

Every other gate in the lane passed (subprocess-encoding, ACP fixtures, agent-sdk boundary, sync-io, cwd-reads, lockdown, census & config-baseline). The single drift is one file that is not in .github/black-baseline.txt and therefore must be black-clean.

Why it matters

A PR runs the ratchet gates against merge(branch, main), so this red lands on every open PR that touches nothing in meetings/ (#14281 and #14574 already inherit it). Left alone, each of those PRs would be pushed toward the wrong cure: raising a ceiling or baselining the file in someone else's change.

Not a goal

  • No behaviour change in the meetings backend.
  • No edit to .github/black-baseline.txt (the file is not baselined and should stay that way).
  • No change to the gate scripts or the audit workflow.

What changed (motivation → approach → change)

  • Symptom: scripts/check_black_formatting.py reports one new offender on main.
  • Root cause: a ratchet race between two PRs on the same file. fix(meetings): bound concurrent kickoff and flush opening transcript #14483 (6ec57f60f, merged 15:20Z) black-formatted session.py and graduated it out of .github/black-baseline.txt. fix(meetings): keep topic titles and owner attachments usable in agent context #14642 (b5dcaaa6c, merged 16:43Z) was based on the older main where the file was still baselined, so its PR lane passed (black gate scope: merge HEAD^1..HEAD (4 changed file(s)), 950 baselined) even though its two new constructs -- the two-line implicit concatenation inside _SYSTEM_PROMPT_TOPIC_RE and the single-line parts = [...] list in _context_lines -- were not black-clean. After the squash merge the file is unbaselined and carries those constructs, so the whole-tree audit correctly flags it.
  • Change: ran the gate's own remedy, black --target-version py310 src/kiro_crew/apps/builtins/meetings/backend/domain/session.py, on that one file. Whitespace-only diff (two hunks); regex and f-string content are byte-identical.

Backwards compatibility

Compatible: formatting-only change; the compiled regex and the rendered context lines are unchanged.

Tests

The gate script is the test: black --check --target-version py310 <file> exits 0 on this head and exits 1 on origin/main (red-on-base, green-after). isort --check-only, flake8 and mypy on the file all pass. No test suite run locally; CI runs the suites.

Manual verification

  • git diff origin/main..HEAD --stat lists only src/kiro_crew/apps/builtins/meetings/backend/domain/session.py.
  • ast.dump(ast.parse(before)) == ast.dump(ast.parse(after)) is True for the file at origin/main vs this head; the diff is whitespace/line-break only (4 insertions, 3 deletions).

Screenshots / video

N/A -- CI-only formatting fix, no user-visible surface.

Related Issues

None closed. This is the black baseline drift introduced by the interplay of #14483 (graduated the file from the baseline) and #14642 (added unformatted lines while based on the pre-graduation main). The separate pid_reader ratchet count drift tracked in #14768 was healed by #14778 and is not part of this PR.

Pattern harvest

Not generalizable: the gate itself is correct and caught the drift within one audit cycle; the gap is the ordinary base-race between two PRs where one graduates a file from the baseline and the other, based on the older main, still relied on the exemption. A re-run of the PR lane on the final merge base would close it, but that is a CI-policy choice, not a rule in this PR's scope.

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

@CrysisDeu
CrysisDeu requested a review from a team as a code owner September 28, 2026 17:50
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 1fd09295c6d3413b7b0e7b0783275ca2a4340ff1 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1fd0929

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

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

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

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 1fd0929

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 1fd0929

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

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

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of 1fd09295c6d3413b7b0e7b0783275ca2a4340ff1 — 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

Nothing to check.

What this change ships

Inventory (1 item) — 1 justified

Intent: make session.py black-clean again so the ratchet audit's black step stops failing main and every open PR — a FIX.

  1. session.py reformatted (two hunks, whitespace-only) so the black ratchet gate goes green on main — justified

The diff is exactly the gate's own prescribed remedy (black --target-version py310 <file>), the file is confirmed absent from .github/black-baseline.txt (grepped: 0 matches), the checkout matches the patch byte-for-byte, and the change unwedges a red build — DERIVED by contract. No riders, no undeclared surface, no product-shape change, and the PR's own ratchet lane re-runs the black check, so it verifies itself.

[FIRST-PRINCIPLES-REVIEWED] 1fd0929

@CrysisDeu CrysisDeu changed the title style(meetings): black-format session.py to heal main ratchet drift chore: format session.py (black baseline drift after #14483) Sep 28, 2026
The black ratchet gate (scripts/check_black_formatting.py) fails on main
since b5dcaaa (#14642): two constructs added to
src/kiro_crew/apps/builtins/meetings/backend/domain/session.py were not
black-formatted, and the file is not in .github/black-baseline.txt, so
the whole-tree audit lane and every PR merging main inherit the red.

Apply the gate's own remedy (black --target-version py310 <file>) to that
single file. No behaviour change; no baseline edit.

Closes #14768
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 28, 2026
@CrysisDeu
CrysisDeu force-pushed the fix/main-ratchet-drift-14768-14768 branch from 2e6af7a to 1fd0929 Compare September 28, 2026 18:52
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 28, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed on behalf of the maintainers (sweep 2026-09-28): readiness passed, required checks green on 1fd0929, no blocking review threads, security posture unchanged. Approving and merging.

@bolichen97
bolichen97 merged commit 3ee7669 into main Sep 28, 2026
137 of 143 checks passed
@bolichen97
bolichen97 deleted the fix/main-ratchet-drift-14768-14768 branch September 28, 2026 23:50
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 29, 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