Skip to content

Codex/issue-91-option3-session-constraints#106

Draft
hugocool wants to merge 4 commits into
mainfrom
codex/issue-91-option3-session-constraints
Draft

Codex/issue-91-option3-session-constraints#106
hugocool wants to merge 4 commits into
mainfrom
codex/issue-91-option3-session-constraints

Conversation

@hugocool
Copy link
Copy Markdown
Owner

@hugocool hugocool commented Mar 8, 2026

  • Update .github/ chat modes (architect, ask, code, debug) to AGENTS.md-first pattern; remove MemoriPilot references
  • Update copilot-instructions.md: AGENTS.md-first directive + working-mode hints
  • Update blog post: add memory-bank-goes-stale argument + In-Context Learning subtitle
  • Fix defaults_memory.py: add "graphiti" to _TASK_DEFAULTS_BACKENDS
  • Fix preferences.py: remove dead delete-based prune_shared_constraints; restore archive-based (issue/81) as the single canonical impl
  • Fix agent.py: use duplicates_archived key consistent with archive impl
  • Fix test_planning_reminder_suppression: use date.today() not hardcoded 2026-03-07
  • Fix test_task_defaults_memory: migrate mem0 build test to graphiti path
  • Fix test_timeboxing_constraint_store_canonicalization: direct DB inserts for dirty-state setup; assertions aligned to archive API
  • Add test_review_commit_template_includes_submit_button_guidance (merged from stash)
  • Update .env: TIMEBOXING_MEMORY_BACKEND=graphiti

Linked issue

  • GitHub issue:
  • Issue branch:

Acceptance criteria

  • Criterion 1:
  • Criterion 2:
  • Criterion 3:

Notebook -> artifact mapping (required for notebook-driven work)

  • Primary notebook path:
  • Notebook lifecycle status (WIP / Extraction complete / DONE / Reference / Archived):
  • Extracted implementation files (src/...):
  • Extracted test files (tests/...):
  • Extracted docs (README.md / docs/...):
  • Intentionally retained notebook-only content (and why):

Verification performed

  • Start-of-work cleanliness check recorded (git status --porcelain)
  • Pre-PR-close cleanliness check recorded (git status --porcelain)
  • Relevant automated tests passed
  • Notebook checkpoint passed (clean-kernel rerun or CI notebook check)

Commands run:

# paste commands used for verification

System-of-record sync

  • Issue status updated
  • PR description reflects current implementation status
  • Temporary /tickets/ markdown removed or explicitly retained as durable documentation

- Update .github/ chat modes (architect, ask, code, debug) to AGENTS.md-first pattern; remove MemoriPilot references
- Update copilot-instructions.md: AGENTS.md-first directive + working-mode hints
- Update blog post: add memory-bank-goes-stale argument + In-Context Learning subtitle
- Fix defaults_memory.py: add "graphiti" to _TASK_DEFAULTS_BACKENDS
- Fix preferences.py: remove dead delete-based prune_shared_constraints; restore archive-based (issue/81) as the single canonical impl
- Fix agent.py: use duplicates_archived key consistent with archive impl
- Fix test_planning_reminder_suppression: use date.today() not hardcoded 2026-03-07
- Fix test_task_defaults_memory: migrate mem0 build test to graphiti path
- Fix test_timeboxing_constraint_store_canonicalization: direct DB inserts for dirty-state setup; assertions aligned to archive API
- Add test_review_commit_template_includes_submit_button_guidance (merged from stash)
- Update .env: TIMEBOXING_MEMORY_BACKEND=graphiti

## Linked issue

- GitHub issue: <!-- required -->
- Issue branch: <!-- e.g. issue/123-notebook-workflow -->

## Acceptance criteria

- [ ] Criterion 1:
- [ ] Criterion 2:
- [ ] Criterion 3:

## Notebook -> artifact mapping (required for notebook-driven work)

- Primary notebook path:
- Notebook lifecycle status (`WIP` / `Extraction complete` / `DONE` / `Reference` / `Archived`):
- Extracted implementation files (`src/...`):
- Extracted test files (`tests/...`):
- Extracted docs (`README.md` / `docs/...`):
- Intentionally retained notebook-only content (and why):

