Repository navigation
Resolve requirements - #29
Conversation
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>
0e28d42 to
253784f
Compare
There was a problem hiding this comment.
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_requirementsMCP 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
left a comment
There was a problem hiding this comment.
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:
|
@odra can you also please check? |
|
@FScholPer it needs a rebase |
add reqirements resolve meta layer
Frank Scholter Peres frank.scholter_peres@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH
Provider Information