diff --git a/dev/ACTIVE_TASK.json b/dev/ACTIVE_TASK.json index 7ad23c8..fad1d9b 100644 --- a/dev/ACTIVE_TASK.json +++ b/dev/ACTIVE_TASK.json @@ -1 +1 @@ -{"task_file":"dev/tasks/GEN2-COGNITIVE-002-restore-production-cognitive-route.json","task_id":"GEN2-COGNITIVE-002","task_revision":3} +{"task_file":"dev/tasks/GEN2-EVOLVE-001-adaptive-memory-freshness-salience-and-experience.json","task_id":"GEN2-EVOLVE-001","task_revision":1} diff --git a/dev/tasks/GEN2-EVOLVE-001-adaptive-memory-freshness-salience-and-experience.json b/dev/tasks/GEN2-EVOLVE-001-adaptive-memory-freshness-salience-and-experience.json new file mode 100644 index 0000000..0b12203 --- /dev/null +++ b/dev/tasks/GEN2-EVOLVE-001-adaptive-memory-freshness-salience-and-experience.json @@ -0,0 +1,77 @@ +{ + "task_id": "GEN2-EVOLVE-001", + "task_revision": 1, + "architecture_revision": "ARCH-GEN2-000", + "base_repo_revision": "gen2-integration", + "risk_tier": "E", + "intent": "Extend the existing Gen2 retrieval fabric with task-relative freshness, bounded salience, scoped positive/negative experience, contradiction candidates and rebuildable consolidation candidates without creating a Memory owner or retiring V1 compatibility.", + "requirement_ids": ["REQ-GEN2-EVOLVE-001-ADAPTIVE-RETRIEVAL", "REQ-GEN2-EVOLVE-001-EXPERIENCE", "REQ-GEN2-EVOLVE-001-CONSOLIDATION"], + "allowed_change_scope": { + "modules": ["interaction", "epistemics", "core-runtime", "cognitive-context", "production evidence"], + "paths": [ + "modules/interaction/domain/gen2_context.go", + "modules/interaction/domain/gen2_context_test.go", + "modules/epistemics/domain/freshness.go", + "modules/epistemics/domain/freshness_test.go", + "modules/epistemics/domain/experience.go", + "modules/epistemics/domain/experience_test.go", + "modules/epistemics/domain/adaptive_retrieval.go", + "modules/epistemics/domain/adaptive_retrieval_test.go", + "modules/epistemics/domain/consolidation.go", + "modules/epistemics/domain/consolidation_test.go", + "contracts/epistemics/freshness.go", + "contracts/epistemics/types.go", + "contracts/cognitive/context_compiler.go", + "contracts/cognitive/context_compiler_v2_test.go", + "adapters/postgres/epistemics_repository.go", + "adapters/postgres/interaction_repository.go", + "cmd/core-runtime/main.go", + "cmd/core-runtime/cognitive_interpretation.go", + "cmd/core-runtime/cognitive_interpretation_test.go", + "database/migrations/051_gen2_adaptive_experience_scope.sql", + "development/GEN2_MIGRATION_MAP.md", + "docs/evidence/**", + "docs/PROJECT_STATUS.md", + "dev/ACTIVE_TASK.json", + "dev/tasks/GEN2-EVOLVE-001-adaptive-memory-freshness-salience-and-experience.json" + ] + }, + "forbidden_change_scope": { + "paths": ["architecture/**", "security/**", "go.mod", "go.sum", ".gitea/workflows/**", "cmd/supervisor/**", "deploy/**", "GEN2-028", "GEN2-029", "GEN2-030", "PersonalMemory write paths", "Gen3/**"] + }, + "allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 1}, + "contracts": { + "consume": ["existing Interaction utterance and ProjectReference projection", "existing Epistemics ExperienceRecord and Freshness contracts", "existing Cognitive Context Compiler V2"], + "may_change": ["typed Epistemics retrieval and temporal fields", "typed Context Compiler lane and omission metadata", "no public or cross-owner contract"] + }, + "semantic_owner": "Interaction remains canonical owner of human utterances and ProjectReference; Epistemics remains canonical owner of ExperienceRecord and task-relative freshness evidence; Context Compiler remains a rebuildable cognitive projection; Core only composes existing owner reads through established repository boundaries.", + "canonical_state": ["Interaction utterance history and ProjectReference", "Epistemics ExperienceRecord and temporal applicability", "no new Memory canonical state", "no direct cross-owner SQL join or write"], + "persistence_and_migrations": ["add only owner-local Epistemics columns for principal and ContextScope references required to retrieve ExperienceRecord without cross-owner joins", "existing rows remain historical and are not deleted", "migration must be additive and rollback-safe"], + "side_effects_and_privileges": ["no external mutation", "no provider override", "no autonomous Skill or Reflex activation", "no scheduler", "no V1 retirement", "no browser acceptance required"], + "state_transitions": [ + "task-relative freshness uses observed/verified/validity/volatility/version/provenance inputs and never turns a stale assessment into permanent deletion", + "current versus historical assertion resolution preserves historical lineage and evaluates applicability before recency", + "ProjectReference and principal filtering precede semantic relevance ranking", + "Epistemics positive and negative ExperienceRecord retrieval is separately lane-classified and preserves failure applicability conditions", + "bounded contradiction candidates are retrieved after the primary candidates without confirmation-only selection", + "Context Compiler receives bounded current-fact, experience, contradiction and historical-analogy lanes with explainable inclusions and omissions", + "consolidation is a deterministic rebuildable projection from raw records to episode/proposition/experience/Skill-candidate evidence; it does not write or activate Skills" + ], + "failure_retry_restart": ["bounded retrieval never loops", "missing or old Experience metadata remains historical or excluded rather than treated as current", "rebuild/restart recomputes projections from canonical utterance and Epistemics evidence", "no candidate failure changes stable production traffic"], + "assumptions": ["GEN2-COGNITIVE-002 scoped Interaction retrieval remains the primary assertion reader", "Epistemics owns additive ExperienceRecord metadata", "COMPAT observation and V1 retirement remain deferred by owner", "no browser or production promotion is required for this task"], + "acceptance_scenarios": [ + "EVOLVE-001-SCN-01 current versus historical value returns the applicable current value while retaining historical evidence", + "EVOLVE-001-SCN-02 fast-aging and slow-aging inputs receive distinct task-relative freshness assessments", + "EVOLVE-001-SCN-03 Company A and Company B are hard-isolated through typed scope references before ranking", + "EVOLVE-001-SCN-04 relevant memory is selected and irrelevant memory is excluded under a bounded context budget with an explainable omission", + "EVOLVE-001-SCN-05 similar work retrieves both successful and failed applicable ExperienceRecord lanes", + "EVOLVE-001-SCN-06 contradiction retrieval emits a bounded opposing candidate without replacing canonical evidence", + "EVOLVE-001-SCN-07 rebuildable consolidation retains source evidence references and survives repository reload without raw-evidence loss" + ], + "required_tests": [ + "FAST: targeted go test and go vet for changed interaction, epistemics, cognitive context, core-runtime and postgres packages", + "FAST: devctl preflight, check-diff, independent governance, git diff --check", + "MILESTONE: changed owners plus migration consistency and focused restart/rebuild retrieval check; no browser or FULL suite" + ], + "terminal_gap_states": ["BLOCKED_BY_SPEC_GAP", "BLOCKED_BY_ARCHITECTURE_GAP", "BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_CONFLICT", "REQUIRES_MIGRATION_DECISION"] +}