Skip to content

fix: cron commits trigger Pages; tighten diff-guard; scrollable card comments#149

Merged
jeremymanning merged 1 commit into
mainfrom
fix-cron-deploy-and-diff-leak
May 15, 2026
Merged

fix: cron commits trigger Pages; tighten diff-guard; scrollable card comments#149
jeremymanning merged 1 commit into
mainfrom
fix-cron-deploy-and-diff-leak

Conversation

@jeremymanning
Copy link
Copy Markdown
Member

Five user-reported issues, all root-caused and fixed in a single bundle.

Issues

  1. Personality cron (and all crons) aren't updating the website.
    Root cause: GitHub deliberately suppresses workflow triggers from
    GITHUB_TOKEN-authored pushes. Every cron correctly regenerated
    web/data/projects.json and committed, but pages.yml's push
    trigger silently no-opped — bot commits never fired Pages deploys.

  2. Comments don't appear in cards / aren't scrollable.
    Root cause: JS rendering was correct (45 comments across 19 projects
    already feed the inline .comments-block) but had no max-height +
    overflow-y; "+N more" pushed card layout instead of scrolling.

  3. Markdown renders literal '--- a/path' / '@@ -N,N' diff markers.
    Root cause: speckit diff-guard at tasks_cmd.py:161 only caught
    @@-prefixed leads; missed --- a/<path> headers AND the
    escalate-branch wrote patches verbatim without guarding.
    7 production .md files polluted (PROJ-001 spec/plan/tasks,
    PROJ-007 spec, PROJ-008 spec, PROJ-023 spec/plan).

  4. Missing artifacts / dead links. Root cause: subsumed by issue 3
    — the user was seeing diff-polluted markdown bodies (links inside
    --- a/spec.md text are non-clickable). The artifact-link code in
    dialog.js already correctly suppresses null relpaths.

  5. No cron triggers a Pages rebuild after touching dashboard files.
    Subsumed by fix 1.

Fixes

Fix 1: pages-deploy dispatch from every cron (10 workflows)

Each cron's commit step now sets pushed=true|false in $GITHUB_OUTPUT,
and a follow-up step runs gh workflow run pages.yml --ref main when
pushed == 'true'. workflow_dispatch invoked from a workflow DOES
fire regardless of token provenance — unlike push.

Workflows touched: pipeline-{personality,brainstorm,flesh-out,implement,paper-speckit,paper-write,research-speckit,review}.yml,
submission-intake.yml, paper-compile.yml. All YAML re-validated.

Fix 2: tighten + share diff-guard

  • New module src/llmxive/speckit/_diff_guard.py (single source of
    truth, Constitution I) catches:
    • @@ -N,N +N,N @@ hunk-only leads (original case)
    • --- a/<path> lead (NEW — the case that polluted PROJ-001)
    • +++ b/<path> lead
    • any combination of 2+ unified-diff markers anywhere in the text
    • context-diff format (*** old\n--- new)
  • Wired into all three speckit writers: tasks_cmd.py (main +
    escalate-branch patches), specify_cmd.py, plan_cmd.py.
  • 7 polluted files purged; affected projects rolled back to
    flesh_out_complete via the same _walk_back_to_real_stage used by
    spec 010's speckit prune. Rollbacks recorded in
    state/projects/<id>.history.jsonl + state/run-log/.

Fix 3: scrollable comments block

web/css/site.css adds:

.card .comments-block.expanded {
  max-height: 320px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

The existing JS toggle (+N more.expanded class) already works;
this just constrains the height when expanded so the user scrolls instead
of pushing the card layout.

Tests

  • 12 new unit tests for _diff_guard: hunk-only leads, --- a/ leads,
    +++ b/ leads, 2+-marker detection, context-diff format. Critically,
    also tests that markdown HR rules (---) and em-dashes don't false-fire.
  • 78/78 spec-010 + librarian-gate tests pass.
  • web/data/projects.json regenerated after cleanup.

🤖 Generated with Claude Code

…on card comments

User reported 5 issues, all root-caused and fixed:

1. **Personality cron isn't updating the website** (and other crons too).
   Root cause: GitHub deliberately suppresses workflow triggers from
   GITHUB_TOKEN-authored pushes (anti-loop policy). Every cron correctly
   regenerated web/data/projects.json and committed, but pages.yml's
   `push` trigger silently no-opped — bot commits never fired Pages
   deploys.
   Fix: each of the 10 cron workflows now ends with an explicit
   'Trigger Pages deploy' step that runs `gh workflow run pages.yml`
   when the previous commit step set pushed=true. workflow_dispatch
   invoked from another workflow DOES fire regardless of token
   provenance. All YAML re-validated.

2. **Comments don't appear on cards (and aren't scrollable).**
   Root cause: the JS rendering was correct (45 comments across 19
   projects already feed into the inline .comments-block) but had no
   max-height + overflow-y; +N more would push the card layout instead
   of scrolling.
   Fix: web/css/site.css adds `.card .comments-block.expanded` with
   max-height 320px + overflow-y:auto + scroll-behavior:smooth. The
   existing JS already toggles .expanded on +N more click.

3. **Markdown rendering shows literal '--- a/path' / '@@ -N,N' diff
   markers.** Root cause: the speckit diff-guard at tasks_cmd.py:161
   only caught `@@`-prefixed leads; missed `--- a/<path>` headers
   AND the escalate-branch wrote patches verbatim without guarding.
   7 production .md files were polluted (PROJ-001 spec/plan/tasks,
   PROJ-007 spec, PROJ-008 spec, PROJ-023 spec/plan).
   Fix:
   - New module src/llmxive/speckit/_diff_guard.py with 4-way detection
     (hunk-only lead, --- a/ lead, +++ b/ lead, 2+ markers anywhere,
     context-diff format). Single source of truth (Constitution I).
   - Wired into tasks_cmd.py (main path + escalate-branch),
     specify_cmd.py, plan_cmd.py — refusing diff-shaped writes
     across all three speckit writers.
   - 12 unit tests for the guard, including the exact PROJ-001
     pollution shape + MUST-NOT-misclassify cases (markdown HR rules,
     em-dashes, well-formed spec content).
   - 7 polluted files purged from disk; 3 affected projects rolled
     back to flesh_out_complete via the same _walk_back_to_real_stage
     used by spec 010's speckit prune. Stage rollbacks recorded in
     history.jsonl + state/run-log/.

4. **Missing artifacts / dead links.** Root cause: the user was
   actually seeing the diff-polluted markdown (links inside
   '--- a/spec.md' are non-clickable text). The artifact-link code
   in dialog.js already correctly suppresses null relpaths.
   Resolution: subsumed by fix 3.

5. **No cron triggers a Pages rebuild after touching dashboard files.**
   Resolution: subsumed by fix 1 (every cron now triggers Pages
   deploy after a successful commit).

Test sweep:
- 12 new diff-guard tests pass.
- 78/78 spec-010 + librarian-gate tests pass.
- web/data/projects.json regenerated after cleanup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jeremymanning jeremymanning merged commit 1142a43 into main May 15, 2026
5 checks passed
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