Skip to content

feat: platform grounding (G1-G6) — Step 1.5 + fail-closed gate + release-workflow fix → v2.3.0 - #34

Merged
limcheehow merged 4 commits into
masterfrom
feat/platform-grounding
Sep 20, 2026
Merged

limcheehow merged 4 commits into
masterfrom
feat/platform-grounding

Conversation

@limcheehow

Copy link
Copy Markdown
Contributor

What

Platform grounding (G1–G6) — makes the brainstorming skill reason from the platform-wide design (contracts, ownership, ADRs across sibling repos) instead of the one repo it sits in, and enforces it fail-closed.

Design report: codemax repo, docs/research/platform-context-grounding-for-brainstorming.md. Companion landings: tapway/platform-specs (new spec repo), tapway/codemax #104 (platform-context CLI). Pilot installs: samurai-inspector#52, city-terra#204.

G1 — Step 1.5 Platform Context (all 3 skill variants)

Mandatory retrieval before options: ownership & contracts, existing capability, platform ADRs, data model, dependency direction; routing decision (extend / direct / new spec / decompose); unresolved → UNKNOWN (not retrieved: …).

G2 — grounded option rows

Platform Fit + Grounding: (catalog refs + ADR ids) + Rejected because platform:.

G3 — fail-closed gate, three harnesses

pre-brainstorm-ground shared lib + extract-post-text.py; wired for Claude Code (PreToolUse Write|Edit), Codex (Bash|Edit|Write), Hermes (terminal|write_file|patch). Validates POST-write text (payload content / heredoc / echo); bullet/bold Grounding: rows accepted; nested paths gated; fails closed if python3 is missing. Off by default (public repo): TAPWAY_BRAINSTORM_GATE=1 enables.

G6 — index-first budget

Platform pack is a ~4k-char index, fetch-on-demand — never inline docs.

Release workflow fixed (root cause, not symptom)

Auto Release had failed on every master push since the ruleset landed (v2.2.0, v2.2.1 included): the bot's manifest-sync push is rejected by the protected-branch ruleset, aborting the job before tagging. Now: tag + release publish first; manifest sync is non-fatal (continue-on-error) with an explicit warning. This PR unblocks releases, it doesn't just tag manually.

Tests (all green locally)

  • tests/test-phase-g.sh — 40+ assertions: variants in sync, template-form docs pass, creation flow (grounded ALLOW / ungrounded BLOCK), heading-dodge blocked, no-python3 fail-closed, md5 copy-drift guard
  • tests/e2e-platform-grounding.sh — full chain: spec repo → pack → CLI gate → hook
  • Existing 9 suites: 608+ assertions, no regressions
  • Adversarial review round: 16 findings (2 critical: template-vs-regex mismatch; pre-write-state gating deadlock) — all fixed with regression tests

Version

2.3.0 (feat → MINOR per the release workflow's semver rules). CHANGELOG entry written; manifests bumped. On merge, Auto Release will fire, tag v2.3.0, and publish release notes from the changelog — that is the release for this PR.

Note on master history

5f52610 (the same feature commit) was previously pushed directly to master in error; master was reset to 2a83824 and the work re-landed here via this PR so the 1-review ruleset governs it.

…l-closed gate

- brainstorming skill (3 variants): Step 1.5 Platform Context before options,
  Platform Fit / Rejected-because-platform / Grounding / UNKNOWN rows,
  ~4k-char index-first pack budget, routing decision before design
- pre-brainstorm-ground hook (Claude Code + Codex + Hermes adapters, shared
  lib + extract-post-text.py): gates POST-write text (payload content,
  heredoc/echo bodies), bullet/bold Grounding lines, hermes write_file/patch
  matchers, nested paths, fail-closed when python3 missing
- hooks wiring: hooks.json PreToolUse Write|Edit, codex template Bash|Edit|Write,
  hermes config terminal|write_file|patch
- test-phase-g.sh + e2e-platform-grounding.sh: 40+ assertions incl. creation
  flow, template-form docs, md5 copy-drift guard, no-python3 fail-closed
- check_docs_consistency.py: stale count expectations corrected
… v2.3.0

- release.yml: tag + GitHub release now publish BEFORE (and independent of) the
  plugin-manifest sync; manifest sync is non-fatal when the ruleset rejects the
  bot push. Auto Release had failed on every master push since the ruleset landed
  (v2.2.0, v2.2.1, and the 5f52610 push all failed at 'Sync plugin manifest versions').
- CHANGELOG 2.3.0 entry (platform grounding G1-G6 + fixes + tests).
- Bump plugin.json / marketplace.json to 2.3.0.
@github-actions

Copy link
Copy Markdown
Contributor

✅ Workflow audit passed — conventional commits ✓, plan ✓, no secrets ✓.

…in/main

The audit's 'Collect PR facts' step ran 'git log origin/main..HEAD' — this
repo's default branch is master and no 'main' ref exists, so the step failed
on every PR since 2026-08-20 (releases were being merged with a red audit).
BASE_BRANCH now comes from the PR's base ref (fallback: master).
@github-actions

Copy link
Copy Markdown
Contributor

✅ Workflow audit passed (non-blocking notes):

⚠️ WARNING: no docs/checklists/*.md touched. Claim your work package in the checklist.
⚠️ WARNING: feature PR didn't touch docs/. Run /pr (or /repo-docs) to update docs.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Workflow audit passed (non-blocking notes):

⚠️ WARNING: no docs/checklists/*.md touched. Claim your work package in the checklist.

@limcheehow
limcheehow merged commit 5bf7339 into master Sep 20, 2026
1 check 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