Skip to content

Resolve current state: explicit active task, session → docs, clear/archive on finish - #14

Merged
jdugarte merged 5 commits into
mainfrom
resolve-current-state
Mar 5, 2026
Merged

Resolve current state: explicit active task, session → docs, clear/archive on finish#14
jdugarte merged 5 commits into
mainfrom
resolve-current-state

Conversation

@jdugarte

@jdugarte jdugarte commented Mar 5, 2026

Copy link
Copy Markdown
Owner

Summary

This PR fixes cross-IDE and cross-session “wrong stage” behavior by making the active task explicit in agentic:guild memory, absorbing session knowledge into project docs (sync-docs and harvest-rules), and optionally clearing/archiving the task when the branch is finished (with user confirmation). It also applies Bugbot-driven fixes (hard constraints, yields, directory list, and status-check/sync-docs/harvest-rules edge cases).

Changes

1. Explicit active task (status-check, start-task, explore-task, finish-branch, rules)

  • skills/status-check/SKILL.md: Discovers sessions, resolves active task from <active_task_pointer>. If pointer is missing/ambiguous with multiple sessions, lists sessions and asks user to confirm or set the pointer. Handles stale pointer (file missing) and zero sessions + [NONE].
  • skills/start-task/SKILL.md, skills/explore-task/SKILL.md: Set <active_task_pointer> when creating a session so the active task is unambiguous across IDEs.
  • skills/finish-branch/SKILL.md: Retains pointer in step 3.1; in steps 4.4–4.5, after branch is finished, asks user to clear the active task and archives the session file to .agenticguild/completed_sessions/ (with date suffix), then sets pointer to [NONE].
  • templates/core/AGENTIC_GUILD_RULES.md: State-tracking rule requires writing the active session filename to <active_task_pointer> when a task is active.
  • templates/core/memory_scaffold/current_state.md: Comment added that when multiple session files exist, set the pointer for cross-IDE consistency.
  • playbooks/EXPECTED_PROJECT_STRUCTURE.md: current_state and completed_sessions documented; sync.sh and skills/update-agentic-guild/SKILL.md create/ensure completed_sessions and its .gitkeep.

2. Session memory → docs (sync-docs, harvest-rules)

  • skills/sync-docs/SKILL.md: Uses two inputs — branch diff and active task session (when present). Phase 1.1 (Variant B): reads session, semantically analyzes full content, classifies by knowledge type, merges with diff-based “needs update” list; report includes source (diff | session | both). Phase 3.1: applies both; SCHEMA_REFERENCE is enriched with session-derived “why/when” of data; conventions/patterns go to .cursorrules and docs/core/SYSTEM_ARCHITECTURE.md. Knowledge-type map and session_to_docs block added.
  • skills/harvest-rules/SKILL.md: Step 1.0 reads active session and extracts rule-worthy content; step 1.1 merges session-derived candidates with diff and review_ledger. Dedup: skip candidates that duplicate existing rules or that are semantically equivalent to what sync-docs likely just wrote when run after sync-docs in the same workflow.
  • playbooks/EXPECTED_PROJECT_STRUCTURE.md: Docs to Sync table includes .cursorrules (conventions/patterns from diff or session). Note added that both sync-docs and harvest-rules write to .cursorrules by design and how to avoid near-duplicates.
  • playbooks/AI_WORKFLOW_PLAYBOOK.md: Finish-branch and skills table updated to describe session-based doc sync and harvest.

3. Bugbot / consistency

  • Cherry-picked fd18210 (previous lingering bugbot): <hard_constraints> (no git execution) in audit-compliance, harvest-rules, pr-description, process-feedback, roadmap-consult, roadmap-manage, status-check; explicit <yield> in harvest-rules 1.0 and process-feedback 1.1–1.3; process-feedback in update-agentic-guild skill list; update-agentic-guild route in templates/core/AGENTIC_GUILD_RULES.md.
  • Status-check: handling for stale pointer and for zero sessions with [NONE] pointer.
  • update-agentic-guild: completed_sessions added to step 1.1 directory list.

Files touched

playbooks/AI_WORKFLOW_PLAYBOOK.md, playbooks/EXPECTED_PROJECT_STRUCTURE.md, skills/explore-task/SKILL.md, skills/finish-branch/SKILL.md, skills/harvest-rules/SKILL.md, skills/start-task/SKILL.md, skills/status-check/SKILL.md, skills/sync-docs/SKILL.md, skills/update-agentic-guild/SKILL.md, sync.sh, templates/core/AGENTIC_GUILD_RULES.md, templates/core/memory_scaffold/current_state.md.

@cursor

cursor Bot commented Mar 5, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Updates core agentic:guild workflow state handling and doc-sync/rule-harvest behavior; mistakes could cause the assistant to pick the wrong active task or write updates to the wrong docs. No application/runtime code is changed, so impact is limited to developer tooling/automation.

Overview
Makes .agenticguild/current_state.md authoritative by requiring <active_task_pointer> to be set whenever a task is active, and updates start-task, explore-task, finish-branch, and status-check to preserve/resolve that pointer (including safer handling when multiple sessions exist).

Extends sync-docs and harvest-rules to incorporate the active task session (plus review_ledger) as an input: session content is semantically classified and used to propose/update SPEC, ADRs, SCHEMA_REFERENCE enrichment, and .cursorrules, with guidance to avoid near-duplicate rule suggestions.

Adds an explicit finish-branch flow to optionally clear the active task and archive the session to .agenticguild/completed_sessions/, and updates bootstrap/update tooling (sync.sh, update-agentic-guild, project structure docs, and templates) to create/track this directory and to forbid skills from running git commit/push/merge via tools.

Written by Cursor Bugbot for commit 2c43269. This will update automatically on new commits. Configure here.

Comment thread skills/status-check/SKILL.md Outdated
Comment thread playbooks/EXPECTED_PROJECT_STRUCTURE.md
Comment thread skills/update-agentic-guild/SKILL.md
@jdugarte
jdugarte force-pushed the resolve-current-state branch from 3ff04e8 to c14bc1b Compare March 5, 2026 22:17

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread skills/status-check/SKILL.md Outdated
Comment thread skills/sync-docs/SKILL.md
@jdugarte
jdugarte force-pushed the resolve-current-state branch from c14bc1b to 2c43269 Compare March 5, 2026 22:28
@jdugarte jdugarte changed the title Resolve current state Resolve current state: explicit active task, session → docs, clear/archive on finish Mar 5, 2026
@jdugarte
jdugarte merged commit fa8fffd into main Mar 5, 2026
2 checks passed
@jdugarte
jdugarte deleted the resolve-current-state branch March 5, 2026 22:49
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.

1 participant