Skip to content

Add private manifest discovery and configuration checks - #250

Merged
chrisknvidia merged 17 commits into
mainfrom
feat/christopherk/discovery-static-policy
Oct 30, 2026
Merged

chrisknvidia merged 17 commits into
mainfrom
feat/christopherk/discovery-static-policy

Conversation

@chrisknvidia

@chrisknvidia chrisknvidia commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add private building blocks for manifest/member discovery, dependency resolution, MCP configuration and endpoint validation, and hook/permission/component analysis. These functions share the bounded readers and client profiles available on the base branch, while keeping discovery separate from policy decisions.

The implementation handles plugin declarations for Claude Code, Codex, Cursor, Agent Plugins and bundle manifests. Existing public CLI dispatch, schema registration, format detection, policy defaults and report routing remain unchanged. The new functions expose private analysis records; they do not add inventory/report composition or public entrypoints.

The diff against the configured base branch spans 31 files: +20,310 / −17, including 14,578 net production lines and 5,705 net test lines.

The implementation provides bounded passive records with source provenance and explicit incomplete scans; local repository/reference resolution without fetching dependencies; effective MCP/LSP declaration ordering; and independent static policy engines. Shared permission helpers avoid a backward import between MCP and hook analysis. Existing strict filesystem reads retain their defaults.

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 4d7cd460c595519de047cca05f5014ccb757dd2c, with base revision 9dc2841b:

  • Full four-worker run: 16,579 passed, 25 skipped, 3 failed in 13m59s. The failures were the existing streamed-timeout stderr assertion, 0.1-second process diagnostic assertion and 2-second malformed-proxy classification test. All three passed in six subsequent serial runs (18 passes). The stderr failure also reproduced on unchanged main; the other two have not reproduced in bounded main serial reruns. Their owning test/runtime files are identical across main and both branches. The failed full run is retained; this is not an all-green full-suite claim. Lint and sdist/wheel builds pass.
  • Base-only installed package: 15 actual public 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.
  • Fresh installed-wheel private workflows operate on real Claude/Codex/Cursor/Agent Plugins filesystem trees, with Harbor, LiteLLM, Anthropic, OpenAI and MCP packages absent. All four valid trees complete discovery and produce expected static findings.
  • Real filesystem/local Git cases cover bundle dependencies, profile-specific paths, member types, declaration precedence and read limits. Installed regression probes cover truncation visibility, overridden invalid LSP records and per-source UTF8/frontmatter contracts.
  • Independent review findings on completeness, effective declaration ordering and reader compatibility were fixed and rechecked. Existing public compatibility guards remain in place.

These are private static-analysis paths: no hook execution, MCP endpoint connection or live agent/provider workflow was run. Native Windows behavior requires the Windows CI lane, which now includes the new filesystem contracts. Private records retain raw bounded source values and are not public report payloads; policy findings use the existing redaction contract.

Release Impact

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

No public entrypoint or automatic activation is added. In particular, private dependency resolution can recognize GitLab references, while the existing public model's GitHub/Git acceptance remains unchanged.

Review corrections and current validation

Previously reviewed head: 1bdb894236c524924f0d3d06ae6a63fcba04d784.

  • Additive client discovery retains default members; dependency paths reject NUL; escaped schema opt-in stays visible after bounded parse refusal; declared filename whitespace stays literal.
  • MCP security checks use shipped client defaults without reading host environment values. npm preserves package flags preceding exec. Hook analysis retains later blocking risks, handles quoted pipelines and executable names, and reports work/depth/wrapper exhaustion explicitly.
  • A precise rule/value/path exception covers the synthetic HTTP-hook credential used in tests. Gitleaks 8.30.0 passes on the final tracked/new-file snapshot.
  • Combined affected suites: 796 passed. Post-integration public/profile/parser checks: 72 passed. Independent re-review and safe controls pass.
  • Final wheel/sdist build and isolated base-only installed acceptance pass; all 203 production files in the wheel match the source. Optional runtime/provider packages remain absent. The complete local run finished with 17,145 passed, 17 failed and 28 skipped. The exact 17 failures passed on one serial rerun with the locked environment on PATH (17 passed in 5.19s); the full parallel run itself was not green. Thirteen failures were generated-shell tests selecting system Python 3.9.6 instead of project Python 3.12; the other four narrow-deadline cases passed serially under lower contention.

