Skip to content

Fix strict compact and operator JSON regressions - #2963

Merged
Sapientropic merged 1 commit into
mainfrom
sapientropic/strict-acceptance-2960s
Jun 29, 2026
Merged

Sapientropic merged 1 commit into
mainfrom
sapientropic/strict-acceptance-2960s

Conversation

@Sapientropic

@Sapientropic Sapientropic commented Jun 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Fixed agent background compact success actions so nested foreground actions go through the shared compact denylist; MCP missing-input recovery now returns structured compact content instead of a text JSON wall.
  • Made --operator-json imply JSON for agent subcommands that expose it in this dispatch family, covering aippo, background, plus the same class of drift in macro/feedback.
  • Kept planner/preflight compact output action-sized on large base diffs: compact now reports counts, category/sample summaries, and short --base detail commands while --detail full keeps complete file lists and command text.
  • Split runtime trace producer coverage from non-runtime/future/test-only trace-family contracts so constants-only test_check.successful_check no longer counts as runtime producer evidence.

Closeout class: complete
Evidence level: behavior_run

Closes #2959
Closes #2960
Closes #2961
Closes #2962

Debt Removed

Debt removed: background findings no longer hand-roll nested compact policy fields; the local action allowlist now delegates retained values through the shared compact denylist owner. The --operator-json drift was migrated at the agent dispatch family instead of patched only for two issue examples. Planner/preflight compact output no longer dumps full changed-file walls or 5KB commands into compact mode. Runtime trace producer contracts no longer count a constants-only test-check family as runtime coverage.

Before/after inventory: background compact leak path 1 -> 0; MCP missing-input text-only recovery path 1 -> 0; agent dispatch --operator-json text-output sibling drift found in aippo/background/macro -> 0 in this dispatch family; compact large-surface command wall 5079/5081 chars -> short --base commands; runtime trace producer contract constants-only entries 1 -> 0.

Compact/default output: compact cards show one usable foreground action/state and exclude claim/source/operator proof fields. Detail/operator output: diagnostics and full file/source lists remain available behind --detail full, detail=full, or --operator-json.

Real Acceptance Evidence

#2959 background compact + MCP recovery

aippocampus agent background "compact foreground audit" --json
-> exit=0 status=ok
-> foreground_action keys: arguments, command, id, label, mutation_risk, tool_name, why
-> denied_field_paths=[] safe_action_count=0

MCP tool_handlers.call_agent_background({})
-> isError=True structuredContent=True status=needs_input
-> foreground_action=background_for_task_cue
-> denied_field_paths=[] safe_action_count=1

MCP tool_handlers.call_agent_background({"cue":"compact foreground audit","cwd":repo,"limit":1})
-> isError=False structuredContent=True status=ok
-> foreground_action=reopen_background_finding_source_route
-> denied_field_paths=[] safe_action_count=0

python tools/aippocampus/compact_surface_scan.py --json
-> ok=true checked_count=14 failure_count=0
-> includes CLI background success and MCP agent_background_missing_input

#2960 operator-json means JSON

aippocampus agent aippo --task "host probe" --operator-json
-> exit=0 parsed=True kind=aippocampus_agent_continuity_path status=ok mode=aippo surface=project_workflow_ai_ppocampus

aippocampus agent aippo --task "host probe" --json --operator-json
-> exit=0 parsed=True same core kind/status/mode/surface

aippocampus agent background "compact foreground audit" --operator-json
-> exit=0 parsed=True kind=aippocampus_background_findings_card status=ok mode=background surface=agent_background

aippocampus agent background "compact foreground audit" --json --operator-json
-> exit=0 parsed=True same core kind/status/mode/surface

Structural same-family check:
aippocampus agent macro --cwd <repo> --operator-json
-> exit=0 parsed=True kind=aippocampus_agent_continuity_path status=missing_macro_state_path mode=macro surface=macro_orientation

#2961 compact planner/preflight budget

Baseline reproduced from origin/main worktree at cb2c928e:

python tools/aippocampus/test_plan.py --json --detail compact --base fc52905^
-> 17477 bytes, changed_surface keys included changed_files/categories, changed_files_len=71
-> detail_command_len=5079 preflight_command_len=5081

python tools/aippocampus/changed_surface_preflight.py --json --detail compact --base fc52905^
-> 14445 bytes, detail_command_len=5095

After this patch:

python tools/aippocampus/test_plan.py --json --detail compact --base fc52905^
-> 2860 bytes, changed_file_count=80, affected_files_len=3, affected_files_truncated=True
-> has_full_changed_files=False input_source=base_diff
-> detail_command="python tools/aippocampus/test_plan.py --json --detail full --base fc52905^"

