Skip to content

feat(context-pack): Phase 11 producer/consumer — exclusions + block metadata#102

Merged
MCamner merged 1 commit into
mainfrom
feat/phase11-pack-exclusions-metadata
Jun 23, 2026
Merged

feat(context-pack): Phase 11 producer/consumer — exclusions + block metadata#102
MCamner merged 1 commit into
mainfrom
feat/phase11-pack-exclusions-metadata

Conversation

@MCamner

@MCamner MCamner commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Wires the mq-agent producer/consumer side of the Phase 11 contract that mqobsidian shipped (11a negative context #19, 11b block metadata #20). mqobsidian owns the schemas; this PR makes mq-agent actually produce and consume them in task-pack selection.

What changed

11a — structured negative context

  • Packs now render ## Exclusions with forbidden / fallback / irrelevant kinds instead of the flat ## Do not read first list.
  • New exclusions= param on build_task_pack + --exclude kind:item[:reason] CLI option.
  • Legacy do_not_read is still accepted and folds in as kind irrelevantbackward compatible. Card Avoid reading unless needed items map the same way.

11b — block metadata consumption in selection

  • When a context-card.v1 carries freshness / scope / publishability, selection uses them:
    • local-rich / local-only → card withheld from the pack, recorded as a forbidden exclusion (publish boundary, machine-checked).
    • archived → demoted to a fallback exclusion.
    • stale → kept but flagged in Notes.
  • Cards without metadata behave exactly as before (current / public-safe). No production card triggers a gate today — the real cards are all public-safe/current.

Surface

  • JSON result gains exclusions + card_metadata.
  • parse_frontmatter helper added to context_export.py.
  • Doc (PHASE5_TASK_PACKS.md) and worked example regenerated to the new format.

Boundary

mqobsidian owns context-pack.v1 / context-card.v1 and the enums; mq-agent owns task→pack selection. No schema is defined here.

Tests

Full suite green (649). Added coverage for: structured exclusions + severity ordering, do_not_read backward compat, publishability/scope withholding, archived→fallback, stale-flagging, and --exclude CLI parse + rejection.

🤖 Generated with Claude Code

mq-agent is the producer/consumer for the Phase 11 contract mqobsidian
shipped (11a negative context, 11b block metadata). This wires both ends:

- Render structured `## Exclusions` (forbidden/fallback/irrelevant) instead
  of the flat `## Do not read first` list. `do_not_read` stays accepted and
  folds in as kind `irrelevant` (backward compatible); new `exclusions`
  param + `--exclude kind:item[:reason]` CLI option produce them directly.
- Consume context-card.v1 block metadata in selection: a local-rich/
  local-only card is withheld from the pack as a `forbidden` exclusion
  (publish boundary, machine-checked), an `archived` card drops to a
  `fallback` exclusion, a `stale` card is kept but flagged in Notes. Cards
  without metadata behave exactly as before.
- Return `exclusions` + `card_metadata` in the JSON result for consumers.
- Tests for old (do_not_read) and new (structured/metadata) paths; doc and
  worked example regenerated to the new format.

mqobsidian owns the schemas; this repo owns the task->pack selection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MCamner MCamner merged commit 6ffa21c into main Jun 23, 2026
5 checks passed
@MCamner MCamner deleted the feat/phase11-pack-exclusions-metadata branch June 23, 2026 00:29
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.

1 participant