Skip to content

Numeric Sanity Checker skill - #213

Open
Tim (Timziito) wants to merge 4 commits into
microsoft:mainfrom
Timziito:add-numeric-sanity-checker
Open

Numeric Sanity Checker skill#213
Tim (Timziito) wants to merge 4 commits into
microsoft:mainfrom
Timziito:add-numeric-sanity-checker

Conversation

@Timziito

Copy link
Copy Markdown
Contributor

Verifies the arithmetic in a report before it ships: do subtotals sum to the stated total, do percentages sum to 100, does a percent-change figure actually match the two numbers it's derived from.

Verifies the arithmetic in a report before it ships: do subtotals sum to the stated total, do percentages sum to 100, does a percent-change figure actually match the two numbers it's derived from.
Copilot AI review requested due to automatic review settings July 27, 2026 14:28

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.

Pull request overview

Adds a new “Numeric Sanity Checker” submission to the skill gallery, intended to help agents verify common arithmetic relationships (sum-to-total, percentages-to-100, and percent change) before presenting numeric claims.

Changes:

  • Introduces a new agent skill (SKILL.md) describing when/how to sanity-check arithmetic in generated reports.
  • Adds a bundled Python checker script to validate sums, percentage totals, and percent-change calculations from a JSON input.
  • Provides submission metadata and a human-facing README describing usage and scope.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
submissions/numeric-sanity-checker/SKILL.md Defines the agent-facing procedure and guardrails for numeric sanity checks, including how to run the bundled script.
submissions/numeric-sanity-checker/scripts/check_numbers.py Implements the JSON-driven checker for sum/percentages/percent-change validations.
submissions/numeric-sanity-checker/README.md Human-facing overview and usage notes for the skill and its checker script.
submissions/numeric-sanity-checker/metadata.json Registers the submission (name/description/platforms/tags/author/version/dates).

Comment thread submissions/numeric-sanity-checker/scripts/check_numbers.py
Comment thread submissions/numeric-sanity-checker/scripts/check_numbers.py Outdated
Tim (Timziito) and others added 2 commits July 27, 2026 16:39
Matches the invocation shown in SKILL.md and README.md, per Copilot review feedback on the PR.
Copilot AI review requested due to automatic review settings July 27, 2026 14:51

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

submissions/numeric-sanity-checker/scripts/check_numbers.py:114

  • main() passes the parsed JSON directly to run() without validating its shape, so inputs like a single JSON object (not a list) or invalid JSON will crash with a traceback. The script should emit a clear error and exit with a non-zero code, and it should close the file handle when reading from disk.
    text = sys.stdin.read() if args.path == "-" else open(args.path, encoding="utf-8").read()
    checks = json.loads(text)
    results = run(checks)

Comment thread submissions/numeric-sanity-checker/scripts/check_numbers.py
Copilot AI review requested due to automatic review settings July 27, 2026 19:53
Fixes the issues flagged in the automated review: see PR discussion for details.

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

}


def check_percent_change(old: float, new: float, claimed_pct: float, tolerance: float = DEFAULT_PERCENT_CHANGE_TOLERANCE) -> dict:

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.

During testing this only computed relative percent change, so a correctly-worded "margin improved 5 points (18%→23%)" is scored as a FAIL against ~28%. Percentage-point changes are common in real reports, but the check flags them as errors. Consider a points mode (or requiring the caller to state which is meant).

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.

3 participants