memento-lifecycle 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. memento_lifecycle-0.1.0/.github/workflows/publish.yml +67 -0
  2. memento_lifecycle-0.1.0/.gitignore +27 -0
  3. memento_lifecycle-0.1.0/.ouroboros/seeds/README.yaml +19 -0
  4. memento_lifecycle-0.1.0/.ouroboros/seeds/memento-mvp.seed.yaml +162 -0
  5. memento_lifecycle-0.1.0/.ouroboros/seeds/memento-v1.seed.yaml +139 -0
  6. memento_lifecycle-0.1.0/.ouroboros/seeds/memento-v2.seed.yaml +134 -0
  7. memento_lifecycle-0.1.0/.ouroboros/seeds/memento-v3.seed.yaml +140 -0
  8. memento_lifecycle-0.1.0/.ouroboros/seeds/memento.seed.yaml +302 -0
  9. memento_lifecycle-0.1.0/LICENSE +21 -0
  10. memento_lifecycle-0.1.0/PKG-INFO +297 -0
  11. memento_lifecycle-0.1.0/README.md +265 -0
  12. memento_lifecycle-0.1.0/docs/README.md +49 -0
  13. memento_lifecycle-0.1.0/docs/architecture.md +142 -0
  14. memento_lifecycle-0.1.0/docs/commands.md +317 -0
  15. memento_lifecycle-0.1.0/docs/concepts.md +126 -0
  16. memento_lifecycle-0.1.0/docs/getting-started.md +144 -0
  17. memento_lifecycle-0.1.0/docs/guide/installation.md +328 -0
  18. memento_lifecycle-0.1.0/docs/guide/publishing.md +163 -0
  19. memento_lifecycle-0.1.0/docs/operators-guide.md +139 -0
  20. memento_lifecycle-0.1.0/docs/plans/2026-05-13-docs-rewrite-information-architecture.md +161 -0
  21. memento_lifecycle-0.1.0/docs/user-guide.md +168 -0
  22. memento_lifecycle-0.1.0/pyproject.toml +66 -0
  23. memento_lifecycle-0.1.0/scripts/install-local.sh +153 -0
  24. memento_lifecycle-0.1.0/scripts/verify-local.sh +14 -0
  25. memento_lifecycle-0.1.0/skills/memento-lifecycle-worker/SKILL.md +30 -0
  26. memento_lifecycle-0.1.0/skills/metis-planner/SKILL.md +35 -0
  27. memento_lifecycle-0.1.0/skills/momus-reviewer/SKILL.md +37 -0
  28. memento_lifecycle-0.1.0/src/memento/__init__.py +3 -0
  29. memento_lifecycle-0.1.0/src/memento/approvals.py +73 -0
  30. memento_lifecycle-0.1.0/src/memento/budget.py +23 -0
  31. memento_lifecycle-0.1.0/src/memento/ci.py +30 -0
  32. memento_lifecycle-0.1.0/src/memento/cli.py +109 -0
  33. memento_lifecycle-0.1.0/src/memento/commands.py +1232 -0
  34. memento_lifecycle-0.1.0/src/memento/competition.py +60 -0
  35. memento_lifecycle-0.1.0/src/memento/context.py +90 -0
  36. memento_lifecycle-0.1.0/src/memento/domain.py +227 -0
  37. memento_lifecycle-0.1.0/src/memento/events.py +76 -0
  38. memento_lifecycle-0.1.0/src/memento/executors/__init__.py +346 -0
  39. memento_lifecycle-0.1.0/src/memento/graph_diff.py +31 -0
  40. memento_lifecycle-0.1.0/src/memento/graph_planning.py +45 -0
  41. memento_lifecycle-0.1.0/src/memento/graphify.py +88 -0
  42. memento_lifecycle-0.1.0/src/memento/kanban.py +239 -0
  43. memento_lifecycle-0.1.0/src/memento/memory.py +41 -0
  44. memento_lifecycle-0.1.0/src/memento/performance_memory.py +105 -0
  45. memento_lifecycle-0.1.0/src/memento/plugin.py +132 -0
  46. memento_lifecycle-0.1.0/src/memento/recovery.py +26 -0
  47. memento_lifecycle-0.1.0/src/memento/repair.py +47 -0
  48. memento_lifecycle-0.1.0/src/memento/reporting.py +131 -0
  49. memento_lifecycle-0.1.0/src/memento/routing.py +169 -0
  50. memento_lifecycle-0.1.0/src/memento/safety.py +116 -0
  51. memento_lifecycle-0.1.0/src/memento/state.py +320 -0
  52. memento_lifecycle-0.1.0/src/memento/verification.py +55 -0
  53. memento_lifecycle-0.1.0/src/memento/verification_enrichment.py +37 -0
  54. memento_lifecycle-0.1.0/src/memento/worker_pool.py +52 -0
  55. memento_lifecycle-0.1.0/src/memento/workers.py +62 -0
  56. memento_lifecycle-0.1.0/src/memento/worktree.py +74 -0
  57. memento_lifecycle-0.1.0/tests/__init__.py +1 -0
  58. memento_lifecycle-0.1.0/tests/test_bootstrap.py +26 -0
  59. memento_lifecycle-0.1.0/tests/test_cli_sample_smoke.py +49 -0
  60. memento_lifecycle-0.1.0/tests/test_domain_state_commands.py +201 -0
  61. memento_lifecycle-0.1.0/tests/test_executor_outbox_lifecycle.py +191 -0
  62. memento_lifecycle-0.1.0/tests/test_kanban_events_workers.py +218 -0
  63. memento_lifecycle-0.1.0/tests/test_local_install_readiness.py +87 -0
  64. memento_lifecycle-0.1.0/tests/test_mvp_lifecycle_foundation.py +137 -0
  65. memento_lifecycle-0.1.0/tests/test_plugin_registration.py +126 -0
  66. memento_lifecycle-0.1.0/tests/test_real_adapters.py +219 -0
  67. memento_lifecycle-0.1.0/tests/test_runtime_quality_contracts.py +175 -0
  68. memento_lifecycle-0.1.0/tests/test_safety_reporting.py +124 -0
  69. memento_lifecycle-0.1.0/tests/test_skills_docs.py +52 -0
  70. memento_lifecycle-0.1.0/tests/test_v1_executor_routing.py +234 -0
  71. memento_lifecycle-0.1.0/tests/test_v2_learning_graph.py +133 -0
  72. memento_lifecycle-0.1.0/tests/test_v3_worker_platform.py +572 -0
