Repository navigation
perf(lint): read frontmatter in-process, first part of CC-636 (Windows test-doctor.sh cost) - #680
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011c6rVDk6zyfgLPEfbVrZi9
… and awk per file (CC-636) doctor.sh runs lint-frontmatter.sh on every invocation; on native Windows the per-file external processes made it take about 8 s, now about 1 s with byte-identical output on this checkout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011c6rVDk6zyfgLPEfbVrZi9
…ith tests (CC-636) Review (risk, security, qa, critic, architecture) found that dropping the CR-hiding tools made a CRLF file a WARN skip, which doctor reports as passed. Strip a trailing CR per line instead; add CRLF, trailing-space fence cases. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011c6rVDk6zyfgLPEfbVrZi9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test-doctor.shcase that runs the realdoctor.shcosts about 45 s (samples 46/81/43/44 s; the file has 93 cases), so it cannot be run locally within the tool limit.tools/lint/lint-frontmatter.shread each file withsed,grep,awkand a pipeline; it now reads the first line, the fences and the frontmatter in one in-process pass.doctor.shruns this lint on every invocation.host.yamlscalar reads) and 3 (check_detached_runscost) are not done.Evidence (one machine, single measurements, noisy)
test-lint-frontmatter.sh: 70 passed in 51 s before; 75 passed in 28 s after.doctor-grok-authed-via-xai-envcase: 33-47 s before, 27 s after. The rest of the cost is still in doctor.crlf-invalid-frontmatter-fails; collecting body lines failsbody-after-closing-fence-not-validated.validate.sh BACKLOG.md, planning consistency,lint-test-docstrings.sh: pass.Gate and review
lint-doc-wikilinks.shis too slow to run locally, so both rely on CI; the fulltest-doctor.shwas not run.tests/shell/test-lint-frontmatter.sh(an existing suite), all for the rewritten in-process reader.body-after-closing-fence-not-validatedandclosing-fence-without-trailing-newline: stable supported boundary (where frontmatter ends), high-impact regression (a wrong boundary validates the body or rejects a valid file), implementation-independent observable (lint exit status), low maintenance, direct contract; each was killed by a plausible wrong implementation.crlf-invalid-frontmatter-failsandcrlf-valid-frontmatter-passes: the review found that skipping CRLF files makesdoctorreport invalid frontmatter as passed; same criteria, mutation-checked (removing the CR stripping fails the first).fences-with-trailing-spaces: pins the[[:space:]]*fence rule the old grep and awk had; cheap and observable by exit status.🤖 Generated with Claude Code
https://claude.ai/code/session_011c6rVDk6zyfgLPEfbVrZi9