Skip to content

feat: Milestone 9 — exposure filtering layer (student_public / research_instructor)#14

Merged
shaypal5 merged 1 commit into
mainfrom
feat/milestone-9-exposure-filtering
Apr 29, 2026
Merged

feat: Milestone 9 — exposure filtering layer (student_public / research_instructor)#14
shaypal5 merged 1 commit into
mainfrom
feat/milestone-9-exposure-filtering

Conversation

@shaypal5

Copy link
Copy Markdown
Contributor

Summary

  • exposure/filters.py: BundleFilter frozen dataclass defining which metadata artifacts to include; FILTERS dict keyed by ExposureMode; get_filter() accessor.
  • exposure/redaction.py: write_metadata_dir() — writes metadata/ containing graph.json, graph.graphml, world_spec.json, latent_registry.json, and mechanism_summary.json.
  • exposure/modes.py: apply_exposure(bundle, root, mode) — dispatches filtering; skips entire metadata/ directory for student_public mode, writes full truth for research_instructor.
  • Wired into api/bundle.py between dataset-card and manifest steps so exposure filtering is part of the standard bundle-write pipeline.
  • 24 new tests covering both exposure modes, filter correctness, metadata file presence/absence, and round-trip integrity.
  • Total: 545 tests passing.

Test plan

  • pytest tests/exposure/ — 24 tests for filter lookup, metadata writing, and mode dispatch
  • pytest — full suite (545 passing)
  • ruff check . — clean
  • Verify student_public bundles contain no metadata/ directory
  • Verify research_instructor bundles contain full metadata/ with all 5 artifacts

🤖 Generated with Claude Code

…ch_instructor)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 29, 2026 05:16
@shaypal5 shaypal5 added type: feature New capability layer: exposure exposure/ truth-mode filtering layer: api api/ public Python surface labels Apr 29, 2026
@github-actions

Copy link
Copy Markdown

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:

Tool ref: v4
Tool version: 4.0.20
Trigger: pull request opened
Workflow run: 25092190678 attempt 1
Comment timestamp: 2026-04-29T05:16:59.547794+00:00
PR head commit: a4cb963d4b60b377aa934e4ab184df90618e9085

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.exposure modules for per-mode filter lookup and mode dispatch, plus metadata writing for research_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.

Comment thread leadforge/exposure/modes.py
Comment thread leadforge/exposure/redaction.py
Comment thread leadforge/exposure/filters.py
Comment thread tests/exposure/test_exposure.py
@shaypal5 shaypal5 merged commit 7c12af1 into main Apr 29, 2026
9 checks passed
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>
@shaypal5 shaypal5 deleted the feat/milestone-9-exposure-filtering branch June 11, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

layer: api api/ public Python surface layer: exposure exposure/ truth-mode filtering type: feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants