Skip to content

Add a Linked JSON Output to the Backlog Report and Pin Every Inline Script Dependency Exactly - #4157

Merged
ptr727 merged 9 commits into
developfrom
burndown/script-pins-metrics-json
Nov 13, 2026
Merged

ptr727 merged 9 commits into
developfrom
burndown/script-pins-metrics-json

Conversation

@ptr727

@ptr727 ptr727 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add a Linked JSON Output to backlog_metrics.py #4151: scripts/backlog_metrics.py gains --format json and drops --format html, per the maintainer's 2026-11-13 comment on the issue. The JSON document carries the same figures as the Markdown report. Each counted repository, issue, pull request, and workflow run carries its html_url, and the headline totals sit in a top-level totals object. scripts/README.md documents the shape, and tests/test_backlog_metrics.py pins it.
  • The Markdown output now links each repository to its GitHub page, in all three tables. It also links each issue and pull request count to the GitHub search listing what it counts, bounded to the report's window. The workflow run counts stay plain, since they come from gh run list rather than from a search.
  • backlog_metrics.py takes CODESTYLE.md "Interrupts" with this edit. On SIGINT or SIGTERM it stops the gh call in flight, prints one line, and ends by the signal. It passes over a later signal, as the prose gate does, so the SIGTERM uv run forwards after a Ctrl-C cannot cut the unwind short. A test signals it mid-call and checks that the gh child is gone.
  • Pin the Remaining Unbounded Inline Script Dependencies So an Upstream Release Cannot Change a Gate #4043: every PEP 723 inline dependency in the tree is now pinned to one exact version. That covers the prose gate, agent_policy.py, central_config.py, and ten more scripts under scripts/ and spec/. Each markdown-it-py pin brings mdurl==0.1.2 with it, the one package markdown-it-py requires. tests/requirements.txt pins the same versions. The versions are the ones the open bounds resolve today, so no script's behavior changes.
  • PinTests now finds every tracked script's inline block rather than naming two files. It checks that each dependency, and each tests/requirements.txt line, is an exact pin, and that a package takes one version everywhere. It also checks that each package a pinned one requires is pinned beside it.

Downstream

ptr727/HomeAutomation-Config#1800's scripts/fleet-report.sh runs --format html, which this change refuses with exit 2. That repository switches to --format json when it renders its own report, per the design that issue records. This pull request writes nothing there.

Local review

  • Declined, outcome 2: moving the interrupt helper onto one shared primitive. Its only other copy is .github/actions/prose-gate/prose_lint.py, which lives beside its composite action so a reusable workflow reaches it at the pinned hub commit without scripts/. So it cannot import a module from scripts/. Within scripts/, backlog_metrics.py holds the only copy, and scripts/docker_lint.py uses a different, SIGTERM-to-exit handler. A primitive for the next scripts/ caller is that change's to add.
  • Declined, outcome 2: bounding the open-now link by date. GitHub search has no qualifier for an issue open on a past date, so the README documents that link as listing what is open when it is opened. The JSON carries the counted open issues under items.issues_open.
  • Fixed: dated searches bounded to the window, and the default trigger carried as policy_from_default beside a bare policy_trigger. The Markdown totals, review tables, and billing lines are now printed from the figures the JSON carries. The JSON test pins every field name. The signal test reuses tests/test_pre_commit_hook.py's harness. The README documents the policy_changes markers.
  • Declined, outcome 2, under GOVERNANCE.md "Trust Boundaries and Hardening Effort": the signal test's skip covering its SIGTERM subtest too, where the suite inherits an ignored SIGINT. That is a suite started in the background from a non-interactive shell, which neither CI nor the documented run command does, and the skip prints. The same class in tests/test_prose_lint.py's signal test is pre-existing, outside this change's files, and declined for the same reason: it fails loudly rather than silently, and only in that launch.

