feat: Milestone 9 — exposure filtering layer (student_public / research_instructor)#14
Merged
Merged
Conversation
…ch_instructor) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
pr-agent-context report: No unresolved review comments, failing checks, or actionable patch coverage gaps were found on PR
#14. Treat this PR as all clear unless new signals appear.Run metadata: |
There was a problem hiding this comment.
Pull request overview
Adds an exposure-mode layer to the bundle write pipeline so that “student_public” bundles omit hidden-truth metadata while “research_instructor” bundles include a metadata/ directory with additional truth artifacts.
Changes:
- Introduces
leadforge.exposuremodules for per-mode filter lookup and mode dispatch, plus metadata writing forresearch_instructor. - Wires exposure handling into
leadforge.api.bundle.write_bundle()before manifest generation. - Adds a new
tests/exposure/suite validating both modes and metadata content.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
leadforge/exposure/filters.py |
Defines BundleFilter, FILTERS, and get_filter() for ExposureMode → filter resolution. |
leadforge/exposure/modes.py |
Adds apply_exposure() entry point used during bundle writing. |
leadforge/exposure/redaction.py |
Implements write_metadata_dir() to write 5 hidden-truth metadata artifacts in instructor mode. |
leadforge/api/bundle.py |
Integrates exposure handling into the standard write_bundle() pipeline before manifest generation. |
tests/exposure/test_exposure.py |
Adds unit + integration tests for filter correctness, metadata presence/absence, and determinism. |
tests/exposure/__init__.py |
Creates the exposure test package. |
.agent-plan.md |
Updates milestone tracking/status text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
shaypal5
added a commit
that referenced
this pull request
Apr 29, 2026
…n get_filter, clean stale metadata/ (#15) - Rename `exposure/redaction.py` → `exposure/metadata.py` (name now matches behavior) - `apply_exposure()` removes pre-existing `metadata/` dir in `student_public` mode to prevent hidden-truth leakage on path reuse - `get_filter()` now accepts `str | ExposureMode` with automatic coercion - Add regression test for path-reuse leakage and string-mode acceptance test Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
exposure/filters.py:BundleFilterfrozen dataclass defining which metadata artifacts to include;FILTERSdict keyed byExposureMode;get_filter()accessor.exposure/redaction.py:write_metadata_dir()— writesmetadata/containinggraph.json,graph.graphml,world_spec.json,latent_registry.json, andmechanism_summary.json.exposure/modes.py:apply_exposure(bundle, root, mode)— dispatches filtering; skips entiremetadata/directory forstudent_publicmode, writes full truth forresearch_instructor.api/bundle.pybetween dataset-card and manifest steps so exposure filtering is part of the standard bundle-write pipeline.Test plan
pytest tests/exposure/— 24 tests for filter lookup, metadata writing, and mode dispatchpytest— full suite (545 passing)ruff check .— cleanstudent_publicbundles contain nometadata/directoryresearch_instructorbundles contain fullmetadata/with all 5 artifacts🤖 Generated with Claude Code