The failed cases were test_bounded_harbor_process_timeout_preserves_redacted_diagnostic_tail, two test_bedrock_model_probe_classifies_malformed_effective_proxy_as_fatal cases, test_bedrock_model_probe_classifies_real_invalid_region_as_fatal, test_generated_custom_only_script_accepts_overall_only_custom_reward, and twelve test_generated_custom_only_script_rejects_invalid_overall_score cases. No source changes or test skips were used for the rerun. Security, package, DCO and image checks pass; remaining platform CI is pending.

Current revision and validation

Current head: 636b532153c57cfece620409e41706b3ed9fb7ca, with base revision 02899891bb0612ba264daec0778f2cba52a3b8ce. This head has the same tree as tested 088b645d; the last merge only incorporates main's unchanged tree into the history. The updated base branch was merged without rewriting history. Repository selectors and remote URLs now normalize case before removing the optional .git suffix, so .git, .GIT and mixed-case forms classify and deduplicate consistently. Real-Git regression tests demonstrated the failure before the fix.

On the integrated tree, 233 targeted dependency, discovery, rubric, bounded-parser and public-compatibility tests passed (1 skipped), lint and wheel/sdist builds passed, and the pinned Gitleaks 8.30.0 scan passed across 427 commits. A fresh base-only installed wheel exercised 64 local-Git classification cases and generated 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. No live provider or remote endpoint was exercised.

@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.

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.

Comment thread src/skillevaluator/plugin_discovery.py Resolved
Comment thread src/skillevaluator/plugin_manifest.py Resolved

@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.

One further path-identity issue is reproducible in private discovery.

Comment thread src/skillevaluator/plugin_paths.py Resolved

@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 independent re-review confirmed an additional quoted-pipeline policy bypass in this diff.

@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 same independent pass found a raw-text fast-path that hides valid shell executable spellings.

@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 final parser pass also confirmed a wrapper-depth limit that is currently silent.

@rng1995
rng1995 marked this pull request as ready for review October 29, 2026 20:33

@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 1bdb894, stacked on the fixed #249 foundation. All 11 inline findings are fixed with regression tests and independent re-review. The 796-test affected suite, 72 post-integration public/profile/parser checks, isolated base-only wheel acceptance, source-byte comparison and Gitleaks pass. The full local run recorded 17,145 passes, 28 skips and 17 failures; the exact 17 failures passed on one serial rerun with the correct locked interpreter on PATH. The parallel full run is accurately retained as non-green in the description. No actionable code findings remain. Remaining platform CI checks must complete before merge; approval does not claim pending checks have passed.

@chrisknvidia chrisknvidia changed the title Add private discovery and configuration analysis Add private manifest discovery and configuration checks Oct 29, 2026
Base automatically changed from feat/christopherk/shared-grading-foundations to main October 29, 2026 23:02
@chrisknvidia
chrisknvidia merged commit b6bb5ba into main Oct 30, 2026
20 checks passed
@chrisknvidia
chrisknvidia deleted the feat/christopherk/discovery-static-policy branch October 30, 2026 00:43
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
* Add private plugin discovery and static policy engines
* Exercise private discovery and script reads in native Windows CI
* Keep passive state vocabulary scoped to dependency resolution
* Report truncated discovery and preserve effective declaration order
* Preserve component-specific text decoding and rule frontmatter
* fix: normalize repository suffixes consistently

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]>
chrisknvidia pushed a commit that referenced this pull request Nov 11, 2026
…448)

Three docstrings cite `skillevaluator.plugin_components`, which was never created. The
inventory lives in `skillevaluator.plugin_inventory`: the citations landed in #250
(2026-10-29) one day before #257 (2026-10-30) composed the inventory under the
`plugin_inventory` name, so the references describe a module that the implementation
replaced before either shipped.

Two of the three are `:mod:` roles, where the fix is unambiguous, so those change here:

- `plugin_mcp.py:13`
- `plugin_paths.py:16`

The third, `plugin_manifest.py:280`, points at `build_plugin_inventory` — a *function*
that also does not exist. Its sentence describes that function taking an `additional`
argument, while `plugin_inventory_for_root` takes `(path, *, allowed_private_hosts,
hook_allowed_urls)`, so picking a replacement means guessing what the paragraph meant.
Left alone rather than guessed at; say the word and I will take it separately once the
intended signature is clear.

Found by resolving Sphinx cross-reference roles in docstrings against the symbols the
package actually defines, then checking dotted targets on the filesystem — the first
version of that check reported `harbor.upload.db_client` as missing in another repo,
which is how I learned to resolve module paths rather than symbol names.

Signed-off-by: lxcxjxhx <[email protected]>
Co-authored-by: lxcxjxhx <[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