Verification

  • uv run --no-project --with-requirements tests/requirements.txt python -m unittest discover -s tests
  • ruff format --check, ruff check, and mypy over the tree, and the prose gate over the branch diff.
  • PinTests fails when one script reverts to >=4, one pins another markdown-it-py version, or one drops mdurl. The interrupt test fails when the SIGTERM handler is removed.

Closes on promotion: #4151, #4043

🤖 Generated with Claude Code

ptr727 and others added 3 commits November 13, 2026 08:36
…cript Dependency Exactly

backlog_metrics.py takes --format json in place of --format html. The
document carries the report's figures, each counted repository, issue,
pull request, and workflow run beside its html_url, and the headline
totals at its top level. The Markdown output links each repository and
each issue and pull request count. scripts/README.md documents the JSON
shape and a test pins it. The script also takes the interrupt rule.

Every PEP 723 inline dependency is pinned to the version its open bound
resolves today, with mdurl beside each markdown-it-py pin, and
tests/requirements.txt pins the same. PinTests now scans every tracked
script and holds each pin exact and equal everywhere it is stated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Correct the Notes Description

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and Compute the Totals Once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 13, 2026 16:54
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between aa4f5d1 and 6d52b0f.

Files selected for processing: 17

  • .github/actions/prose-gate/prose_lint.py
  • scripts/README.md
  • scripts/agent_policy.py
  • scripts/backlog_metrics.py
  • scripts/build_dist.py
  • scripts/canonical_review.py
  • scripts/carry.py
  • scripts/central_config.py
  • scripts/pr_cleanup.py
  • scripts/pr_review.py
  • scripts/pr_review_copilot.py
  • spec/audit.py
  • spec/fidelity_honesty.py
  • spec/validate.py
  • spec/workflow_reuse.py
  • tests/requirements.txt
  • tests/test_backlog_metrics.py
  • 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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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.

🟡 Changes recommended

Active issues remain because the open-issues link is unbounded by the report end date, making archived reports inconsistent with the counted open_now value and requiring corresponding documentation and test updates.

2 open issues
What changed in this PR

This PR adds linked JSON output for backlog_metrics.py, improves Markdown report links, removes the HTML format, and pins all inline script dependencies exactly.

Changes:

  • Adds JSON serialization with repository, issue, pull request, and workflow URLs.
  • Adds Markdown links and signal-aware child-process handling.
  • Pins inline dependencies and expands tests for output, interruption, and dependency consistency.
File Description
tests/​test_backlog_metrics.py Adds tests for JSON output, report links, format removal, signal interruption, and repository-wide dependency pins.
tests/​requirements.txt Pins test dependencies and required transitive packages to exact versions.
spec/​workflow_reuse.py Pins Markdown and YAML dependencies.
spec/​validate.py Pins Markdown dependencies.
spec/​fidelity_honesty.py Pins Markdown and YAML dependencies.
spec/​audit.py Pins Markdown and YAML dependencies.
scripts/​README.md Documents JSON output, linked Markdown metrics, and exact dependency pinning.
scripts/​pr_review.py Pins Markdown dependencies.
scripts/​pr_review_copilot.py Pins Markdown dependencies.
scripts/​pr_cleanup.py Pins Markdown dependencies.
scripts/​central_config.py Pins EditorConfig and YAML dependencies.
scripts/​carry.py Pins Markdown dependencies.
scripts/​canonical_review.py Pins Markdown dependencies.
scripts/​build_dist.py Pins Markdown and YAML dependencies.
scripts/​backlog_metrics.py Adds JSON output, linked Markdown metrics, exact dependency metadata, and signal handling.
scripts/​agent_policy.py Pins EditorConfig, YAML, and TOML dependencies.
.github/​actions/​prose-gate/​prose_lint.py Pins Markdown, URL, and Pygments dependencies.

Review effort: Lite

Comment thread scripts/backlog_metrics.py Resolved
Comment thread scripts/README.md Resolved
…ort's Signal Test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.67480% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.75%. Comparing base (b38e084) to head (6d52b0f).
⚠️ Report is 192 commits behind head on develop.

