Skip to content

test(packaging): validate manual governance example against installed artifacts - #133

Open
dinakarjs wants to merge 2 commits into
agentrust-io:mainfrom
dinakarjs:test/installed-manual-example
Open

dinakarjs wants to merge 2 commits into
agentrust-io:mainfrom
dinakarjs:test/installed-manual-example

Conversation

@dinakarjs

@dinakarjs dinakarjs commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

The installed-package smoke test validates conformance fixtures and factory output but did not execute the manual governance example. A stale literal in that example could escape packaging checks, as seen during #132's version migration.

The existing wheel/source-distribution smoke command now copies and runs the committed example in its fresh installation environment using Python -I and sanitized import variables. The checker requires imports under the environment prefix, exactly one accepted event, successful local log emission and no projection errors. The original emit method is restored after execution.

Repeatable controls run in both artifact-install paths: one valid example, seven negative cases (unsupported version, no event, two events, accepted=False, log_emitted=False, projection errors, and a real package copy imported from outside the installation). Five guard-removal mutations must expose the corresponding false successes. Acceptance/log/projection-result controls replace those result fields after calling the real installed SDK; they test the checker boundary. The version case exercises SDK validation. Mutant rewrite sites are checked for exactly one occurrence.

Validation at head 3176a53, tested tree 7d87de96e7a6c35942199896b9dccb5b80d58ca4:

  • All 179 repository unit tests pass with the checkout selected and default OTel sampler.
  • Wheel and source-distribution fresh installs each pass the existing 6-valid/7-invalid fixture controls plus 1 positive, 7 negative and 5 guard-mutation example controls.
  • Built source distribution includes the current control script. Python compilation and diff whitespace checks pass.
  • Development tests reuse the hash-locked environment. Artifact smoke installations retain the existing dependency resolution behavior.

The check establishes local emission, not collector delivery. The example is copied from the checkout; this does not establish example inclusion in the wheel. #132's contract migration remains separately owned. Runtime SDK, schemas, dependencies and workflow definitions are unchanged.

Prepared with OpenAI Codex. DCO sign-off included. Hosted checks for this updated head and independent maintainer review remain pending.

…facts

Check installed import provenance, event acceptance and log emission in the
existing wheel and source-distribution smoke runs.

Signed-off-by: Srinivasa Consultants <78673153+dinakarjs@users.noreply.github.com>
@dinakarjs
dinakarjs requested review from a team and imran-siddique as code owners November 21, 2026 10:18
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

🟡 Contributor Check: MEDIUM

Check Result
Profile MEDIUM
Credential LOW
Overall MEDIUM

Automated check by AgenTrust Contributor Check.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor check flagged MEDIUM risk label Nov 21, 2026
Run valid and malformed examples in isolated package installs and verify
that removing each checker guard exposes its matching negative control.

Signed-off-by: Srinivasa Consultants <78673153+dinakarjs@users.noreply.github.com>

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

Great packaging-level guardrail set.

Verified:

  • tools/installed_example_control.py:11 asserts imports come from the installed environment (sys.prefix) and not the repo checkout.
  • tools/installed_example_control.py:25-34 enforces exactly one emission and the expected accepted/logged/no-projection-error contract.
  • tools/smoke_wheel.py:49-58 executes the control inside the wheel smoke env, so this runs against installed artifacts.
  • tools/test_installed_example_control.py:61-109 adds negative controls plus guard-mutation checks, proving each guard is both necessary and effective.

This is exactly the kind of end-to-end packaging check that catches regressions early.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review:MEDIUM Contributor check flagged MEDIUM risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants