feat(conformance): AgentPassport good/bad fixtures + validator patch [T5-1..T5-5] - #47
Merged
Merged
Conversation
…(T5-1..T5-5)
Consumes the AgentPassport model (sourceos-spec T0-1):
- conformance/good/agent-passport-classified.json: valid third_party passport.
- conformance/bad/agent-passport-unclassified.json: no agent_class -> rejected
('unclassified agents are not permitted; anySource is not a valid class').
- conformance/bad/agent-passport-self-elevated.json: third_party with
suppress_user_authorization_prompt+system_bundle -> rejected (class elevation).
- tools/validate_contract.py: route kind:AgentPassport to agent-class rules.
- semantic/agent-system.jsonld: vocabulary import (mirrors T0-3).
make validate (PY=python3) green: good passes, both bad fail as expected. Closes the T5 tranche.
There was a problem hiding this comment.
Pull request overview
Implements Tranche T5 AgentPassport conformance by adding good/bad fixtures, importing the agent-system JSON-LD vocabulary, and extending the validator to enforce AgentPassport agent-class governance invariants outside the WorkstationContract schema.
Changes:
- Added AgentPassport validation path to
tools/validate_contract.pywith class allowlist and elevation rejection forthird_party. - Introduced
semantic/agent-system.jsonldvocabulary import used by conformance artifacts. - Added AgentPassport conformance fixtures under
conformance/goodandconformance/bad.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/validate_contract.py | Adds AgentPassport-specific validation rules (class allowlist + elevation rejection) and bypasses WorkstationContract schema for that kind. |
| semantic/agent-system.jsonld | Adds JSON-LD vocabulary import for agent-system terms used in conformance. |
| conformance/good/agent-passport-classified.json | Adds a “good” AgentPassport fixture expected to validate. |
| conformance/bad/agent-passport-unclassified.json | Adds a “bad” AgentPassport fixture expected to fail due to missing/invalid class. |
| conformance/bad/agent-passport-self-elevated.json | Adds a “bad” AgentPassport fixture expected to fail due to class elevation flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+83
to
+90
| agent_class = doc.get("agent_class") | ||
| if agent_class not in AGENT_CLASSES: | ||
| print( | ||
| f"FAIL agent.class: {p}: unclassified agents are not permitted " | ||
| f"(agent_class={agent_class!r}; anySource is not a valid class)", | ||
| file=sys.stderr, | ||
| ) | ||
| return False |
Comment on lines
+91
to
+94
| if agent_class == "third_party" and ( | ||
| doc.get("suppress_user_authorization_prompt") is True | ||
| or doc.get("system_bundle") is True | ||
| ): |
| "rdfs": "http://www.w3.org/2000/01/rdf-schema#" | ||
| }, | ||
| "@id": "https://spec.sourceos.dev/vocab/agent-system", | ||
| "rdfs:comment": "Agent-system vocabulary import for workstation-contracts conformance. Mirrors the canonical seed in sourceos-spec (T0-3: semantic/agent-system-vocabulary.jsonld) and the OWL/SHACL realization in ontogenesis (T1). Terms: AgentClass, PermissionFlag, ManagedSpace, SeamDefinition, CapabilityException, BundleIdentity.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements Tranche T5. AgentPassport conformance fixtures + agent-class validation, consuming sourceos-spec T0-1.
Verification
make validate→ exit 0:VALID (good): conformance/good/agent-passport-classified.json; both bad fixturesOK: failed as expected; all pre-existing fixtures intact.Acceptance
Closes the T5 tranche.