Skip to content

feat(workflow): persist unleash summary for /uf.finale PR generation - #737

Merged
jflowers merged 2 commits into
unbound-force:mainfrom
jflowers:opsx/persist-unleash-summary
Oct 16, 2026
Merged

jflowers merged 2 commits into
unbound-force:mainfrom
jflowers:opsx/persist-unleash-summary

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

/uf.unleash Step 10 composes the highest-fidelity summary of a
change (What Was Built, How to Verify, Test Results), presents it
once, then discards it. /uf.finale regenerated its PR body from
scratch and ignored that output — the consumer half
(uf_finale_pr_context reading .uf/artifacts/unleash-summary/<slug>.json)
was already implemented by finale-token-reduction, but no producer
ever wrote the file.

This change supplies the missing producer side: a new
persist_unleash_summary tool in the uf-workflow plugin that
persists the Step 10 sections as a branch-keyed JSON artifact with
provenance metadata (artifact_type, schema_version, branch,
timestamp), so /uf.finale generates PR bodies from verified
information instead of inference.

Closes #707

How to Test

  • make plugin-test — full TypeScript suite (unit, integration,
    smoke, coverage) including new createPersistUnleashSummaryTool
    tests: happy path, branch slug path, schema contract, overwrite
    semantics, validation rejection, detached-HEAD failure, symlink
    refusal, failure envelopes
  • go test -race -count=1 ./internal/scaffold/... — embedded-asset
    drift tests enforce byte parity of the mirrored command and plugin
  • make check — CI parity end to end (lint, test, build, coverage
    gate, plugin tests)

How to Demo

Run /uf.unleash on any feature branch and confirm Step 10 writes
.uf/artifacts/unleash-summary/<branch-slug>.json containing
whatWasBuilt, howToVerify, and testResults; then run
/uf.finale and observe the PR body prefilled from the artifact.

Key Files Changed

  • .opencode/plugins/uf-workflow/index.ts (+184) — new
    persist_unleash_summary tool
  • .opencode/commands/uf.unleash.md (+8) — Step 10 call instruction
  • .opencode/test/uf-workflow.test.ts (+319) — tool test coverage
  • internal/scaffold/assets/opencode/ — mirrored command and plugin
  • CHANGELOG.md — unreleased entry
  • openspec/changes/persist-unleash-summary/ — spec artifacts and
    completed tasks
  • .uf/dewey/learnings/ — workflow learnings (10 files)

This PR was generated by /uf.finale (AI-assisted).

/uf.unleash produced rich What Was Built / How to Verify / Test
Results sections that were lost at session end, forcing /uf.finale
to reconstruct PR bodies from commit logs. Persist the summary as
a branch-keyed JSON artifact so the finale generates the PR body
from verified information instead of inference.

- Add persist_unleash_summary tool to uf-workflow plugin: validates
  the three summary fields, writes
  .uf/artifacts/unleash-summary/<branch-slug>.json with provenance
  (artifact_type, schema_version, branch, timestamp) and structured
  success/failure envelopes
- Call the tool from /uf.unleash Step 10 (soft-fail on error)
- Mirror command and plugin into scaffold assets
- Cover the tool with injectable GitExec + temp-dir tests, including
  a consumer-contract test pinning the uf_finale_pr_context read
- Mark persist-unleash-summary tasks complete; capture workflow
  learnings in Dewey; add CHANGELOG entry

Assisted-by: unknown-model
Generated with AI assistance (unknown-model)
@jflowers
jflowers requested a review from a team as a code owner October 16, 2026 11:29
@jflowers jflowers self-assigned this Oct 16, 2026

@jflowers jflowers left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Verdict: APPROVE WITH ADVISORIES

Posted as a COMMENT per verdict mapping (advisories only — nothing blocking).

What this PR does: Adds the persist_unleash_summary tool to the uf-workflow plugin (producer half of #707), writing a hardened, schema-versioned JSON artifact at .uf/artifacts/unleash-summary/<sanitized-branch>.json for the already-merged uf_finale_pr_context consumer. Validation runs before side effects, the write path carries a traversal guard and dual symlink refusal (directory + file) with restricted permissions (0o700/0o600), and the change ships 14 tests including a consumer-contract pin, byte-identical scaffold mirrors, and complete OpenSpec artifacts. Spec FR-001–FR-008 are all implemented; issue #707 criteria are covered with the documented D2 schema deviation (flat camelCase matching the merged consumer over the issue's envelope proposal).

Council result: 3 of 3 dispatched personas return APPROVE WITH ADVISORIES (divisor-adversary on claude-opus-4-6; divisor-curator and divisor-guard on glm-5-3; divisor-architect timed out and does not vote). CI: all substantive checks pass (16 checks — 11 success, 3 skipped Dependabot jobs, 1 queued duplicate, 1 neutral). Two MEDIUM advisories and three LOW observations follow; none block merge.

Advisories (MEDIUM)

  1. Constitution alignment record incomplete — the proposal's Constitution Alignment section assesses Principles I–IV only; constitution v1.4.0 carries six. V (Security by Default) and VI (Deterministic Execution) — the two this change most exercises — lack formal assessment, though design.md D1/D6/D7 carry the reasoning. (inline)
  2. Documentation gate unauditable from the change record — task 4.2 is marked [x] but cites no issue number; the filed issues exist (#736, unbound-force/website#308) but the record does not name them. (inline)

Observations (LOW)

  1. Positive: dual symlink check (directory + target file) in writeUnleashSummary extends the checkpoint pattern. (inline)
  2. Task 4.2 wording is risk-shaped rather than self-verifying; template propagation risk. (inline)
  3. UnleashSummaryArtifact lacks a producer-identity field; the constitutional metadata set is one field short. (inline)

This review was generated by /uf.review-pr (AI-assisted).

tool returns the standard `success()`/`failure()` envelope with
structured error codes, following the `uf-workflow` pattern.

### IV. Testability

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Constitution alignment (divisor-guard): The Constitution Alignment section ends at Principle IV, but the org constitution v1.4.0 (amended 2026-10-14, one day before this proposal was created) carries six active principles. Principles V (Security by Default) and VI (Deterministic Execution) receive no formal assessment — and they are the two this change most directly exercises: V via restricted-permission writes (0o700/0o600), symlink refusal, the path-traversal guard, and non-empty input validation; VI via extracting mechanical persistence prose into an executable tool (design D1 invokes the determinism gate). The substantive reasoning exists in design.md (D1 for VI, D6/D7 for V), so no principle is violated in substance — but the recorded Compliance Review gate covers 4 of 6 active principles, and verification task 5.4 in tasks.md inherits the same four-principle enumeration. Root cause: the proposal follows a pre-amendment peer template instead of re-baselining against the current constitution version. Advisory: extend this section with V and VI assessments (the design.md reasoning carries over) and update task 5.4's enumeration.

`## Unreleased` → `### Added` in `CHANGELOG.md` following the
`- <change-name>: <summary>` format with
`(Spec: openspec/changes/persist-unleash-summary/, Refs: #707)`
- [x] 4.2 Assess the documentation gate: file a documentation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM — Documentation gate (divisor-guard): Task 4.2 is marked [x] but records no filed issue number, so neither documentation gate is auditable from the change record. The task names no target repository and its parenthetical pre-loads an exemption rationale, yet this change has user-visible effect: /uf.unleash Step 10 gains a persistence call, /uf.finale PR body content changes when the artifact is present, and both ship to scaffold adopters via the mirrored assets. User-visible effect is the gate trigger for the constitution's Cross-Repo Documentation rule and the AGENTS.md documentation-issue gate, and this PR's own committed learning (documentation-gate-20261015T234405) identifies this exact formulation — no named target, prefaced exemption — as the anti-pattern that invites skipping a constitutional MUST. The issues exist (#736 and unbound-force/website#308, both OPEN); the gap is that the record does not cite them. Advisory: annotate the task with the assessment outcome and both issue numbers so the gate is verifiable from the change record.

// Directory does not exist yet — will be created below.
}
try {
const fileStats = lstatSync(fp)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW — Security observation (divisor-adversary), positive: writeUnleashSummary checks for symlinks on both the directory and the target file via lstatSync, extending the checkpoint writeState pattern (which guards only the parent directory) to the target file as well. This closes the theoretical symlink-swap window between the lstat check and the writeFileSync call — a TOCTOU gap that is negligible in this single-user local context but good practice to close. No change requested; recording the pattern so it stays visible for future write tools.

- [x] 4.2 Assess the documentation gate: file a documentation
issue for the user-facing behavior change unless an exemption
applies (internal workflow plumbing with user-visible PR body
improvement — record the assessment either way)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW — Documentation gate (divisor-curator): Task 4.2's wording is risk-shaped rather than self-verifying — "record the assessment either way" records no outcome, names no target repository, and cites no issue number. Verification via gh confirms both gates exist: #736 (OPEN, names this spec path, Refs #707, four-item documentation checklist) and the constitutionally mandated unbound-force/website#308 (OPEN, "docs: /uf.unleash persisted demo summaries and /uf.finale PR body sourcing"), cross-referenced from #736's Context section. The residual risk is template propagation: future OpenSpec changes copy tasks.md structure as a starting point, and this shape is the anti-pattern this PR's own learning documentation-gate-20261015T234405 identifies. Advisory: the sibling-change convention names unbound-force/website explicitly and cites the Cross-Repo Documentation rule; that shape makes the gate self-verifying.

* without unwrapping. Provenance metadata rides along at the top level;
* consumers ignore unknown fields, so the metadata is forward-safe.
*/
export interface UnleashSummaryArtifact {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW — Artifact metadata (divisor-guard): UnleashSummaryArtifact carries whatWasBuilt, howToVerify, testResults, artifact_type, schema_version, branch, and timestamp, but no producer-identity field. Constitution Principles I and III enumerate the metadata an artifact MUST carry so any consumer can interpret it without consulting the producer — producer identity, version, timestamp, artifact type — and this set is one field short: artifact_type: "unleash-summary" only implies the producing tool. Non-blocking: the consumer contract (finale-token-reduction D5) reads only the content fields, and the schema deliberately reconciles against that merged consumer (design D2). Advisory: a top-level producer field (e.g. producer: "uf-workflow/persist_unleash_summary") completes the constitutional metadata set and stays forward-safe for consumers that ignore unknown fields.

@jflowers
jflowers merged commit 68acbe1 into unbound-force:main Oct 16, 2026
16 checks passed
jflowers added a commit to jflowers/unbound-force that referenced this pull request Oct 20, 2026
The PR unbound-force#674 prose-to-tool migrations broke in live use (unbound-force#732,
unbound-force#735, unbound-force#707/unbound-force#737) because nothing executed the seams each
migration created. This change verifies them:

- Layer 1 (registration surface): new
  .opencode/test/registration-surface.test.ts -- 20 tests
  dynamically enumerate all 47 tools across the four
  plugins, asserting presence, schema-non-empty-iff-declared,
  and zod/JSON-schema parity
- Layer 3 (round-trips and command pins): all 8 writer
  params pinned in uf-finale.test.ts; dispatch-artifact
  resume round-trip confirmed in
  finalize-review-dispatch.test.ts; Go command-contract
  subtests expanded 10 to 32, census-complete for
  uf.unleash invocations
- DE-007 [MUST] seam-verification rule in the determinism
  pack (1.1.0 to 1.2.0) with the authoring-time hook in
  determinism-first SKILL.md
- OpenSpec artifacts, CHANGELOG entry (refs unbound-force#765), and 13
  Dewey learnings from the workflow

Assisted-by: glm-5
Generated with AI assistance (glm-5)
@jflowers
jflowers deleted the opsx/persist-unleash-summary branch November 15, 2026 21:37
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.

feat: /uf.unleash should persist demo summary for /uf.finale PR body generation

1 participant