Skip to content

Resolve requirements - #29

Merged
FScholPer merged 6 commits into
mainfrom
resolve_requirements
Oct 7, 2026
Merged

FScholPer merged 6 commits into
mainfrom
resolve_requirements

Conversation

@FScholPer

Copy link
Copy Markdown
Contributor

add reqirements resolve meta layer

Frank Scholter Peres frank.scholter_peres@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH
Provider Information

  • Assisted by devin

Signed-off-by: frank.scholter_peres <frank.scholter_peres@mercedes-benz.com>
Signed-off-by: frank.scholter_peres <frank.scholter_peres@mercedes-benz.com>
Signed-off-by: frank.scholter_peres <frank.scholter_peres@mercedes-benz.com>

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.

Copilot review overview

🔵 Needs a closer look

The documented and fallback requirements_projection command is not executable after the documented installation path.

Review effort: Lite
Findings: None

What changed in this PR

Adds deterministic Sphinx-Needs requirement projection and local MCP-based requirement lookup.

Changes:

  • Adds projection, lookup, validation, and typed-link handling.
  • Registers the resolve_requirements MCP tool.
  • Updates packaging, documentation, instructions, and tests.
File Description
packages/​context-discipline/​tests/​test_requirements_projection.py Tests projection behavior
packages/​context-discipline/​tests/​test_requirements_lookup.py Tests lookup behavior
packages/​context-discipline/​tests/​test_context_discipline_mcp.py Tests MCP integration
packages/​context-discipline/​src/​requirements_projection.py Builds deterministic requirement graphs
packages/​context-discipline/​src/​requirements_lookup.py Resolves requirement IDs and links
packages/​context-discipline/​src/​context_discipline_mcp.py Registers and dispatches the MCP tool
packages/​context-discipline/​README.md Documents usage
packages/​context-discipline/​pyproject.toml Updates package configuration
packages/​context-discipline/​mcp.yml Declares the new tool
packages/​context-discipline/​.apm/​instructions/​working-memory-discipline.instructions.md Adds resolution guidance

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@aryansingh0012 aryansingh0012 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

packages/context-discipline/src/requirements_projection.py
_load_input() (lines 75–98):

Validates and unpacks needs from the JSON structure (line 94-97)
Returns only (document, digest) — the unpacked needs variable is discarded

build_requirements() (lines 145–251):

Calls _load_input() to get the document (line 151)
Then re-derives needs from scratch on lines 152–154:

The same navigation logic (document["versions"] → single version → version["needs"]) and type validation (isinstance(versions, dict), isinstance(needs, dict)) are performed twice. If one path needs to change later (e.g., to support multiple versions), there's a risk of drift.

Better approach: Have _load_input() return the needs dict directly, alongside the document and digest:

@FScholPer

Copy link
Copy Markdown
Contributor Author

@odra can you also please check?

@odra

odra commented Oct 6, 2026

Copy link
Copy Markdown

@FScholPer it needs a rebase

@FScholPer
FScholPer merged commit 950dca8 into main Oct 7, 2026
4 checks passed
@FScholPer
FScholPer deleted the resolve_requirements branch October 7, 2026 11:13
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.

4 participants