python tools/aippocampus/changed_surface_preflight.py --json --detail compact --base fc52905^
-> 2963 bytes, changed_file_count=80, affected_files_len=3, affected_files_truncated=True
-> has_full_changed_files=False
-> detail_command="python tools/aippocampus/changed_surface_preflight.py --json --detail full --base fc52905^"

python tools/aippocampus/test_plan.py --json --detail full --base fc52905^
-> changed_files_len=80 and full command text preserved
python tools/aippocampus/changed_surface_preflight.py --json --detail full --base fc52905^
-> changed_files_len=80 and full command text preserved

#2962 trace producer contract

runtime_contract=['assistant_final', 'tool_call_succeeded']
non_runtime_contract=['test_check_succeeded']
test_check_in_runtime=False
test_check.successful_check category=external_or_future_or_test_only
runtime_sites:
  assistant_final -> skills/aippocampus/scripts/aippocampus_runtime/recall/rollout_search.py :: ASSISTANT_FINAL_PRODUCER_FAMILY
  tool_call_succeeded -> skills/aippocampus/scripts/aippocampus_runtime/source/behavior_events.py :: TOOL_CALL_SUCCEEDED_PRODUCER_FAMILY

Required Recall/MCP/Source Follow-through

agent recall -> agent deepen/open -> opened source anchor hits:

Real historical cue: 每个 recall APW MCP issue close 前必须贴真实命令

aippocampus agent recall "每个 recall APW MCP issue close 前必须贴真实命令" --cwd <repo> --json
-> status=ok
-> foreground_action: search_memory / search_registry_sources_for_original_cue_anchors
-> why: route labels/opened anchors were too weak; search registered source for original cue anchors

aippocampus search --all "每个 recall APW MCP issue close 前必须贴真实命令" --json
-> match_count=1 useful_target_hit=True
-> foreground_action: search_memory / open_registry_search_source_window
-> command: aippocampus search --open-source --thread-key session:019eda74-6376-7051-a148-c1ecae95c8ba --message-id msg_5ce8763d38dab2be38a9 --line 69840 --json

aippocampus search --open-source --thread-key session:019eda74-6376-7051-a148-c1ecae95c8ba --message-id msg_5ce8763d38dab2be38a9 --line 69840 --json
-> status=ok source_window_count=5 authority=source_open opened source anchor hits=1

MCP follow-through:

MCP agent_recall({query: cue, cwd: repo})
-> structuredContent=True status=ok action=search_memory/search_registry_sources_for_original_cue_anchors

MCP search_memory(action.arguments + {cwd: repo})
-> structuredContent=True match_count=1 useful_target_hit=True action=search_memory/open_registry_search_source_window

MCP search_memory(open_action.arguments + {cwd: repo})
-> structuredContent=True kind=aippocampus_registry_source_window source_scope=opened_source_window
-> has_source_window=False has_source_window_preview=True primary_message_id=msg_5ce8763d38dab2be38a9 opened source anchor hits=1

Verification

python -m unittest tests.aippocampus.test_agent_background tests.aippocampus.test_compact_surface_scan tests.aippocampus.test_agent_feedback_macro_cli tests.aippocampus.test_agent_opt_in_aippo_semantic tests.aippocampus.test_test_plan tests.aippocampus.test_changed_surface_preflight tests.aippocampus.test_agent_trace_admission -v
-> Ran 127 tests in 44.686s OK

python -m ruff check <changed files>
-> All checks passed!

git diff --check
-> pass

python tools/aippocampus/compact_surface_scan.py --json
-> ok=true checked_count=14 failure_count=0

python tools/aippocampus/changed_surface_preflight.py --json --detail compact
-> status=manual_required_pending, runnable_gates_status=pass, ran_command_count=11
-> first_manual_required_claim=recall-mcp-source-followthrough, satisfied above with CLI and MCP dogfood

Notes

  • Compact foreground output stayed action-sized; proof material is in tests/PR evidence/detail paths, not injected into compact product cards.
  • No new issue was opened from this pass: the only extra structural drift found in the touched family was --operator-json on sibling agent subcommands, fixed here rather than filed as separate noise.

@Sapientropic
Sapientropic merged commit 8ec859b into main Jun 29, 2026
27 of 29 checks passed
@Sapientropic
Sapientropic deleted the sapientropic/strict-acceptance-2960s branch June 29, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant