From 3aa5c25b5e4321fe83266b54ed17793545842cb4 Mon Sep 17 00:00:00 2001 From: AG Werschky Date: Fri, 24 Jul 2026 06:08:13 -0600 Subject: [PATCH] fix: preserve apostrophes in fm-brief scaffolds --- bin/fm-brief.sh | 18 +++++++------- tests/fm-brief.test.sh | 54 +++++++++++++++++++++++++++++++----------- 2 files changed, 50 insertions(+), 22 deletions(-) diff --git a/bin/fm-brief.sh b/bin/fm-brief.sh index 00ea34ddab..957d5a48a8 100755 --- a/bin/fm-brief.sh +++ b/bin/fm-brief.sh @@ -311,25 +311,27 @@ EOF SETUP2=" 2. Run \`no-mistakes doctor\`; if it reports the repo is not initialized here, run \`no-mistakes init\`." RULE1='1. Never push to the default branch. Never merge a PR.' - DOD=$(cat < file <&1); rc=$? @@ -114,9 +113,35 @@ test_no_mistakes_dod_wording() { # shellcheck disable=SC2016 # single quotes are deliberate: the backticks must stay literal assert_grep '`help`' "$brief" \ "no-mistakes DOD must render literal backticks around help" - assert_no_grep "no-mistakes' own guidance" "$brief" \ - "no-mistakes DOD regressed to the apostrophe form that breaks bash -n" - pass "fm-brief.sh: no-mistakes DOD wording avoids the apostrophe regression" + assert_grep "firstmate's authority check" "$brief" \ + "no-mistakes DOD lost its literal apostrophe" + pass "fm-brief.sh: no-mistakes DOD renders literal apostrophes" +} + +test_apostrophes_render_in_ship_and_secondmate_scaffolds() { + local home ship_id ship_brief mate_id mate_brief status + home="$TMP_ROOT/apostrophe-home" + mkdir -p "$home/data" + + ship_id="brief-apostrophe-c1" + FM_HOME="$home" "$ROOT/bin/fm-brief.sh" "$ship_id" some-proj >/dev/null 2>&1; status=$? + expect_code 0 "$status" "ship brief with instructional apostrophe should exit 0" + ship_brief="$home/data/$ship_id/brief.md" + assert_grep "firstmate's authority check" "$ship_brief" \ + "ship brief did not preserve the instructional apostrophe" + + mate_id="secondmate-apostrophe-c2" + FM_HOME="$home" \ + FM_SECONDMATE_CHARTER="Supervise the owner's domain." \ + FM_SECONDMATE_SCOPE="Handle the advisor's requests." \ + "$ROOT/bin/fm-brief.sh" "$mate_id" --secondmate --no-projects >/dev/null 2>&1; status=$? + expect_code 0 "$status" "secondmate charter with apostrophes should exit 0" + mate_brief="$home/data/$mate_id/brief.md" + assert_grep "Supervise the owner's domain." "$mate_brief" \ + "secondmate charter did not preserve the owner's apostrophe" + assert_grep "Handle the advisor's requests." "$mate_brief" \ + "secondmate scope did not preserve the advisor's apostrophe" + pass "fm-brief.sh: ship and secondmate scaffolds preserve apostrophes" } test_ship_project_memory_wording() { @@ -387,6 +412,7 @@ test_help_includes_entire_header test_ship_modes_generate_clean_briefs test_faster_paths_use_configured_authority_without_stacked_review test_no_mistakes_dod_wording +test_apostrophes_render_in_ship_and_secondmate_scaffolds test_ship_project_memory_wording test_herdr_lab_contract_is_explicit_and_complete test_herdr_lab_contract_quotes_foreign_firstmate_path