plan: HINTS-STRUCTURED — machine-parseable next-action objects#207
Conversation
Plan for issue #195 item 7 — machine-parseable `hints_structured` field alongside existing `hints: list[str]` road signs on all five MCP outputs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
HumanBean17
left a comment
There was a problem hiding this comment.
Plan Review
Overall this is a well-structured plan. One correctness issue and a few suggestions:
Correctness: frozenset(args.items()) will break on nested dicts
The plan specifies dedup key as (tool, frozenset(args.items())). This fails when args contains nested dicts — and the plan already includes such cases (e.g. args={"filter": {"path_prefix": seed}} from resolve → find route, args={"filter": {"role": "SERVICE"}} from search weak-score). frozenset on a dict value raises TypeError.
Suggest using json.dumps(args, sort_keys=True) as the dedup key instead, or flattening args before hashing.
Suggestions
-
Neighbors empty structural hints — the mapping is flagged as medium-severity in the risk table but doesn't include a concrete
argsshape. Adding 1-2 examples would remove ambiguity during implementation. -
resolve_v2model_copypattern — this call site is called out as special (usesmodel_copy(update=...)instead of direct construction) but the plan doesn't show the before/after. A one-liner (model_copy(update={"hints": str_hints, "hints_structured": struct_hints})) in the plan would prevent confusion. -
Proposal lifecycle — the plan status says "active (planning)" while the agent prompt's definition of done says "Proposal — locked." Clarify whether locking happens when the plan merges or when implementation starts.
Otherwise looks good — backward compatibility, circular import prevention, parity invariant, and test coverage are all solid.
…model_copy, proposal lifecycle
- Fix dedup key from frozenset(args.items()) to json.dumps(args, sort_keys=True)
— handles nested dicts like {"filter": {"path_prefix": ...}}
- Add concrete args examples for neighbors empty structural hints (v3)
- Show explicit before/after for resolve_v2 model_copy call site
- Clarify proposal lock timing: locks when plan PR merges, not during implementation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
HINTS-STRUCTURED(issue hints: Python-style neighbors(['id'],…) copies fail; JSON stringified ids work #195 item 7): aStructuredHintmodel andhints_structured: list[StructuredHint]field on all five MCP output models.Scope
plans/PLAN-HINTS-STRUCTURED.mdplans/AGENT-PROMPTS-HINTS-STRUCTURED.mdKey decisions
generate_hintsreturning(list[str], list[StructuredHint])— unified trigger logic, no parallel generators.mcp_hints.py(avoids circular import withmcp_v2.py).actionable: boolflag distinguishes direct tool calls (True) from advisory/partial hints (False).hints: list[str]unchanged;hints_structuredis additive.Links
propose/HINTS-STRUCTURED-PROPOSE.md🤖 Generated with Claude Code