## Verification performed

- [ ] Start-of-work cleanliness check recorded (`git status --porcelain`)
- [ ] Pre-PR-close cleanliness check recorded (`git status --porcelain`)
- [ ] Relevant automated tests passed
- [ ] Notebook checkpoint passed (clean-kernel rerun or CI notebook check)

Commands run:

```bash
# paste commands used for verification
```

## System-of-record sync

- [ ] Issue status updated
- [ ] PR description reflects current implementation status
- [ ] Temporary `/tickets/` markdown removed or explicitly retained as durable documentation
@hugolytics
Copy link
Copy Markdown
Collaborator

Merge Handoff

This PR is the closure vehicle for issue #91, but only after PR #105 lands.

Acceptance Criteria status

  • Session override beats conflicting default/profile memory
  • Conditional default suppression works for same-day blockers
  • Non-conflict path keeps the default eligible
  • Debug snapshot exposes suppression evidence
  • Regression tests added and passing

Validation run

  • poetry run pytest tests/unit/test_timeboxing_constraint_selection.py -q
  • poetry run pytest tests/unit/test_timeboxing_constraint_selection.py tests/unit/test_timeboxing_durable_constraints.py tests/unit/test_constraint_retriever.py tests/unit/test_timeboxing_memory_backend_selection.py -q

No-code-loss instructions

  1. Do not merge this stacked PR into issue/96-calendar-sync-idempotency and call the job done; the final landing path must be main through PRs.
  2. After PR issue/96+81: calendar sync idempotency + graphiti memory backend #105 merges, retarget or rebase this PR onto main.
  3. Compare the diff before and after retarget/rebase to ensure the #91 selection fix remains present.
  4. Re-run the targeted tests after the base update before merging.
  5. Close issue #91 only after this PR is merged to main and the close comment references the merged PR plus test evidence.

Open Items

@hugolytics
Copy link
Copy Markdown
Collaborator

Substantial checkpoint

Current status

Branch

  • codex/issue-91-option3-session-constraints

Dependency / merge order

Scope cleanliness

  • Repository was already dirty with unrelated files before this checkpoint.
  • Intended in-scope files for this PR slice are the timeboxing Option-3 files only:
    • src/fateforger/agents/timeboxing/agent.py
    • src/fateforger/agents/timeboxing/nlu.py
    • src/fateforger/agents/timeboxing/preferences.py
    • tests/unit/test_timeboxing_constraint_selection.py
    • tests/unit/test_timeboxing_stateless_agents.py
    • tests/unit/test_timeboxing_constraint_extraction_background.py
    • tests/unit/test_timeboxing_constraint_store_canonicalization.py

Commands/tests run

  • poetry run pytest -q tests/unit/test_timeboxing_constraint_selection.py tests/unit/test_timeboxing_stateless_agents.py tests/unit/test_timeboxing_constraint_extraction_background.py tests/unit/test_timeboxing_constraint_store_canonicalization.py tests/unit/test_timeboxing_durable_constraints.py
  • Result: 42 passed.

