This commit is contained in:
Rai (Michael Pokorny)
2025-06-24 18:42:47 -07:00
parent e7f49ec30c
commit 2e284fbf3b
3 changed files with 71 additions and 49 deletions

View File

@@ -1,11 +1,10 @@
---
id: 17
title: Sandbox Pre-commit Permission Error
status: Not started
summary: Pre-commit hooks fail in sandbox due to inability to lock user gitconfig.
goal: |
Investigate and resolve pre-commit setup failures in sandbox environments caused by permission errors on ~/.gitconfig so that pre-commit checks can run reliably within agent worktrees.
---
+++
id = "17"
title = "Sandbox Pre-commit Permission Error"
status = "Not started"
dependencies = ""
last_updated = "2025-06-25T01:41:34.737190"
+++
> *This task addresses scaffolding/setup for Agent worktrees.*

View File

@@ -1,15 +1,11 @@
---
id: 20
title: Render Patch Content in Chat Display Window for Approve/Deny
status: Not started # one of: Not started, Started, Needs manual review, Done, Cancelled
summary: Improve inline display of patch hunks in chat messages for approval workflows.
goal: |
Adjust the chat UI so that when the assistant proposes patches for approval or denial:
- The current patch being queried is shown in full, with file paths relative to the CWD (or absolute if outside CWD).
- Previous patches collapse to a configurable number of context lines (e.g. first and last X lines).
- Omit verbose event logs (e.g. `PatchApplyEnd(PatchApplyEndEvent { ... })`), replacing them with concise annotations like "patch applied".
- Maintain clear separation between patches and conversational messages.
---
+++
id = "20"
title = "Render Patch Content in Chat Display Window for Approve/Deny"
status = "Not started"
dependencies = ""
last_updated = "2025-06-25T01:41:34.738344"
+++
> *This task is specific to the chat UI renderer.*
## Acceptance Criteria
@@ -37,4 +33,4 @@ goal: |
## Notes
- Users can override `patch_context_lines` in their config to see more or fewer collapsed lines.
- Ensure compatibility with both live TUI sessions and persisted transcript logs.
- Ensure compatibility with both live TUI sessions and persisted transcript logs.

View File

@@ -81,37 +81,64 @@ def applyfrontmatter():
for md in sorted(task_dir().glob('*.md')):
if md.name == 'task-template.md' or md.name.endswith('-plan.md'):
continue
try:
load_task(md)
continue
except ValueError:
pass
text = md.read_text(encoding='utf-8')
# parse id from filename prefix
task_id = md.stem.split('-', 1)[0]
# parse title
title = ''
for line in text.splitlines():
if line.startswith('# Task '):
parts = line.split(':', 1)
title = parts[1].strip() if len(parts) == 2 else line.lstrip('# ').strip()
break
if not title:
click.echo(f'Could not parse title from {md}', err=True)
stripped = text.lstrip()
# skip files with existing TOML frontmatter
if stripped.startswith('+++'):
continue
# parse status
status = ''
in_status = False
for line in text.splitlines():
if in_status and line.strip().startswith('**General Status**:'):
status = line.split(':', 1)[1].strip()
break
if line.strip() == '## Status':
in_status = True
if not status:
status = 'Not started'
# migrate YAML frontmatter if present
if stripped.startswith('---'):
lines = text.splitlines()
# find end of YAML frontmatter
end = None
for idx, line in enumerate(lines[1:], 1):
if line.strip() == '---':
end = idx
break
if end is None:
click.echo(f'Malformed YAML frontmatter in {md}', err=True)
continue
front = '\n'.join(lines[1:end])
try:
import yaml
data = yaml.safe_load(front)
except ImportError:
click.echo(f'Missing PyYAML to parse YAML frontmatter in {md}', err=True)
continue
task_id = str(data.get('id', '')).strip()
title = data.get('title', '').strip()
status = data.get('status', '').strip()
body = '\n'.join(lines[end + 1 :])
else:
# no frontmatter: extract from markdown content
task_id = md.stem.split('-', 1)[0]
lines = text.splitlines()
# parse title from heading
title = ''
for line in lines:
if line.startswith('# Task '):
parts = line.split(':', 1)
title = parts[1].strip() if len(parts) == 2 else line.lstrip('# ').strip()
break
if not title:
click.echo(f'Could not parse title from {md}', err=True)
continue
# parse status from Status section
status = ''
in_status = False
for line in lines:
if in_status and line.strip().startswith('**General Status**:'):
status = line.split(':', 1)[1].strip()
break
if line.strip() == '## Status':
in_status = True
if not status:
status = 'Not started'
body = text
# apply TOML frontmatter
meta = TaskMeta(id=task_id, title=title, status=status)
save_task(md, meta, text)
save_task(md, meta, body)
click.echo(f'Applied TOML frontmatter to {md}')
@cli.command()