Skip to content

[codex] fix extract-knowhow report template generation#23

Open
ktwu01 wants to merge 2 commits intoOpenScientists:mainfrom
ktwu01:codex/fix-extract-knowhow-report-template
Open

[codex] fix extract-knowhow report template generation#23
ktwu01 wants to merge 2 commits intoOpenScientists:mainfrom
ktwu01:codex/fix-extract-knowhow-report-template

Conversation

@ktwu01
Copy link
Copy Markdown
Collaborator

@ktwu01 ktwu01 commented Apr 3, 2026

What changed

  • fix the extract-knowhow report template so the JSON placeholder appears only in the const DATA = __REPORT_DATA__; assignment
  • correct the report form to populate institution from DATA.institution
  • add a regression test that checks the template placeholder and institution binding invariants
  • tighten the command instructions so generation replaces only the DATA token and preserves the rest of the template verbatim

Why

Generated reports could become invalid HTML/JS when placeholder replacement also touched the explanatory comment in the template, leaving duplicated JSON and stray text in the script block. The template also incorrectly filled the institution field from DATA.email.

Impact

This makes generated ~/.openscientist/report.html files more reliable, preserves the interactive review UI, and fixes the author institution field in the browser form.

Validation

  • npm test
  • rendered the template with sample JSON and verified the inline script parses successfully

@ktwu01 ktwu01 marked this pull request as ready for review April 3, 2026 17:04
@ktwu01 ktwu01 requested a review from HHHHHejia as a code owner April 3, 2026 17:04
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