Acceptance criteria status (#91)

  • AC1: partial (core precedence mechanics implemented; still need end-to-end replay evidence)
  • AC2: not done
  • AC3: not done

Exact next step

  • Implement AC2 conflict-resolution summary and AC3 regression scenario, then collect Slack replay evidence and update issue/PR.

Open Items

  • To decide: summary format contract in stage message
  • To do: AC2 + AC3 + replay evidence + retarget/rebase after stack changes
  • Blocked by: stacked base order for final merge-to-main path

@hugolytics
Copy link
Copy Markdown
Collaborator

Kickoff Checkpoint (2026-03-08)

Current status

Branch

  • codex/issue-91-option3-session-constraints

PR

Start-of-work scope cleanliness

Commands run

  • git branch --show-current
  • git status --porcelain
  • gh pr status
  • gh pr view 106 --json number,title,url,baseRefName,headRefName,state,isDraft,mergeStateStatus,body,commits,files,labels
  • gh issue view 91 --json number,title,url,state,body,labels,assignees,comments

Acceptance criteria status (from issue #91)

  • AC1: Partial (implementation exists; needs current-cycle revalidation evidence after any further code changes).
  • AC2: Not done (deterministic conflict-resolution summary still open).
  • AC3: Not done (explicit regression case still open).
  • AC4: Partial (debug snapshot fields exist; needs verification against final AC wording).
  • AC5: Partial (coverage exists but still requires explicit AC3 evidence in this cycle).

Exact next step

  • Add/confirm failing-first regression coverage for AC2/AC3, then implement scoped fix and rerun targeted suite.

Open Items

  • To decide: exact response-surface format for conflict-resolution summary in user-facing output.
  • To do: AC2 + AC3 implementation/verification; post substantial progress checkpoint with test evidence.
  • Blocked by: final landing path is stacked (#106 depends on base branch flow before merge-to-main readiness).

@hugolytics
Copy link
Copy Markdown
Collaborator

Substantial checkpoint

Current status

  • Added AC2 conflict-resolution summary behavior and AC3 regression coverage.
  • Targeted validation is green after test-first workflow.

Branch

  • codex/issue-91-option3-session-constraints

Dependency / merge order

Scope cleanliness

  • Repo had unrelated dirty files at checkpoint start.
  • This PR scope remains limited to timeboxing Option-3 files/tests.

Tests-first evidence

  • Added failing assertion first for conflict-resolution summary.
  • Verified failure, implemented fix, then reran targeted suites.

Commands/tests run

  • poetry run pytest -q tests/unit/test_timeboxing_stage_actions.py -k "render_constraints_preview_blocks_labels_new_active_and_selected_counts" (failed-first, then passed after fix)
  • poetry run pytest -q tests/unit/test_timeboxing_stage_actions.py tests/unit/test_timeboxing_constraint_selection.py tests/unit/test_timeboxing_stateless_agents.py tests/unit/test_timeboxing_constraint_extraction_background.py tests/unit/test_timeboxing_constraint_store_canonicalization.py tests/unit/test_timeboxing_durable_constraints.py
  • Result: 53 passed

Acceptance criteria status (#91)

  • AC1: done
  • AC2: done
  • AC3: done

Exact next step

Open Items

@hugolytics
Copy link
Copy Markdown
Collaborator

Substantial Checkpoint (2026-03-08) — Graphiti-only backend + OpenRouter wiring

Current status

  • Implemented user-requested runtime policy changes on codex/issue-91-option3-session-constraints:
    • single durable memory backend (graphiti only),
    • Graphiti MCP wired to OpenRouter-compatible LLM endpoint settings.
  • Used test-first flow for behavior changes (failing assertions captured before implementation).

Branch

  • codex/issue-91-option3-session-constraints

PR

Scope cleanliness

  • Worktree was already dirty at kickoff.
  • This checkpoint touched only the backend/config/runtime/tests/docs relevant to Graphiti-only + OpenRouter wiring.
  • Unrelated pre-existing dirty files remain out of scope and were not rebased/retargeted/cherry-picked/merged.

Test-first evidence (rule #8)

  1. Updated tests first to enforce Graphiti-only backend contract and legacy-backend rejection.
  2. Ran targeted tests before implementation; observed expected failures:
    • poetry run pytest -q tests/unit/test_settings_mcp_endpoints.py tests/unit/test_task_defaults_memory.py tests/unit/test_timeboxing_memory_backend_selection.py
    • Result: 7 failed / 30 passed (legacy backend acceptance still present).
  3. Implemented changes.
  4. Re-ran targeted suites; all green.

Commands/tests run

  • poetry run pytest -q tests/unit/test_settings_mcp_endpoints.py tests/unit/test_task_defaults_memory.py tests/unit/test_timeboxing_memory_backend_selection.py
    • pre-fix result: 7 failed / 30 passed
  • poetry run pytest -q tests/unit/test_settings_mcp_endpoints.py tests/unit/test_task_defaults_memory.py tests/unit/test_timeboxing_memory_backend_selection.py tests/unit/test_runtime_mcp_startup_checks.py tests/unit/test_timeboxing_durable_constraints.py tests/unit/test_timeboxing_constraint_selection.py tests/unit/test_timeboxing_stateless_agents.py tests/unit/test_timeboxing_constraint_extraction_background.py tests/unit/test_timeboxing_constraint_store_canonicalization.py
    • post-fix result: 93 passed
  • poetry run ruff check src/fateforger/core/config.py src/fateforger/core/runtime.py src/fateforger/agents/tasks/defaults_memory.py src/fateforger/agents/tasks/README.md src/fateforger/agents/timeboxing/agent.py tests/unit/test_settings_mcp_endpoints.py tests/unit/test_task_defaults_memory.py tests/unit/test_timeboxing_memory_backend_selection.py tests/unit/test_runtime_mcp_startup_checks.py tests/unit/test_timeboxing_durable_constraints.py
    • result: passed
  • Runtime verification:
    • docker compose up -d --force-recreate graphiti-mcp
    • MCP discovery probe (mcp_server_tools) against http://localhost:8005/mcp
    • result: tool_count=9

Acceptance criteria status (#91)

Exact next step

Open Items

  • To decide: whether to split Graphiti/OpenRouter hardening into a dedicated PR/issue after stack unblocks, or keep in Codex/issue-91-option3-session-constraints #106.
  • To do: AC2 + AC3 implementation and evidence; maintain no-code-loss diff checks before any rebase/retarget.
  • Blocked by: stacked merge order for final main landing path (#106 currently depends on lower branch flow).

@hugolytics
Copy link
Copy Markdown
Collaborator

Substantial Checkpoint (2026-03-08) — Branch hygiene cleanup

Current status

  • Per request, cleaned up done branches only (fully merged, zero commits ahead of main).
  • No code edits or rebases/retargets/cherry-picks/merges performed in this step.

Branch

  • codex/issue-91-option3-session-constraints

PR

Commands/tests run

  • git branch --merged main
  • git branch -r --merged origin/main
  • gh pr list --state all --limit 200 --json ...
  • git branch -d <merged-branches...>
  • git push origin --delete <merged-remote-branches...>
  • git fetch --prune origin

Deleted local branches (safe: merged, ahead_of_main=0)

  • codex/issue-59-taskmarshal-memory-cards
  • issue/40-slack-routing-constraint-refresh-guard
  • issue/51-weekly-review-agent-v0
  • issue/63-task-defaults-durability
  • issue/68-active-count-semantics
  • issue/69-memory-canonicalization
  • issue/71-auto-submit-idempotency
  • issue/72-refine-time-budget
  • issue/73-slack-routing-hardening
  • phase0-merge-temp

Deleted remote branches (safe: merged into main)

  • codex/issue-59-taskmarshal-memory-cards
  • issue/51-weekly-review-agent-v0
  • issue/63-task-defaults-durability
  • issue/72-refine-time-budget

Acceptance criteria status (#91)

  • Unchanged by this hygiene step (no behavioral/code changes in this checkpoint).

Exact next step

Open Items

  • To decide: whether to force-delete non-merged archive branches (backup/*, issue/26*, issue/28*, issue/71-one-turn-auto-submit) despite unique commits.
  • To do: only delete additional branches after explicit direction because they are not fully merged to main.
  • Blocked by: none.

@hugolytics
Copy link
Copy Markdown
Collaborator

Substantial checkpoint (halted for ambiguity/risk)

Current status

  • No merge/rebase/cherry-pick performed in this checkpoint.
  • I halted intentionally to avoid hidden diff loss under stacked-branch + dirty-worktree conditions.

Branch

  • codex/issue-91-option3-session-constraints

PR

Risk observed

Commands run

  • git status --porcelain
  • git branch -vv --sort=-committerdate
  • gh pr view 105 ...
  • gh pr view 106 ...

Acceptance criteria status

  • Not changed in this checkpoint; this is a risk-control halt.

Exact next step

Open Items

  • To decide: merge strategy (stacked continuation vs clean rebuild)
  • To do: execute chosen path, then rerun agreed validation post-rebase/retarget
  • Blocked by: maintainer direction due high risk of code-loss/scope-mix

…ackend integration

- Added `replace_session_constraints` method to `ConstraintStore` for replacing session-scope constraints.
- Updated `Settings` to enforce Graphiti as the sole memory backend, removing legacy options.
- Modified runtime checks to always require Graphiti availability.
- Refactored tests to validate new Graphiti backend requirements and ensure proper constraint handling.
- Enhanced constraint extraction logic to prioritize session constraints over profile defaults.
- Added tests for session constraint replacement and validation of existing constraints in agent payloads.
@hugolytics hugolytics changed the base branch from issue/96-calendar-sync-idempotency to main March 10, 2026 16:02
@hugolytics
Copy link
Copy Markdown
Collaborator

Substantial checkpoint (strategy 1 execution)

Current status

Branch

  • codex/issue-91-option3-session-constraints

PR

Diff safety verification

  • Pre-retarget gh pr diff 106 --name-only:
    • src/fateforger/agents/timeboxing/graphiti_constraint_memory.py
    • src/fateforger/core/README.md
    • src/fateforger/core/config.py
    • src/fateforger/core/runtime.py
    • tests/unit/test_runtime_mcp_startup_checks.py
    • tests/unit/test_settings_mcp_endpoints.py
  • Pre-retarget sha256 of full diff: 31ca335061ac650a8ef5da1cb99797137740c7256df58f5067d543bae7d4a1bf
  • Post-retarget: same file list + same sha256.

Commands/tests run (post-retarget)

  • poetry run pytest -q tests/unit/test_runtime_mcp_startup_checks.py tests/unit/test_settings_mcp_endpoints.py
  • Result: 39 passed

Acceptance criteria status

  • AC status for this PR is unchanged by retarget itself; this checkpoint confirms safe retarget + validation rerun.

Exact next step

Open Items

@hugolytics
Copy link
Copy Markdown
Collaborator

Substantial checkpoint (halted for scope-mix risk)

Current status

Branch

  • codex/issue-91-option3-session-constraints

PR

Risk observed

  • Local branch is ahead 3 vs origin/codex/issue-91-option3-session-constraints.
  • Ahead commits include mixed scope (timeboxing + tasks + env/docs/worktree artifacts).
  • Pushing as-is would expand Codex/issue-91-option3-session-constraints #106 far beyond intended scope and risks hidden scope bleed.

Evidence commands

  • git log --oneline origin/codex/issue-91-option3-session-constraints..HEAD
  • git diff --name-only origin/codex/issue-91-option3-session-constraints...HEAD
  • gh pr diff 106 --name-only

Acceptance criteria status

  • No AC movement in this checkpoint; this is a safety halt.

Exact next step

Open Items

@hugolytics
Copy link
Copy Markdown
Collaborator

Branch audit against main shows this branch is broader than issue #91.

Implemented on branch (committed, not in main):

  • Graphiti memory backend wiring for timeboxing/task defaults
  • constraint reconciliation utilities and tests
  • local/shared constraint canonicalization follow-up work
  • runtime/config/readme updates for Graphiti path
  • sync-core scaffolding
  • substantial docs/blog/review-system additions

Branch state:

  • branch: codex/issue-91-option3-session-constraints
  • PR: Codex/issue-91-option3-session-constraints #106 (draft)
  • ahead of main: 7 commits
  • local worktree is dirty with an extra uncommitted diff in src/fateforger/agents/timeboxing/preferences.py

Assessment:

Open Items

@hugolytics
Copy link
Copy Markdown
Collaborator

Preservation note: the previously stashed local diff has been committed on this branch as dc807c4 (chore(issue-91): preserve stashed formatting-only preferences diff). This ensures no local-only stash state remains attached to the parked branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants