Conversation
…section scaffold + Markdown renderer); 19 tests pass — completes 7-of-7 B-0914 candidate gap substrate Per Sakana Robin Falcon agent (Nature 2026): takes drug proposal + does deep-dive literature review + writes comprehensive research report. TS- side scaffold provides 8-section template structure that downstream LLM substrate-engineering work populates (header / framing / background / mechanism / evidence / risks / composes-with / test-plan). What this adds: - ResearchDocSection discriminated union (9 section kinds) - ResearchDoc structure (id + proposalId + sections + composesWith) - ResearchDocFeedback + ResearchDocResult<T> Result-shape - renderSection(section): string — pure-function Markdown serializer - renderResearchDoc(doc): ResearchDocResult<string> — full doc rendering - buildSkeleton(context): ResearchDocResult<ResearchDoc> — 8-section scaffold - buildAndRender(context): ResearchDocResult<string> — end-to-end convenience Falcon-stage pending markers preserved (substrate-honest about what's not yet auto-generated by LLM substrate-engineering): - '[PENDING LITERATURE REVIEW — Falcon-stage auto-generated]' - '[PENDING MECHANISM ANALYSIS — Falcon-stage auto-generated]' - etc. (per section) Tests (19; all pass): - EmptyProposalId validation - 8-section Falcon scaffold structure - proposalId sanitized to filename-safe id - composesWith pass-through to skeleton + composes-with section - All 9 section-kind renderings tested (header/framing/background/ mechanism/evidence/risks/composes-with/test-plan/raw) - renderResearchDoc empty → NoSectionsRendered - buildAndRender end-to-end - Pending markers preserved (substrate-honest) - ResearchDocSection exhaustive switch Composes with substrate: - B-0914.7 backlog row (Falcon extension target) - tools/save-ai-memory/ skill (existing substrate; future integration for auto-write to docs/research/ + composes-with citation discipline) - Amara consolidation ferry pattern (PR #5757) - B-0914.2 PR #5769 closed-loop orchestrator (research-doc generation at any cycle stage; template provides structure) - substrate-or-it-didn't-happen + honor-those-that-came-before rules - asymmetric-authorship + monad-propagation rules **B-0914 7-of-7 candidate substrate-engineering gap substrate complete:** - B-0914.1 PR #5764 TrueSkill ranking (S/M/L: ranking) - B-0914.2 PR #5769 closed-loop orchestrator (S/M/L: L) - B-0914.3 PR #5770 n-parallel + consensus (8-parallel-Finch) - B-0914.4 PR #5768 generation-reflection pairing (S/M/L: M) - B-0914.5 PR #5767 evolution mash-refine (S/M/L: S) - B-0914.6 PR #5772 proximity-dedup (canonical + Jaccard clustering) - B-0914.7 THIS PR Falcon-style auto-research-doc template Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Adds a new TypeScript-side “research doc” scaffold/renderer under tools/workflow-engine/ (B-0914.7), intended to generate a structured Markdown template (Falcon-style) from a proposal/hypothesis, with accompanying Bun tests to lock in the section shapes and rendering invariants.
Changes:
- Introduces
ResearchDocSection/ResearchDoctypes plusbuildSkeleton,renderSection,renderResearchDoc, andbuildAndRenderhelpers. - Implements Markdown rendering for all section kinds, including placeholder “PENDING …” markers.
- Adds a comprehensive Bun test suite covering validation, rendering behavior, and union exhaustiveness.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tools/workflow-engine/research-doc.ts | New research-doc template generator + Markdown renderer APIs. |
| tools/workflow-engine/research-doc.test.ts | Bun tests for skeleton construction, rendering, placeholders, and exhaustiveness checks. |
…emplate-generator-substrate-engineering-substrate-2026-05-28
…lStatus variant (Copilot threads)
Two threads on tools/workflow-engine/research-doc.ts:
1. Composes-with docblock referenced rule files by short form
(`asymmetric-authorship`, `monad-propagation-pattern`) — actual
filenames are longer + .md-suffixed:
`.claude/rules/asymmetric-authorship-substrate-entity-defines-consent-channel-recipient-acknowledges.md`
`.claude/rules/monad-propagation-pattern-cross-language-substrate-shape.md`
Updated to full paths so cross-refs stay greppable + don't drift.
2. ResearchDocFeedback.InvalidOperationalStatus variant was
structurally unreachable: `operationalStatus` is a string-literal
union (`"research-grade" | "operational"`) at the type level, the
only constructor (line 179) fixes it to `"research-grade"`, and
no untrusted-string parse path exists. Variant was dead substrate.
Removed + added docblock naming the conditions under which a
future caller should add it back (JSON import of external
research-doc with operationalStatus parsed from untrusted input —
add validator AT THE PARSE BOUNDARY first, then add this variant).
Composes with asymmetric-authorship discipline: every TFeedback
variant should correspond to a real code path that can produce it.
Non-breaking: no callers reference the removed variant (grep clean).
Type-system continues to rule out invalid operationalStatus at
construction time.
Autonomous-loop tick 2026-05-28T12:16Z resolution of PR #5773 BLOCKED
gate (unresolved Copilot threads only blocker; required checks all green).
Co-Authored-By: Claude <noreply@anthropic.com>
Comment on lines
+7
to
+23
| * Per Sakana Robin Falcon agent (Nature 2026): takes a drug proposal + | ||
| * does deep-dive literature review + writes comprehensive research | ||
| * report. TS-side scaffold: structured-template generator that takes | ||
| * a Hypothesis + produces a research-doc template with sections. | ||
| * | ||
| * Real LLM-backed literature review deferred to integration layer; | ||
| * current PoC provides the TEMPLATE STRUCTURE that downstream | ||
| * substrate-engineering work (LLM calls + literature fetch + reference | ||
| * lookup) populates. | ||
| * | ||
| * Composes with: | ||
| * - B-0914.7 backlog row (Falcon-auto-research-doc extension target) | ||
| * - tools/save-ai-memory/ skill (existing substrate; future integration | ||
| * for auto-write to docs/research/ + composes-with substrate-honest | ||
| * citation discipline) | ||
| * - Amara consolidation ferry pattern (PR #5757; substantive substrate- | ||
| * engineering synthesis as substrate) |
Comment on lines
+202
to
+215
| supporting: ["[PENDING SUPPORTING EVIDENCE EXTRACTION]"], | ||
| }, | ||
| { | ||
| kind: "risks", | ||
| risks: ["[PENDING RISK ANALYSIS]"], | ||
| }, | ||
| { | ||
| kind: "composes-with", | ||
| substrates: context.composesWith ?? ["[PENDING COMPOSITION ANALYSIS]"], | ||
| }, | ||
| { | ||
| kind: "test-plan", | ||
| items: ["[PENDING TEST PLAN GENERATION]"], | ||
| }, |
Comment on lines
+218
to
+225
| return { | ||
| ok: true, | ||
| doc: { | ||
| id: context.proposalId.replace(/[^a-zA-Z0-9_-]/g, "_"), | ||
| proposalId: context.proposalId, | ||
| sections, | ||
| composesWith: context.composesWith ?? [], | ||
| }, |
| * Per Sakana Robin Falcon agent (Nature 2026): takes a drug proposal + | ||
| * does deep-dive literature review + writes comprehensive research | ||
| * report. TS-side scaffold: structured-template generator that takes | ||
| * a Hypothesis + produces a research-doc template with sections. |
This was referenced May 28, 2026
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sakana Robin Falcon agent pattern: 8-section research-doc template scaffold + Markdown renderer. Downstream LLM substrate-engineering populates pending sections.
19 tests pass / 0 fail.
Completes 7-of-7 B-0914 candidate substrate-engineering gap substrate
Test plan
🤖 Generated with Claude Code