Skip to content

Resolve the Audit Hub Name Lazily - #2926

Merged
ptr727 merged 3 commits into
developfrom
feature/audit-lazy-hub-name-2829
Oct 13, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/audit-lazy-hub-name-2829

Conversation

@ptr727

@ptr727 ptr727 commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Importing spec/audit.py ran a git read at import, before argparse saw --help or an unknown flag. The hub name is now a cached accessor resolved on first use, every importer uses it, and the command-line usage gate records git so each entry point is held to reading nothing first. The gate was shown to fail with the eager call restored.

Part of #2829

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 12, 2026 17:53
Importing spec/audit.py ran a git read before argparse saw --help or an unknown flag, which breaks the rule that a script reads nothing first. The name is now a cached accessor resolved on first use, and the command-line usage gate records git so every entry point is held to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 13, 2026 00:56
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7a55bf5b-b79c-4a49-a76f-6f83afdedd9d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

🟢 Approval recommended

The remaining typing nit is non-blocking.

0 open findings

What changed in this PR

Defers audit hub-name resolution until first use so CLI argument parsing precedes Git access.

Changes:

  • Adds cached lazy hub-name resolution.
  • Updates audit consumers to use the accessor.
  • Extends CLI usage tests to detect premature Git calls.
File Summary
tests/​test_cli_usage.py Records Git invocations during CLI checks.
spec/​workflow_reuse.py Uses the lazy hub-name accessor.
spec/​fidelity_honesty.py Uses the lazy accessor for hub comparisons.
spec/​audit.py Implements lazy resolution; the public helper should add a str return annotation.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.28571% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.95%. Comparing base (1607ba4) to head (b6231af).

Files with missing lines Patch % Lines
spec/audit.py 16.66% 10 Missing ⚠️
spec/fidelity_honesty.py 0.00% 1 Missing ⚠️
spec/workflow_reuse.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2926      +/-   ##
===========================================
- Coverage    60.00%   59.95%   -0.05%     
===========================================
  Files           17       17              
  Lines         8773     8776       +3     
===========================================
- Hits          5264     5262       -2     
- Misses        3509     3514       +5     
Flag Coverage Δ
python-3.13 59.95% <14.28%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head b6231af165e13ec687a751dcdc07471b611af948, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI 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.

🟢 Approval recommended

No unresolved review findings remain across the four reviewed files.

0 open findings

🧠 Review effort: Lite

@ptr727
ptr727 merged commit 2e728da into develop Oct 13, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/audit-lazy-hub-name-2829 branch October 13, 2026 01:11
ptr727 added a commit that referenced this pull request Oct 13, 2026
…y-Pass Record, and Write-Guard cd Scoping to Main (#2930)

- #2926 resolves `spec/audit.py`'s hub name lazily through a cached
accessor, so an importing script parses its arguments before any git
read, and `tests/test_cli_usage.py` now records `git` so every entry
point is held to "before any read"
- #2927 keys the workspace-edit rule on whether a window that has the
`.code-workspace` loaded hosts a live agent session the editing agent
knows of, rather than on where the editing agent runs, aligns the
"Editor and Tasks" pointer, and drops the `python-codestyle` profiles
bullet that contradicted it
- #2929 attests every push a recorded local pass covers, the opening
push included, makes the published attestation the evidence Merge Gate
item 2's promotion case reads, and stops `pr_review.py` reading an
attestation on the head Copilot's first round landed on as that head's
coverage
- #2928 reads a bare `git push` after a plain leading `cd` (joined by
`&&` or `;`) or `-C` in that directory in `gh-write-guard`, denies one
after any other `cd` form, and scans `bash -c` / `sh -c` bodies for
pushes and bypass flags. The heredoc-text false denial is deliberately
left unfixed after ten review rounds each found a bypass in a carve-out,
so #2821 stays open for it

Closes #2829
Closes #2834
Closes #2835
Closes #2897

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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