feat: work-on-goal auto-creates a missing goal on not_found - #93
Merged
Conversation
Mirror work-on-task's Phase 4 find-or-create: the work-on-goal-assistant now emits a structured not_found: verdict (Suggested goal name: — Jira summary when the input is a Jira key) instead of a prose error, and the slash command always creates the goal via Skill: vault-cli:create-goal, then re-invokes the assistant. The assistant also finds existing goals by jira: frontmatter and resolves Jira summaries via getJiraIssue. work-on already covered free-text task-or-goal creation; this closes the goal route so all three work-on commands are find-or-create.
There was a problem hiding this comment.
Now I have all the information needed. Let me do the in-session classify and adjudicate:
CLASSIFY (Step 4c-sel):
Changed files: CHANGELOG.md, agents/work-on-goal-assistant.md, commands/work-on-goal.md, commands/work-on.md
Candidates from Step 4b-i (matching triggers):
agent-cmd/agent-frontmatter→ triggeragents/**/*.md→ applicable (modifiedagents/work-on-goal-assistant.md)agent-cmd/command-frontmatter→ triggercommands/**/*.md→ applicable (modifiedcommands/work-on-goal.md,commands/work-on.md)agent-cmd/command-thin→ triggeragents/**/*.md,commands/**/*.md→ applicable (all three)agent-cmd/gap-driven-feedback→ triggeragents/**/*.md,commands/**/*.md→ applicable (all three)agent-cmd/no-user-prompts→ triggeragents/**/*.md,commands/**/*.md→ applicable (all three)agent-cmd/single-source-of-truth→ triggeragents/**/*.md,commands/**/*.md→ applicable (all three)changelog/conventional-prefix-required→ triggerCHANGELOG.md→ applicable (CHANGELOG.mdmodified)
ADJUDICATE (Step 4d-sel): No violations found except agent-cmd/command-thin.
Now let me produce the consolidated report and JSON verdict:
PR Review: feat: work-on-goal auto-creates a missing goal on not_found
Must Fix (Critical)
None.
Should Fix (Important)
commands/work-on-goal.md— Phase 4 (Handle not_found) is ~25 lines of imperative logic embedded in the command that should live in the agent. This mirrors the exactcommand-thinanti-pattern: argument parsing, branching on assistant verdict, extractingSUGGESTED_NAMEvia regex, invokingSkill: vault-cli:create-goal, re-invoking the assistant. The agent (work-on-goal-assistant.md) already has thenot_found:output format defined; it could emit theSUGGESTED_NAMEas structured metadata rather than a prose line that requires fragile regex extraction. The command should be a thin orchestrator (~10 lines: parse mode, invoke agent, branch onnot_found:vsReady to work on this task., delegate Phase 3/4 to agent steps). (rule:agent-cmd/command-thin)
Nice to Have (Optional)
agents/work-on-goal-assistant.md— Thenot_found:output format uses a proseSuggested goal name:line whose value is extracted via a simple regex in the calling command. This is fragile if the agent output format drifts (e.g., extra whitespace, different capitalization). Consider emittingSUGGESTED_NAME: <value>on its own line as a structured field to make extraction unambiguous and non-regex-based. (rule:agent-cmd/single-source-of-truth— no authoritative single source for name derivation; the command falls back to raw input when Jira is unavailable, and the extraction is implementation-sensitive)
Notes
commands/work-on.md— TheNotessection says "work-on-task.mdandwork-on-goal.mdare functional aliases." This is slightly stale:work-on-goal.mdnow has Phase 4 (find-or-create) whilework-on-task.mdis unchanged. The note's substance is still correct (no code shared, each command is independent), but the "functional aliases" framing could mislead future editors. Suggest: "work-on-task.mdandwork-on-goal.mdshare the find-or-create pattern;work-ondispatches to the appropriate command."- Security concern re: Jira MCP tools exposing sensitive data — reviewed the diff:
mcp__atlassian__getJiraIssueis called only for Jira-key inputs and the summary is used for the suggested name. No credentials or tokens appear in assistant output. Concern addressed. - Changelog bullet uses
feat:prefix — correct perchangelog/conventional-prefix-required. agent-cmd/no-user-prompts— Phase 4 creates goals viaSkill: vault-cli:create-goal, which is interactive. The command correctly gates this behindMODE=non_interactive(skips create, prints info and stops). Ininteractivemode, the create-goal skill's own interactive prompts are the intended UX — this is not an unattended-flow violation. No finding.
Traceability (Selector Mode)
- Candidates: 7 rules matched by Step 4b-i glob filter
- Applicable: 7 rules selected by Step 4c-sel (all triggered by changed files)
- Skipped: none
Selector Mode Traceability
- Candidates: 7 rules matched by Step 4b-i glob filter
- Applicable: 7 rules selected by Step 4c-sel
- Skipped: none
{
"verdict": "approve",
"summary": "Feature is well-designed: Phase 4 find-or-create mirrors work-on-task's established pattern, the not_found verdict is structured, non-interactive mode is properly gated, and the Jira integration is correctly scoped. One should-fix: Phase 4's imperative logic (name extraction, skill invocation, re-invocation) should live in the agent rather than the command, per agent-cmd/command-thin. A nice-to-have: emit SUGGESTED_NAME as a structured field instead of a prose line requiring regex extraction.",
"comments": [
{
"file": "commands/work-on-goal.md",
"line": 30,
"severity": "major",
"message": "Phase 4 (Handle not_found, ~25 lines) is imperative logic embedded in the command that should live in the agent layer. The agent already defines the not_found verdict format; it could emit SUGGESTED_NAME as structured metadata and own the create-goal invocation, making the command a thin orchestrator (~10 lines: parse mode, invoke agent, branch on verdict). This is the canonical command-thin violation: detection logic in the command instead of the agent."
},
{
"file": "agents/work-on-goal-assistant.md",
"line": 202,
"severity": "nit",
"message": "The not_found block's Suggested goal name: is a prose field extracted via regex. If the agent output format drifts (whitespace, capitalization), extraction breaks silently. Consider emitting SUGGESTED_NAME as a dedicated structured field (e.g., SUGGESTED_NAME: <value>) for unambiguous, non-regex parsing by the calling command."
}
],
"concerns_addressed": [
"correctness: Phase 4 not_found parsing and re-invocation flow reviewed — no partial state on cancel; failure path is clean",
"correctness: SUGGESTED_NAME extraction via regex is fragile (raised as nit, not critical — create-goal skill provides safety net)",
"security: Jira MCP tools — no credentials/tokens logged in assistant output; API calls are intentional feature"
]
}
bborbe
added a commit
that referenced
this pull request
Aug 19, 2026
Documents the v0.112.0 change that shipped in PR #93 before a spec was written. Records the design (mirrors spec 016's agent-emits-verdict / command-owns-create split), the acceptance criteria, and the process deviation: hand-authored on master instead of routed through the dark-factory spec flow this repo mandates.
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
Make
/vault-cli:work-on-goalbehave like/vault-cli:work-on-taskon a miss: when the goal is not found in any source, it always creates the goal page (viaSkill: vault-cli:create-goal) and then proceeds with work preparation, instead of erroring with "suggest creating the goal".Changes
agents/work-on-goal-assistant.md: emits a structurednot_found:verdict (withSuggested goal name:— Jira summary when the input is a Jira key) and stops; the agent no longer holds the create path. Also finds existing goals byjira:frontmatter and resolves Jira summaries viamcp__atlassian__getJiraIssue.commands/work-on-goal.md: newPhase 4 — Handle not_found (always create)mirroringwork-on-taskPhase 4 (non-interactive gate, parse SUGGESTED_NAME,Skill: vault-cli:create-goal, re-invoke assistant on success). AddedSkill/MODE parsing to the command.commands/work-on.md: note updated — the goal route now shares find-or-create.Behavior
/vault-cli:work-on-goal→ create goal if needed/vault-cli:work-on-task→ create task if needed (already existed)/vault-cli:work-on→ create goal or task if needed (already existed for free text; unchanged)make precommitpasses (markdown-only change; no binary change).