Files with missing lines Patch % Lines
scripts/backlog_metrics.py 79.67% 25 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4157      +/-   ##
===========================================
- Coverage    81.60%   76.75%   -4.86%     
===========================================
  Files           26       41      +15     
  Lines         9070    14279    +5209     
===========================================
+ Hits          7402    10960    +3558     
- Misses        1668     3319    +1651     
Flag Coverage Δ
python-3.13 76.75% <79.67%> (-4.86%) ⬇️

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.

… Document the Policy History's Markers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 845088c9fe87b5ef88404f154cb4fc8ac4293c5f, the content this pull request carries at that commit against develop, and it recorded 1 finding.

ptr727 and others added 3 commits November 13, 2026 09:11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…han in the Trigger Text

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ored SIGINT

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

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

@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 702a605 into develop Nov 13, 2026
13 checks passed
@ptr727
ptr727 deleted the burndown/script-pins-metrics-json branch November 13, 2026 17:45
ptr727 added a commit that referenced this pull request Nov 13, 2026
… Rules (#4189)

## Summary

Promotes the backlog-burndown rounds and changes from other hub sessions
from `develop` to `main`.

- Hooks and the prose gate: #4132, #4134, #4136, #4145, #4152, #4184.
The Husky hook reads its path list once and diffs a merge against
`MERGE_HEAD`. Interrupts re-raise their signal, a Markdown code span
reads as quoted data, and the gate picks a commit's diff base and
recognizes a conflicted promotion's branch cut from `main`.
- Procedures and carried rules: #4133, #4139, #4141, #4149, #4166,
#4177, #4179, #4183, #4185. Resync, audit and check-this-repo procedure
gaps, code style and shell interrupt rules, review-loop gaps across four
skills, the context and delegation section of `AGENTS.md`, question
rules in governance, the promotion line in pull request bodies,
closing-keyword behavior on promotion, and the history-rewrite premise.
- Review and cleanup tooling: #4138, #4148, #4154, #4156, #4157, #4163,
#4164, #4168, #4174, #4180. Cleanliness reads, parked handoffs, the
backlog report's JSON output, exact inline script pins, trusted inputs,
env-file includes, the bounded review wait, side-reviewer matching, and
a Copilot billing-failure notice read as a refusal.
- Workflow and runbook contract: #4153, #4155, #4169, #4171, #4178,
#4182. The runtime-secrets check, a registry entry and spec references,
the Copilot runbook pointers, credential-free checkout steps, and the
deploy-key and runner wording.
- From other hub sessions: #4159 (a repository's own .NET line under a
fleet default), #4161 (the 1Password CLI as an optional host tool),
#4162 (Codex's Windows installer and one managed opencode copy). These
carry no promotion line.

#4182 carries no promotion line by design, and #4175 holds the split-out
part of #4057's scope. Both #1448 and #4175 stay open.

Fixes #1071
Fixes #1154
Fixes #1391
Fixes #1471
Fixes #1594
Fixes #1620
Fixes #1627
Fixes #1650
Fixes #1801
Fixes #2853
Fixes #3620
Fixes #3668
Fixes #3697
Fixes #3766
Fixes #3787
Fixes #3837
Fixes #3840
Fixes #3842
Fixes #3844
Fixes #3865
Fixes #3882
Fixes #3890
Fixes #3894
Fixes #3912
Fixes #3916
Fixes #3954
Fixes #4014
Fixes #4015
Fixes #4016
Fixes #4043
Fixes #4050
Fixes #4057
Fixes #4058
Fixes #4062
Fixes #4084
Fixes #4097
Fixes #4098
Fixes #4099
Fixes #4104
Fixes #4108
Fixes #4114
Fixes #4115
Fixes #4117
Fixes #4118
Fixes #4119
Fixes #4121
Fixes #4122
Fixes #4123
Fixes #4131
Fixes #4135
Fixes #4140
Fixes #4142
Fixes #4143
Fixes #4144
Fixes #4151

🤖 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