Commit Graph

5 Commits

Author SHA1 Message Date
Garry Tan 1a2e92278d merge: integrate origin/main (v1.1.2.0) — mode-posture energy
Main shipped v1.1.2.0, restoring mode-posture energy to /plan-ceo-review
EXPANSION and /office-hours forcing + builder modes. V1's writing-style
rules 2-4 collapsed every outcome into diagnostic-pain framing; models
follow concrete examples over abstract taxonomies, so cathedral-mode
output was flattening even when the template said "dream big."

Conflicts:
- VERSION / package.json: kept 1.2.0.0 (branch higher than main's 1.1.2.0)
- CHANGELOG: preserved 1.2.0.0 at top, inserted main's 1.1.2.0 below it,
  and added a short note under 1.2.0.0's Changed section documenting
  that the mode-posture examples are included here too (via the port)
- scripts/resolvers/preamble.ts: main edited inline writing-style
  examples in the old monolithic preamble file; my submodule refactor
  landed the same file as an 80-line composition root. Resolution:
  kept my submodule structure (dropped main's 800 lines of inline code)
  and ported main's new rule 2/3/4 examples into
  scripts/resolvers/preamble/generate-writing-style.ts — same behavior,
  just in the right place for the submodule shape.

Ship SKILL.md, golden fixtures, office-hours/plan-ceo-review templates,
new test/fixtures/mode-posture/** fixtures, new judgePosture helper,
and touchfiles entries for three new gate-tier E2E tests (plan-ceo-
review-expansion-energy, office-hours-forcing-energy, office-hours-
builder-wildness) all auto-merged cleanly.

Regenerated all SKILL.md files and ship goldens. 423 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 05:57:27 +08:00
Garry Tan 70d045d4d9 merge: integrate origin/main (v1.1.0.0) — V1 + Puppeteer parity + /plan-tune
Big merge. Main shipped three releases while this branch was in flight:
- v0.19.0.0 /plan-tune skill (observational layer; dual-track dev profile)
- v1.0.0.0 V1 prompts (simpler, outcome-framed, jargon-glossed) + LOC receipts
- v1.1.0.0 browse Puppeteer parity (load-html, file://, --selector, --scale)

This branch bumps to v1.2.0.0 (above main's v1.1.0.0) per the
branch-scoped-version rule in CLAUDE.md. My "0.19.0.0" CHANGELOG entry
is renamed to "1.2.0.0" and dated 2026-04-18 to land above main's trail.

Conflicts resolved:
- VERSION / package.json: 1.2.0.0
- CHANGELOG.md: preserved my entry at top (renamed), kept main's 1.1.0.0
  / 1.0.0.0 / 0.19.0.0 / 0.18.4.0 trail below in correct order
- .github/docker/Dockerfile.ci: kept my xz-utils + nodejs.org tarball
  fix (real CI bug fix main didn't have); absorbed main's retry loop
  structure for both apt and the tarball curl
- bin/gstack-config: kept both my checkpoint_mode/push section and
  main's explain_level writing-style section
- scripts/resolvers/preamble.ts: kept my submodule refactor as the
  file shape; extracted main's new generateWritingStyle and
  generateWritingStyleMigration into scripts/resolvers/preamble/
  submodules; absorbed main's generateQuestionTuning import
- All generated SKILL.md files: resolved by regen via
  bun run gen:skill-docs --host all (per CLAUDE.md: never hand-merge
  generated files — resolve templates and regen)
- Ship golden fixtures (claude/codex/factory): refreshed

Tier 2 preamble composition now includes all 8 sections: context
recovery, ask-user-format, writing-style, completeness, confusion,
continuous checkpoint, context health, question tuning.

Main also brought new test files from /plan-tune: skill-e2e-plan-tune,
upgrade-migration-v1, v0-dormancy, writing-style-resolver. All absorbed.
468 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 23:35:36 +08:00
Garry Tan e723576d70 chore: trim verbose preamble + coverage audit prose
Compress without removing behavior or voice. Three targeted cuts:

1. scripts/resolvers/testing.ts coverage diagram example: 40 lines → 14
   lines. Two-column ASCII layout instead of stacked sections.
   Preserves all required regression-guard phrases (processPayment,
   refundPayment, billing.test.ts, checkout.e2e.ts, COVERAGE, QUALITY,
   GAPS, Code paths, User flows, ASCII coverage diagram).

2. scripts/resolvers/preamble/generate-completion-status.ts Plan Status
   Footer: was 35 lines with embedded markdown table example, now 7
   lines that describe the table inline. The footer fires only at
   ExitPlanMode time — Claude can construct the placeholder table from
   the inline description without copying a literal example.

3. Same file's Plan Mode Safe Operations + Skill Invocation During Plan
   Mode sections compressed from ~25 lines combined to ~12. Preserves
   all required test phrases (precedence over generic plan mode behavior,
   Do not continue the workflow, cancel the skill or leave plan mode,
   PLAN MODE EXCEPTION).

NOT touched:
- Voice directive (Garry's voice — protected per CLAUDE.md)
- Office-hours Phase 6 Handoff (Garry's voice + YC pitch)
- Test bootstrap, review army, plan completion (carefully tuned behavior)

Token savings (per skill, system-wide):
  ship/SKILL.md           35474 → 34992 tokens (-482)
  plan-ceo-review         29436 → 28940 (-496)
  office-hours            26700 → 26204 (-496)

Still over the 25K ceiling. Bigger reduction requires restructure
(move large resolvers to externally-referenced docs, split /ship into
ship-quick + ship-full, or refactor the coverage audit + review army
into shorter prose). That's a follow-up — added to TODOS.

Tests: 420/420 pass on gen-skill-docs.test.ts + host-config.test.ts.
Goldens regenerated for claude/codex/factory ship.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 14:33:07 +08:00
Garry Tan 7529dbb276 merge: integrate origin/main (v0.18.1.0) into open-agents-learnings
Main moved forward 6 commits while this branch was local. Integrated
both sides preserving all functionality:

From main (v0.16.4.0 → v0.18.1.0):
- v0.17.0.0 — UX behavioral foundations + ux-audit (generateUXPrinciples,
  {{UX_PRINCIPLES}} placeholder, triggers frontmatter on skills)
- v0.18.0.0 — Confusion Protocol, Hermes + GBrain hosts, brain-first
  resolver (generateBrainHealthInstruction, generateConfusionProtocol,
  generateGBrainContextLoad, generateGBrainSaveResults, hosts/gbrain.ts,
  hosts/hermes.ts, scripts/resolvers/gbrain.ts, GBrain bash health check)
- v0.18.0.1 — ngrok Windows build fix
- 0cc830b6 — tilde-in-assignment permission fix
- cc42f14a — gstack compact design doc (tabled)
- 822e843a — headed browser auto-shutdown + disconnect cleanup (v0.18.1.0)

Integration approach: keep this branch's preamble.ts submodule refactor
as the structure of record. Extracted main's two new generators into
their own submodules:
- scripts/resolvers/preamble/generate-brain-health-instruction.ts
- scripts/resolvers/preamble/generate-confusion-protocol.ts

Updated scripts/resolvers/preamble/generate-preamble-bash.ts to absorb
main's GBrain health check (host-conditional on gbrain/hermes).

scripts/resolvers/index.ts now imports BOTH:
- This branch's adds: MODEL_OVERLAY, TASTE_PROFILE, BIN_DIR resolvers
- Main's adds: UX_PRINCIPLES, GBRAIN_CONTEXT_LOAD, GBRAIN_SAVE_RESULTS
  resolvers

scripts/resolvers/design.ts keeps both generateTasteProfile (this
branch) and generateUXPrinciples (main). Sibling exports, no overlap.

scripts/gen-skill-docs.ts keeps both this branch's --model flag wiring
and main's edits.

Templates auto-merged where possible. The 35 generated SKILL.md /
golden conflicts auto-resolved via `bun run gen:skill-docs --host all`
followed by re-snapshotting the ship goldens for claude/codex/factory.

Verification:
- bun run gen:skill-docs --host all completes cleanly
- bun test: 1 pre-existing failure (gstack-community-dashboard Supabase
  network test, 235s timeout). NOT related to merge — unchanged Supabase
  test infra times out without live network. Flagged in PR body.

Token-ceiling warnings on plan-ceo-review (29K), office-hours (26K),
and ship (34K). These existed on origin/main before the merge — the
preamble grew substantially from main's GBrain + UX additions plus this
branch's continuous-checkpoint, context-health, model-overlay, taste-profile,
and feature-discovery additions. Worth a follow-up reduction pass but
doesn't block this merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 13:58:15 +08:00
Garry Tan 0926e4b994 refactor: split preamble.ts into submodules (byte-identical output)
Splits scripts/resolvers/preamble.ts (841 lines, 18 generator functions +
composition root) into one file per generator under
scripts/resolvers/preamble/. Root preamble.ts becomes a thin composition
layer (~80 lines of imports + generatePreamble).

Before:
  scripts/resolvers/preamble.ts  841 lines

After:
  scripts/resolvers/preamble.ts                                   83 lines
  scripts/resolvers/preamble/generate-preamble-bash.ts            97 lines
  scripts/resolvers/preamble/generate-upgrade-check.ts            48 lines
  scripts/resolvers/preamble/generate-lake-intro.ts               16 lines
  scripts/resolvers/preamble/generate-telemetry-prompt.ts         37 lines
  scripts/resolvers/preamble/generate-proactive-prompt.ts         25 lines
  scripts/resolvers/preamble/generate-routing-injection.ts        49 lines
  scripts/resolvers/preamble/generate-vendoring-deprecation.ts    36 lines
  scripts/resolvers/preamble/generate-spawned-session-check.ts    11 lines
  scripts/resolvers/preamble/generate-ask-user-format.ts          16 lines
  scripts/resolvers/preamble/generate-completeness-section.ts     19 lines
  scripts/resolvers/preamble/generate-repo-mode-section.ts        12 lines
  scripts/resolvers/preamble/generate-test-failure-triage.ts     108 lines
  scripts/resolvers/preamble/generate-search-before-building.ts   14 lines
  scripts/resolvers/preamble/generate-completion-status.ts       161 lines
  scripts/resolvers/preamble/generate-voice-directive.ts          60 lines
  scripts/resolvers/preamble/generate-context-recovery.ts         51 lines
  scripts/resolvers/preamble/generate-continuous-checkpoint.ts    48 lines
  scripts/resolvers/preamble/generate-context-health.ts           31 lines

Byte-identity verification (the real gate per Codex correction):
- Before refactor: snapshotted 135 generated SKILL.md files via
  `find -name SKILL.md -type f | grep -v /gstack/` across all hosts.
- After refactor: regenerated with `bun run gen:skill-docs --host all`
  and re-snapshotted.
- `diff -r baseline after` returned zero differences and exit 0.

The `--host all --dry-run` gate passes too. No template or host behavior
changes — purely a code-organization refactor.

Test fix: audit-compliance.test.ts's telemetry check previously grepped
preamble.ts directly for `_TEL != "off"`. After the refactor that logic
lives in preamble/generate-preamble-bash.ts. Test now concatenates all
preamble submodule sources before asserting — tracks the semantic contract,
not the file layout. Doing the minimum rewrite preserves the test's intent
(conditional telemetry) without coupling it to file boundaries.

Why now: we were in-session with full context. Codex had downgraded this
from mandatory to optional, but the preamble had grown to 841 lines and
was getting harder to navigate. User asked "why not?" given the context
was hot. Shipping it as a clean bisectable commit while all the prior
preamble.ts changes are fresh reduces rebase pain later.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 06:43:19 +08:00