@@ -0,0 +1,67 @@
1
+ name: Publish Python package
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ verify-build:
13
+ name: Verify and build package
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Check out repository
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.11"
24
+ cache: pip
25
+
26
+ - name: Install package and release tooling
27
+ run: python -m pip install --upgrade -e '.[dev,release]'
28
+
29
+ - name: Run tests and static checks
30
+ run: |
31
+ python -m pytest -q
32
+ python -m ruff check .
33
+ python -m compileall -q src tests
34
+ memento doctor --json
35
+ memento sample-smoke --workspace /tmp/memento-release-smoke --json
36
+
37
+ - name: Build source and wheel distributions
38
+ run: python -m build
39
+
40
+ - name: Check distribution metadata
41
+ run: twine check dist/*
42
+
43
+ - name: Upload distribution artifact
44
+ uses: actions/upload-artifact@v4
45
+ with:
46
+ name: python-package-distributions
47
+ path: dist/
48
+ if-no-files-found: error
49
+
50
+ publish-pypi:
51
+ name: Publish to PyPI
52
+ needs: verify-build
53
+ runs-on: ubuntu-latest
54
+ environment: pypi
55
+ permissions:
56
+ contents: read
57
+ id-token: write
58
+
59
+ steps:
60
+ - name: Download distribution artifact
61
+ uses: actions/download-artifact@v4
62
+ with:
63
+ name: python-package-distributions
64
+ path: dist/
65
+
66
+ - name: Publish package distributions to PyPI
67
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,27 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ venv/
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ .mypy_cache/
9
+ .coverage
10
+ htmlcov/
11
+ dist/
12
+ build/
13
+ *.egg-info/
14
+
15
+ # Node/tooling
16
+ node_modules/
17
+
18
+ # Local Hermes/Ouroboros runtime state
19
+ .hermes/runtime/
20
+ .memento/
21
+ .ouroboros/data/
22
+ .ouroboros/runs/
23
+
24
+ # Secrets
25
+ .env
26
+ *.secret
27
+ secrets/
@@ -0,0 +1,19 @@
1
+ metadata:
2
+ name: memento-seed-roadmap-index
3
+ created_at: '2026-05-12T13:59:28Z'
4
+ origin: hermes-assisted-ouroboros-fallback
5
+ seeds:
6
+ - phase: MVP
7
+ path: .ouroboros/seeds/memento-mvp.seed.yaml
8
+ summary: 'Foundation: externalized sessions, task graph, evidence, verification, dry-run routing, Graphify/agentmemory
9
+ hooks.'
10
+ - phase: v1
11
+ path: .ouroboros/seeds/memento-v1.seed.yaml
12
+ summary: Real Codex/Aider adapters, worktree isolation, post-dispatch Graphify, memory/graph-aware routing.
13
+ - phase: v2
14
+ path: .ouroboros/seeds/memento-v2.seed.yaml
15
+ summary: Goose/SWE-agent, confidence learning, verification enrichment, graph task proposals, repair/fallback
16
+ budgets.
17
+ - phase: v3
18
+ path: .ouroboros/seeds/memento-v3.seed.yaml
19
+ summary: API worker pool/OpenHands, multi-executor competition, CI/team/release gates, graph-diff regression detection.
@@ -0,0 +1,162 @@
1
+ metadata:
2
+ name: memento-mvp
3
+ version: 0.1.0
4
+ created_at: '2026-05-12T13:59:28Z'
5
+ origin: hermes-assisted-ouroboros-fallback
6
+ phase: MVP
7
+ ambiguity_score: 0.12
8
+ project: memento
9
+ goal: 'Implement the Memento MVP foundation: durable externalized-state sessions, dependency-aware task graph basics,
10
+ evidence ledger basics, verification policy basics, explicit agentmemory hooks, Graphify checkpoint commands,
11
+ and explainable dry-run executor routing without relying on executor-native session memory.'
12
+ constraints:
13
+ - Keep Memento as the lifecycle source of truth for runs, sessions, plans, tasks, dispatches, evidence, and verification
14
+ decisions.
15
+ - Do not depend on executor-native private sessions for correctness, retry, recovery, or progress reporting.
16
+ - Executor summaries, reasoning traces, and self-assessments are advisory and cannot independently satisfy task
17
+ acceptance.
18
+ - Preserve safety gates for destructive git operations, credentials, production/release actions, and forbidden paths.
19
+ - Apply secret redaction and forbidden-path policies before storing evidence payloads, command output, diffs, or
20
+ artifacts.
21
+ - Graphify must be checkpoint-driven by default; continuous watch is optional and must not be required for correctness.
22
+ - agentmemory writeback must store only durable reusable lessons, not temporary task progress, raw logs, commit
23
+ hashes, PR numbers, or raw graph payloads.
24
+ - 'MVP executor adapters should be safe by default: hermes-direct may execute local verification; Codex/Aider adapters
25
+ may be dry-run command construction unless explicitly enabled.'
26
+ - Prefer minimal schema extensions that are compatible with the existing SQLite-backed local state model.
27
+ - Do not introduce always-on background daemons or cron/watchdog behavior.
28
+ - MVP should remain locally verifiable without requiring Codex, Aider, Goose, SWE-agent, OpenHands, or live Graphify
29
+ semantic extraction to succeed.
30
+ scope:
31
+ in:
32
+ - Run/session/task/dispatch/evidence models for externalized-state orchestration.
33
+ - Canonical context bundle generation for ready tasks.
34
+ - Basic evidence ledger with trust levels and append-only semantics.
35
+ - Basic verification policy model and task accepted/rejected verdict evidence.
36
+ - Executor registry and route-task preview with hermes-direct plus dry-run Codex/Aider adapters.
37
+ - Graphify doctor/status/update checkpoint commands and graph evidence records.
38
+ - Explicit agentmemory prefetch/writeback hooks with strict filtering policy.
39
+ - CLI/report updates and tests for all MVP behavior.
40
+ out:
41
+ - Real Codex/Aider process invocation by default.
42
+ - Goose, SWE-agent, OpenHands, or OpenCode production adapters.
43
+ - Confidence-weighted executor performance memory.
44
+ - Automatic graph-derived task decomposition.
45
+ - Multi-executor competition or worker pools.
46
+ acceptance_criteria:
47
+ - name: Externalized session state
48
+ description: Memento stores durable run/session/task/dispatch/evidence state sufficient to reconstruct orchestration
49
+ after process restart.
50
+ verification: Create a run, plan, task, dispatch, and evidence record; restart the CLI process; verify status/report
51
+ reconstructs the same state from SQLite.
52
+ - name: Task graph MVP
53
+ description: Approved plans can materialize a dependency-aware task graph with task status, dependencies, acceptance
54
+ criteria, verification policy, context refs, dispatch refs, and evidence refs.
55
+ verification: Unit tests create a task DAG, reject cycles, and mark tasks ready only after dependencies are accepted.
56
+ - name: Canonical context bundle
57
+ description: Every ready task can produce an immutable executor-agnostic context bundle containing goal, plan
58
+ summary, task spec, dependencies, constraints, verification policy, repo refs, optional memory summary, optional
59
+ graph context, and output contract.
60
+ verification: CLI command or service method writes a bundle artifact; tests validate required fields and immutability
61
+ via stable bundle ID/hash.
62
+ - name: Evidence ledger MVP
63
+ description: Memento records diffs, command results, test results, artifacts, graph snapshots/updates, routing
64
+ decisions, approvals, blocker reports, and QA verdicts with type, trust level, source, status, relationships,
65
+ and content refs.
66
+ verification: Tests append evidence, supersede evidence with a new record, and verify the prior record is not
67
+ silently mutated.
68
+ - name: Verification policy MVP
69
+ description: Dispatch-ready tasks have a verification policy with required evidence and commands; accepted/rejected
70
+ transitions are computed from non-superseded evidence and the final verdict is recorded as evidence.
71
+ verification: A sample task with passing command evidence becomes accepted; a missing or failing required command
72
+ produces an actionable rejected verdict.
73
+ - name: Explainable route-task preview
74
+ description: Memento can preview routing decisions with selected executor, rejected candidates, reasons, risk
75
+ adjustments, fallback chain, approval requirement, and context profile.
76
+ verification: CLI `memento route-task --task-id ... --json` returns a deterministic JSON decision without invoking
77
+ external executors.
78
+ - name: Dry-run executor registry
79
+ description: Executor registry contains hermes-direct plus dry-run Codex and Aider entries with capabilities,
80
+ limitations, health status, and command construction that does not execute by default.
81
+ verification: Tests confirm dry-run dispatch builds invocation metadata and leaves executor_invoked=false unless
82
+ explicit invoke mode is configured.
83
+ - name: Graphify doctor/status/update checkpoint
84
+ description: Memento doctor/status reports Graphify availability and graph state; graph update/checkpoint commands
85
+ record graph_update or graph_snapshot evidence and do not require continuous watch.
86
+ verification: With Graphify absent or failing, doctor reports optional unavailable; with a mocked graphify runner,
87
+ graph update records evidence and graph state.
88
+ - name: agentmemory explicit hooks
89
+ description: Memento exposes explicit memory prefetch/writeback hooks that can attach compact memory summaries
90
+ to bundles and save only filtered durable lessons.
91
+ verification: Tests use a fake memory adapter to verify temporary task progress/raw logs are rejected while repo
92
+ convention lessons are accepted.
93
+ - name: Local verification suite
94
+ description: MVP changes are covered by unit tests, ruff, compileall, doctor, and sample-smoke.
95
+ verification: Run `python -m pytest -q`, `python -m ruff check .`, `python -m compileall -q src tests`, `python
96
+ -m memento.cli doctor --json`, and `python -m memento.cli sample-smoke --workspace /tmp/memento-mvp-smoke --json`
97
+ successfully.
98
+ ontology_schema:
99
+ name: MementoMVPFoundation
100
+ entities:
101
+ - name: MementoSession
102
+ fields:
103
+ - id
104
+ - run_id
105
+ - state
106
+ - goal
107
+ - plan_id
108
+ - task_graph_ref
109
+ - evidence_refs
110
+ - name: TaskNode
111
+ fields:
112
+ - id
113
+ - parent_id
114
+ - status
115
+ - freshness
116
+ - dependencies
117
+ - acceptance_criteria
118
+ - verification_policy
119
+ - evidence_refs
120
+ - name: EvidenceRecord
121
+ fields:
122
+ - id
123
+ - type
124
+ - trust_level
125
+ - status
126
+ - source
127
+ - content_ref
128
+ - relationships
129
+ - name: ContextBundle
130
+ fields:
131
+ - id
132
+ - task_id
133
+ - bundle_hash
134
+ - plan_summary
135
+ - constraints
136
+ - verification_policy
137
+ - output_contract
138
+ - name: RoutingDecision
139
+ fields:
140
+ - id
141
+ - task_id
142
+ - selected_executor
143
+ - rejected_executors
144
+ - reasons
145
+ - fallback_chain
146
+ - risk_adjustments
147
+ evaluation_principles:
148
+ - name: Safety and recoverability
149
+ weight: 0.25
150
+ - name: Evidence-driven correctness
151
+ weight: 0.25
152
+ - name: Executor/session decoupling
153
+ weight: 0.2
154
+ - name: Local testability without external services
155
+ weight: 0.15
156
+ - name: Clear CLI/report UX
157
+ weight: 0.15
158
+ exit_conditions:
159
+ - All MVP acceptance criteria pass locally.
160
+ - No command path relies on OpenCode/Goose/Codex private session memory for correctness.
161
+ - Graphify and agentmemory are optional integrations with graceful degradation.
162
+ - Working tree is clean with a verified commit.
@@ -0,0 +1,139 @@
1
+ metadata:
2
+ name: memento-v1-executor-routing
3
+ version: 1.0.0
4
+ created_at: '2026-05-12T13:59:28Z'
5
+ origin: hermes-assisted-ouroboros-fallback
6
+ phase: v1
7
+ depends_on:
8
+ - memento-mvp
9
+ ambiguity_score: 0.14
10
+ project: memento
11
+ goal: 'Implement production-usable v1 executor routing: real Codex CLI and Aider adapters, isolated worktree dispatch,
12
+ post-dispatch Graphify checkpoints, memory-informed routing, graph-aware risk adjustment, and auditable route
13
+ decisions.'
14
+ constraints:
15
+ - Keep Memento as the lifecycle source of truth for runs, sessions, plans, tasks, dispatches, evidence, and verification
16
+ decisions.
17
+ - Do not depend on executor-native private sessions for correctness, retry, recovery, or progress reporting.
18
+ - Executor summaries, reasoning traces, and self-assessments are advisory and cannot independently satisfy task
19
+ acceptance.
20
+ - Preserve safety gates for destructive git operations, credentials, production/release actions, and forbidden paths.
21
+ - Apply secret redaction and forbidden-path policies before storing evidence payloads, command output, diffs, or
22
+ artifacts.
23
+ - Graphify must be checkpoint-driven by default; continuous watch is optional and must not be required for correctness.
24
+ - agentmemory writeback must store only durable reusable lessons, not temporary task progress, raw logs, commit
25
+ hashes, PR numbers, or raw graph payloads.
26
+ - External executor attempts must run in isolated worktrees by default unless explicitly configured otherwise.
27
+ - Codex/Aider self-reports must be independently verified by Memento before task acceptance.
28
+ - Router may strengthen verification policy using Graphify/agentmemory but must not weaken required checks without
29
+ explicit approval.
30
+ - OpenCode remains manual_or_experimental and is not a default automatic executor in v1.
31
+ scope:
32
+ in:
33
+ - Real Codex CLI adapter with healthcheck, prompt rendering, timeout, result collection, and structured failure
34
+ handling.
35
+ - Real Aider adapter for scoped edits with allowed-files/relevant-files enforcement.
36
+ - Worktree isolation for external dispatch attempts, including partial diff quarantine.
37
+ - Graphify post-dispatch update after verified code/docs changes.
38
+ - agentmemory-informed route-task using repo conventions, known pitfalls, and executor history summaries.
39
+ - Graph-aware risk adjustment using graph staleness, centrality/god-node signals, touched communities, and affected
40
+ files.
41
+ - Auditable routing decisions and user override handling with hard safety preservation.
42
+ out:
43
+ - Goose/SWE-agent/OpenHands production adapters.
44
+ - Automatic confidence-weighted performance aggregation beyond simple memory recall.
45
+ - Multi-executor competition.
46
+ - Deep graph-derived task decomposition.
47
+ acceptance_criteria:
48
+ - name: Codex CLI adapter
49
+ description: Memento can healthcheck Codex, render a context bundle into a one-shot prompt/file invocation, run
50
+ with timeout in an isolated worktree when enabled, collect changed files/output/exit code, and record evidence.
51
+ verification: Mocked tests cover success, timeout, process error, no-change, and verification-failed paths; optional
52
+ live smoke is gated by availability.
53
+ - name: Aider adapter
54
+ description: Memento can route scoped edit tasks to Aider with allowed/relevant files and collect results without
55
+ trusting Aider self-report.
56
+ verification: Tests confirm broad tasks are rejected for Aider when file scope is unclear and scoped tasks produce
57
+ invocation metadata/results.
58
+ - name: Isolated worktree dispatch
59
+ description: External executor dispatches use isolated worktrees by default and never corrupt the canonical workspace
60
+ with unverified partial work.
61
+ verification: A failing external dispatch leaves canonical workspace clean and stores partial diff as quarantined
62
+ advisory evidence.
63
+ - name: Post-dispatch Graphify checkpoint
64
+ description: After verified executor work changes code or docs, Memento triggers a Graphify checkpoint/update
65
+ according to policy and attaches graph evidence.
66
+ verification: Mock Graphify runner records graph_update evidence, graph state current/stale/update_failed, and
67
+ report status after dispatch verification.
68
+ - name: Memory-informed routing
69
+ description: Router uses agentmemory recall for repo conventions, known pitfalls, verification commands, and executor
70
+ suitability when ranking candidates.
71
+ verification: Fake memory adapter changes routing reasons/score and adds verification command suggestions without
72
+ weakening required checks.
73
+ - name: Graph-aware risk adjustment
74
+ description: Router uses Graphify impact signals to adjust task risk, context profile, verification strength,
75
+ and approval requirements.
76
+ verification: A task touching a mocked god node or multiple communities is promoted to higher risk and requires
77
+ stronger verification or approval.
78
+ - name: Manual override with safety preservation
79
+ description: User-specified executor overrides are honored only if hard safety/capability constraints still pass.
80
+ verification: Tests show an override is rejected when sandbox/forbidden-path requirements cannot be satisfied
81
+ and the rejection reason is recorded.
82
+ - name: Actionable retry/fallback
83
+ description: Timeouts, process errors, missing context, no changes, unsafe diffs, and verification failures map
84
+ to policy-driven retry, fallback, repair task, Hermes escalation, or blocked state.
85
+ verification: Unit tests verify failure category to next-action mapping and audit events.
86
+ - name: v1 verification suite
87
+ description: v1 functionality passes local tests and smoke gates.
88
+ verification: Run pytest, ruff, compileall, doctor, sample-smoke, and mocked Codex/Aider/Graphify adapter tests
89
+ successfully.
90
+ ontology_schema:
91
+ name: MementoV1ExecutorRouting
92
+ entities:
93
+ - name: ExecutorAdapter
94
+ fields:
95
+ - name
96
+ - capabilities
97
+ - health
98
+ - prepare
99
+ - dispatch
100
+ - collect
101
+ - cancel
102
+ - name: IsolatedWorktree
103
+ fields:
104
+ - path
105
+ - base_ref
106
+ - dispatch_id
107
+ - status
108
+ - cleanup_policy
109
+ - name: GraphCheckpoint
110
+ fields:
111
+ - id
112
+ - trigger
113
+ - status
114
+ - graph_state
115
+ - changed_files
116
+ - artifact_refs
117
+ - name: MemoryRecall
118
+ fields:
119
+ - repo_profile
120
+ - known_pitfalls
121
+ - executor_history
122
+ - verification_commands
123
+ evaluation_principles:
124
+ - name: Executor isolation
125
+ weight: 0.25
126
+ - name: Independent verification
127
+ weight: 0.25
128
+ - name: Routing explainability
129
+ weight: 0.2
130
+ - name: Graph/memory usefulness
131
+ weight: 0.15
132
+ - name: Failure handling quality
133
+ weight: 0.15
134
+ exit_conditions:
135
+ - Codex/Aider adapters are implemented with mocked tests and optional live smoke.
136
+ - External executor partial work is quarantined until verified.
137
+ - Graphify post-dispatch checkpointing is available and optional-failure safe.
138
+ - Route decisions are auditable and explainable.
139
+ - Working tree is clean with a verified commit.
@@ -0,0 +1,134 @@
1
+ metadata:
2
+ name: memento-v2-learning-graph
3
+ version: 2.0.0
4
+ created_at: '2026-05-12T13:59:28Z'
5
+ origin: hermes-assisted-ouroboros-fallback
6
+ phase: v2
7
+ depends_on:
8
+ - memento-mvp
9
+ - memento-v1-executor-routing
10
+ ambiguity_score: 0.16
11
+ project: memento
12
+ goal: 'Implement v2 learning and graph-aware orchestration: Goose and SWE-agent adapters, confidence-weighted executor
13
+ performance memory, automatic verification enrichment, graph-derived task decomposition support, partial-work
14
+ repair workflows, and budget-aware multi-attempt fallback.'
15
+ constraints:
16
+ - Keep Memento as the lifecycle source of truth for runs, sessions, plans, tasks, dispatches, evidence, and verification
17
+ decisions.
18
+ - Do not depend on executor-native private sessions for correctness, retry, recovery, or progress reporting.
19
+ - Executor summaries, reasoning traces, and self-assessments are advisory and cannot independently satisfy task
20
+ acceptance.
21
+ - Preserve safety gates for destructive git operations, credentials, production/release actions, and forbidden paths.
22
+ - Apply secret redaction and forbidden-path policies before storing evidence payloads, command output, diffs, or
23
+ artifacts.
24
+ - Graphify must be checkpoint-driven by default; continuous watch is optional and must not be required for correctness.
25
+ - agentmemory writeback must store only durable reusable lessons, not temporary task progress, raw logs, commit
26
+ hashes, PR numbers, or raw graph payloads.
27
+ - Goose and SWE-agent adapters must remain capability-gated and may be disabled when healthcheck or sandbox requirements
28
+ are not met.
29
+ - Executor performance memories must be confidence-weighted, aggregated, and decayed; one-off observations must
30
+ not dominate routing.
31
+ - Graph-derived task decomposition must be advisory and reviewed against canonical plan/task graph constraints before
32
+ dispatch.
33
+ - Budget policies must cap attempts, runtime, executor cost, and Graphify deep/semantic updates.
34
+ scope:
35
+ in:
36
+ - Goose adapter as experimental OpenCode-like general agent worker with healthcheck and headless/API/process mode
37
+ detection.
38
+ - SWE-agent adapter for sandboxed issue repair and test-driven bugfix tasks.
39
+ - Confidence-weighted executor performance memory with aggregation and decay.
40
+ - Automatic verification policy enrichment using agentmemory and Graphify signals.
41
+ - Graph-derived candidate task/dependency suggestions from relevant subgraphs and communities.
42
+ - Repair-task creation from rejected/partial dispatch evidence.
43
+ - Budget-aware multi-attempt retry/fallback policies.
44
+ out:
45
+ - OpenHands worker pool.
46
+ - Multi-executor competition/ranking with patch comparison.
47
+ - Team/CI integration as first-class source of truth.
48
+ - Fully autonomous graph rewrite of canonical plans without review.
49
+ acceptance_criteria:
50
+ - name: Goose adapter
51
+ description: Memento can register Goose as an experimental executor, healthcheck it, render context, run/collect
52
+ when enabled, and mark it unavailable/manual when healthcheck fails.
53
+ verification: Mocked tests cover available, auth failure, non-headless limitation, timeout, and structured failure
54
+ result.
55
+ - name: SWE-agent adapter
56
+ description: Memento can route issue-repair/test-driven-fix tasks to SWE-agent only when sandbox requirements
57
+ are satisfied.
58
+ verification: Tests verify sandbox-required routing, issue spec rendering, result collection, and fallback when
59
+ sandbox unavailable.
60
+ - name: Confidence-weighted executor memory
61
+ description: Executor performance observations are aggregated by repo, task kind, size, graph impact, and executor;
62
+ confidence increases with repeated observations and decays over time.
63
+ verification: Tests show one success is weak signal, repeated successes increase score, recent failures reduce
64
+ score, and stale data decays.
65
+ - name: Verification enrichment
66
+ description: Memento automatically strengthens verification policies using memory and graph signals, such as adding
67
+ smoke tests for affected API/UI contracts or full tests for god-node changes.
68
+ verification: Tests confirm enrichment adds checks with reasons and never removes or weakens required checks without
69
+ approval.
70
+ - name: Graph-derived decomposition suggestions
71
+ description: Memento can use Graphify communities, high-centrality nodes, affected files, and surprising connections
72
+ to propose task splits/dependencies for review.
73
+ verification: Given a mocked graph, the planner suggests candidate tasks/dependencies and records them as proposals,
74
+ not silently accepted canonical tasks.
75
+ - name: Partial-work repair workflow
76
+ description: Rejected or partially verified dispatches can create repair tasks linked to quarantined diff/evidence
77
+ and failed requirements.
78
+ verification: Tests produce a repair task from failing test evidence and ensure downstream tasks remain blocked
79
+ until repair is accepted.
80
+ - name: Budget-aware fallback
81
+ description: Routing and retry respect configured budgets for time, attempts, executor count, and Graphify semantic
82
+ updates.
83
+ verification: Tests show budget exceeded leads to escalation/blocked state with actionable reasons.
84
+ - name: v2 verification suite
85
+ description: v2 features pass local tests including mocked Goose/SWE-agent/memory/Graphify scenarios.
86
+ verification: Run pytest, ruff, compileall, doctor, sample-smoke, and v2 adapter/router tests successfully.
87
+ ontology_schema:
88
+ name: MementoV2LearningGraph
89
+ entities:
90
+ - name: ExecutorPerformanceMemory
91
+ fields:
92
+ - executor
93
+ - repo
94
+ - task_kind
95
+ - graph_impact
96
+ - success_count
97
+ - failure_count
98
+ - confidence
99
+ - decay
100
+ - name: VerificationEnrichment
101
+ fields:
102
+ - added_checks
103
+ - reasons
104
+ - source_memory_refs
105
+ - source_graph_refs
106
+ - name: GraphTaskProposal
107
+ fields:
108
+ - proposed_tasks
109
+ - dependencies
110
+ - graph_basis
111
+ - review_status
112
+ - name: RepairTask
113
+ fields:
114
+ - source_dispatch_id
115
+ - failed_requirements
116
+ - quarantined_diff_ref
117
+ - verification_policy
118
+ evaluation_principles:
119
+ - name: Learning quality without memory pollution
120
+ weight: 0.25
121
+ - name: Graph-aware orchestration usefulness
122
+ weight: 0.2
123
+ - name: Adapter safety and capability gating
124
+ weight: 0.2
125
+ - name: Budget/fallback reliability
126
+ weight: 0.2
127
+ - name: Recoverability from failures
128
+ weight: 0.15
129
+ exit_conditions:
130
+ - Goose and SWE-agent adapters are available behind health/capability gates.
131
+ - Performance memory aggregation/decay affects routing in tests.
132
+ - Verification enrichment is explainable and policy-safe.
133
+ - Graph-derived task suggestions are reviewable proposals.
134
+ - Working tree is clean with a verified commit.