feat: agent-activated bootstrap + Parzival v2 injection architecture#53
Merged
Hidden-History merged 7 commits intomainfrom Mar 8, 2026
Merged
Conversation
…(PLAN-011) Move cross-session memory bootstrap from SessionStart hook (startup trigger) to on-demand skill invocation. Sessions start clean — Qdrant context loads only when Parzival is activated by the user. Changes: - Remove startup trigger from SessionStart hook matcher (resume|compact only) - Remove non-Parzival startup bootstrap path from retrieve_bootstrap_context() - Add aim-parzival-bootstrap skill for cross-session memory retrieval - Add aim-parzival-constraints skill for behavioral constraint loading - Add load_parzival_constraints() to injection.py with path traversal guard - Add constraint re-injection to compact path (prevents drift after compaction) - Remove MATCHER_PARZIVAL/MATCHER_STANDARD constants from update_parzival_settings.py - Add update-pov.sh script for V1→V2 Parzival upgrades (--dry-run, config preservation) - Add trace_buffer/ to .gitignore - Update tests to match new architecture PLAN-011 tasks: TASK-030 through TASK-041 (all complete) 3 adversarial review rounds, all findings resolved 2116 tests pass, 0 failures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add missing blank line after inline `import re` in load_parzival_constraints(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
47edc0d to
ebb75f2
Compare
… V1 removal
Phase 1 — Build _ai-memory/ package:
- Relocate 281 canonical Parzival V2 files to root _ai-memory/
- Move 17 skills + 3 agents into _ai-memory/skills/ and _ai-memory/agents/
- Fix 7 skills' import pattern: Path(__file__).parents[3] → expanduser("~/.ai-memory")
- Fix 9 downstream _project_root NameErrors → os.getcwd() / Path.cwd()
- Create step-01b (Qdrant bootstrap) + step-01c (constraint loading)
- Modify step-01 chain: step-01 → 01b → 01c → step-02
- Modify step-04: invoke /parzival-save-handoff and /parzival-save-insight
- Update parzival.md persona: Technical PM & Quality Gatekeeper
- Fix .gitignore: pov/ → /pov/ (root-anchored, DEC-051)
Phase 2 — Create .claude/ shims:
- 17 skill shims preserving all YAML headers (trigger, context, allowed-tools)
- 3 agent shims preserving model fields
- 1 pov agent shim + 9 pov command shims
Phase 3 — Remove V1 files:
- Delete .claude/agents/parzival/ (4 files)
- Delete .claude/commands/parzival/ (8 files)
- Delete scripts/update-pov.sh
Decisions: DEC-051 (.gitignore), DEC-052 (_project_root fix), DEC-053 (persona)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 7 new deployment functions to install.sh for Parzival V2: - detect_parzival_version, cleanup_parzival_v1, deploy_parzival_v2 - deploy_parzival_shims, deploy_ai_memory_skills, deploy_ai_memory_agents - sync_parzival_config_yaml (sed-based, preserves YAML comments) Rewrite setup_parzival() with V2 flow: version detection, V1 upgrade, error-wrapped deployment, scoped stale cleanup. Remove old skill/agent loops from create_project_symlinks(). Delete deploy_parzival_commands(). All cp -r globs use compgen -G guards. PID-suffixed backup paths for parallel safety. Skills/agents always deployed even without Parzival. 2116 tests pass, 0 failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- BUG-206: session_start.py rewritten — resume outputs nothing (DEC-054), non-Parzival compact outputs rich session summary only (DEC-055), Parzival compact unchanged (DEC-056) - FAIL-03: merge_settings.py strips vestigial 'startup' matcher on upgrade - FAIL-07: install.sh removes 13 stale V1 skill directories on install - CHANGELOG.md: Full v2.2.0 entry with upgrade instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- FAIL-06: GC-13 (best practices research) was in oversight workspace but never committed to source repo _ai-memory/ package - Update test_session_start_dual_collection_logic for v2.2.0 architecture: resume early exit (DEC-054), get_recent for session summaries (DEC-055) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bump version 2.1.0 → 2.2.0 in pyproject.toml and embedding service - Fix stale generate_settings.py comment (F-03): matcher is resume|compact for ALL states in v2.2.0 (DEC-054/055), no longer expanded for Parzival - Fix 3 stale test comments referencing removed startup|resume|compact expansion behavior (update_parzival_settings.py no longer modifies matcher) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructures the session injection architecture so that cross-session memory loads when Parzival is activated — not on every session start.
startuptrigger from SessionStart hook; matcher simplified toresume|compactfor all statesretrieve_bootstrap_context()aim-parzival-bootstrapskill for on-demand cross-session memory retrieval from Qdrantaim-parzival-constraintsskill for behavioral constraint loading and post-compact re-injectionload_parzival_constraints()shared utility ininjection.pywith phase parameter sanitizationupdate-pov.shscript for existing users to upgrade Parzival V1 to V2session_start.pycompact path whenparzival_enabled=truePLAN-011: 12 tasks (TASK-030 through TASK-041), all complete.
Review: 3 adversarial code review rounds, all findings resolved.
Tests: 2116 tests pass.
Files Changed
.claude/hooks/scripts/session_start.py.claude/skills/aim-parzival-bootstrap/SKILL.md.claude/skills/aim-parzival-constraints/SKILL.mdscripts/update-pov.shscripts/update_parzival_settings.pysrc/memory/injection.pyload_parzival_constraints()added, non-Parzival path removedtests/hooks/test_session_start.pytests/unit/test_parzival_bootstrap.py.gitignoretrace_buffer/excludedTest Plan
resumeandcompactsession restore paths still work/aim-parzival-bootstrapretrieves cross-session memory from Qdrant/aim-parzival-constraintsloads global and phase-specific constraintsparzival_enabled=trueupdate-pov.sh --dry-runreports changes without modifying filesstartuptrigger exists in session_start.pypytest(2116 tests)Parzival, AI Oversight Agent