Skip to content

Share deterministic grading and add bounded input readers - #249

Merged
chrisknvidia merged 11 commits into
mainfrom
feat/christopherk/shared-grading-foundations
Oct 29, 2026
Merged

chrisknvidia merged 11 commits into
mainfrom
feat/christopherk/shared-grading-foundations

Conversation

@chrisknvidia

@chrisknvidia chrisknvidia commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Host grading and the standalone Harbor verifier currently carry duplicate shell parsing and deterministic checks. Both now consume the same lexer, invocation parser and check implementation; small adapters preserve the standalone argument and result contracts.

The change also adds bounded structured-input readers, narrow filesystem helpers and private client manifest profiles. Existing public commands, detection, policy defaults and report routing retain their current behavior.

Production code is reduced by 5,247 lines net. Across all 20 changed files, including tests, packaging and CI, the diff is +5,946 / −10,175 (net −4,229). The standalone verifier also receives explicit Python 3.9 compatibility corrections and an installed-package Python 3.9 CI smoke.

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes
  • Ran make lint
  • Ran make test
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

Verification at 9dc2841bb00c03d3daaa2b150b0479c14e8c0210:

  • Frozen full suite: 15,690 passed, 22 skipped in 12m07s with PYTEST_ADDOPTS='-n 4' make test; lint and sdist/wheel builds also pass.
  • Base-only installed package: 15 actual console-entrypoint cases and 44 JSON/HTML/Markdown/SARIF reports match main 47f6058. Comparisons normalize run paths and timestamps; console comparison also ignores whitespace and box borders. Public command/option, schema, detection and policy contract probes match.
  • Full-result differential matrix: 6,384 host and 6,384 standalone cases have no differences against that main snapshot.
  • Real shell differential: 1,577 of 1,727 cases executed, with zero host/standalone divergence or baseline score changes. It retains one inherited false positive and 150 unavailable cases, so this diagnostic is not an all-green oracle.
  • Installed wheel staging, actual local Python 3.9 and network-disabled Docker Python 3.9 pass. Five real verifier executions produce complete reward files matching the main verifier on Python 3.12.
  • Independent review covered compatibility adapters, grading output, import isolation, historical comparison isolation and packaging. Findings were fixed and independently rechecked.

Live agent/provider, judge and Harbor backend E2E was not run because no provider is configured. Container verification uses controlled trajectories and the existing judge-skip paths. Native Windows and the remaining CI platform/version matrix still require CI results.

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

Documents the standalone verifier's Python 3.9 compatibility correction.

Review corrections and current validation

Previously reviewed head: 976538f98630d6e74782483968da3312d2cbca07. That branch included main at the time and preserved both changelog updates.

  • YAML merge expansion is bounded on the composed node graph before construction in both strict and last-key-wins modes. Per-mapping and aggregate work bounds include overwritten pairs.
  • Regression coverage preserves ordinary merge precedence, duplicate-key behavior, shared grading contracts, and unchanged public command and report behavior.
  • Independent review found no remaining issue in the YAML fix. The bounded-parser suite passed 51 tests; shared-grading/adaptor review passed 2,102 focused tests.
  • Wheel/sdist builds, isolated installed-verifier execution on Python 3.9.6, Ruff, and pinned Fern validation pass. Security, package, DCO, image verification and Python 3.13 CI have passed. Remaining platform checks are pending; this code approval does not claim that pending checks have completed.

Current revision and validation

Current head: 02899891bb0612ba264daec0778f2cba52a3b8ce, merged with main 0c3e55c4a3528b078dc25d90d0341f1a4abca981 without rewriting history. The latest main merge changed history only: both the main tree and this PR tree are byte-identical to the previously tested trees (935b1628 and 6b417adb). Gitleaks passed on the resulting history. The only conflict was in CHANGELOG.md; both the verifier and rubric-evaluation release notes were retained.

After integration, 233 targeted dependency, discovery, rubric, bounded-parser and public-compatibility tests passed (1 skipped), lint passed, and wheel/sdist builds passed on the integrated tree. An installed base-only wheel ran 64 real local-Git dependency checks and produced JSON and Markdown CLI reports. The combined local full suite finished with 17,204 passed, 28 skipped and 1 failed: test_exec_cancellation_terminates_background_descendants observed a background child write after cancellation. The test and its process-management implementation are identical to current main. The exact case passed six serial runs on the tested integration tree and six on main; the full-run failure's cause remains unconfirmed. Fresh hosted CI is in progress, and earlier results above remain tied to their original heads.

@chrisknvidia
chrisknvidia marked this pull request as ready for review October 29, 2026 16:39

@rng1995 rng1995 left a comment

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.

The shared grading adapters preserve the contracts examined so far. One bounded-input issue needs a regression fix before approval. I reproduced the inline findings without contacting endpoints or executing declared hooks/packages. I will address them with regression tests and recheck the resulting head before approval.

@rng1995 rng1995 left a comment

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.

Reviewed 976538f. The inline YAML merge-expansion issue is fixed and independently rechecked; shared grading contracts, installed Python 3.9.6 verifier behavior, bounded readers and the public activation boundary are preserved. Focused tests, builds, Ruff, Fern and completed security/package checks pass. No actionable code findings remain. Some platform CI checks are still pending and must complete before merge; this is approval of the reviewed code, not an all-CI-green claim.

@chrisknvidia chrisknvidia changed the title Share grading logic and add bounded input profiles Share deterministic grading and add bounded input readers Oct 29, 2026
@chrisknvidia
chrisknvidia merged commit 064eb27 into main Oct 29, 2026
20 checks passed
@chrisknvidia
chrisknvidia deleted the feat/christopherk/shared-grading-foundations branch October 29, 2026 23:02
rng1995 added a commit that referenced this pull request Oct 30, 2026
@rng1995 rng1995 mentioned this pull request Oct 30, 2026
15 of 20 tasks
chrisknvidia added a commit that referenced this pull request Oct 30, 2026
* refactor: add bounded input and private format foundations
* refactor(tier3): share standalone shell lexical rules
* refactor(tier3): share complete shell invocation analysis
* refactor(tier3): use one deterministic grading implementation
* docs: clarify metadata walk preconditions
* fix: snapshot shared helpers for historical shell comparisons
* fix: isolate source and historical verifier imports

Signed-off-by: Christopher Kevin <[email protected]>
chrisknvidia pushed a commit that referenced this pull request Oct 30, 2026
* chore: start follow-up fixes for the #249 and #250 review
* fix(security): unwrap nested env defaults without recursion
* fix(security): treat an Authorization header with any scheme as a credential
* fix(security): recognise current OpenAI and Anthropic API key shapes
* fix(security): drop URL userinfo written with one slash from report text
* fix(security): keep userinfo out of safe_url for one-slash URLs
* test: restore the MCP and hook URL credential parity test
* fix(security): allow separators between references in an Authorization header
* fix(plugin): report hook auto-approval when the allow decision is computed
* fix(plugin): see the interpreter behind a wrapper option that takes a value
* fix(plugin): continue a hook pipeline after a trailing pipe
* fix(plugin): find curl-into-shell pipelines inside Python and JavaScript strings
* fix(plugin): read the hook script after a subshell, cd option or attached ';'
* perf(plugin): unwrap only pipeline stages that start with a launch wrapper
* fix(plugin): follow hook script references past the second level
* fix(security): report inline credentials anywhere in a hook command
* fix(plugin): name the host Claude Code posts to for a backslash hook URL
* fix(security): ignore command substitutions in hook inline-secret checks
* fix(plugin): keep LSP parser chains critical and bound settings checks
* fix(plugin): match MCP merge, Windows root paths and ref redaction
* fix(plugin): classify PowerShell rules and walk tables under doc keys
* fix(security): count directory links against the Windows discovery budget
* test: write the redirect test fixtures as UTF-8
* fix(plugin): drop empty name segments in string dependency refs
* fix(plugin): treat an SSH host alias origin as a hosted remote
* fix(plugin): decode the origin remote URL as UTF-8
* fix(security): refuse dependency refs through .git and other never-content folders
* fix(plugin): cap ref-derived text in dependency reasons
* fix(plugin): keep linked or unreadable marketplace sources advisory
* fix(plugin): probe only the supported manifest paths when locating a plugin
* fix(plugin): list hidden and dotted children of a declared skills folder
* fix(plugin): stop inventorying a Codex commands map
* fix(plugin): report pruned-folder skills in any spelling and incomplete walks
* fix(plugin): split frontmatter at the first closing dashes like Claude Code
* fix(plugin): keep CRLF frontmatter values whole in the lenient retry
* fix(tier3): honour HTTP-date Retry-After in the verifier on Python 3.9
* fix(plugin): report MCP server code in case-variant pruned folders
* test(ci): score a trajectory with the Python 3.9 Harbor verifier
* test(tier3): cover verifier adapter options that change results
* fix(plugin): reject a trailing newline in Agent Plugins schema URLs
* fix(security): keep YAML merges, huge ints and bad tags in bounds
* fix(security): keep a plain = YAML key loading in unique-key mode
* fix(plugin): read a bare 0x IPv4 part as zero in MCP host checks
* fix(plugin): keep MCP URL checks when a reference or bracket hides the host
* fix(plugin): catch MCP command credentials in URLs, Authorization headers and --creds
* fix(plugin): report MCP shell lines behind PowerShell, package runners and other launchers
* fix(plugin): redact and bound MCP transport values and server names in findings
* fix(plugin): scan permission flags in linear time per string
* refactor(plugin): expose the MCP finding message prefix
* fix(plugin): strip the bounded MCP prefix when rewording LSP findings
* test(ci): expect only applicable reward dimensions in the 3.9 smoke

Signed-off-by: Narendran Raghavan <[email protected]>
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