@@ -407,6 +407,76 @@ test_orchestrator_skill_exists() {
407407 fi
408408}
409409
410+ test_commit_msg_allows_fixup_commits () {
411+ local tmp_repo hook_output hook_code
412+ tmp_repo=$( mktemp -d)
413+ git init " $tmp_repo " > /dev/null 2>&1
414+
415+ local hook_src=" $REPO_ROOT /skills/dev-discipline/assets/commit-msg"
416+ cp " $hook_src " " $tmp_repo /.git/hooks/commit-msg"
417+ chmod +x " $tmp_repo /.git/hooks/commit-msg"
418+
419+ local msg_file=" $tmp_repo /.git/COMMIT_EDITMSG"
420+ printf ' fixup! feat(auth): add rate limiting' > " $msg_file "
421+
422+ set +e
423+ hook_output=$( " $tmp_repo /.git/hooks/commit-msg" " $msg_file " 2>&1 )
424+ hook_code=$?
425+ set -e
426+
427+ if [ " $hook_code " -eq 0 ]; then
428+ pass " commit-msg allows fixup! checkpoint commits"
429+ else
430+ fail " commit-msg allows fixup! checkpoint commits (code=$hook_code )"
431+ fi
432+ }
433+
434+ test_commit_msg_allows_squash_commits () {
435+ local tmp_repo hook_output hook_code
436+ tmp_repo=$( mktemp -d)
437+ git init " $tmp_repo " > /dev/null 2>&1
438+
439+ local hook_src=" $REPO_ROOT /skills/dev-discipline/assets/commit-msg"
440+ cp " $hook_src " " $tmp_repo /.git/hooks/commit-msg"
441+ chmod +x " $tmp_repo /.git/hooks/commit-msg"
442+
443+ local msg_file=" $tmp_repo /.git/COMMIT_EDITMSG"
444+ printf ' squash! feat(auth): add rate limiting' > " $msg_file "
445+
446+ set +e
447+ hook_output=$( " $tmp_repo /.git/hooks/commit-msg" " $msg_file " 2>&1 )
448+ hook_code=$?
449+ set -e
450+
451+ if [ " $hook_code " -eq 0 ]; then
452+ pass " commit-msg allows squash! checkpoint commits"
453+ else
454+ fail " commit-msg allows squash! checkpoint commits (code=$hook_code )"
455+ fi
456+ }
457+
458+ test_post_commit_logs_concerns () {
459+ local tmp_home tmp_repo
460+ tmp_home=$( mktemp -d)
461+ tmp_repo=$( mktemp -d)
462+
463+ HOME=" $tmp_home " " $REPO_ROOT /scripts/new-project-bootstrap.sh" --init-git " $tmp_repo " > /dev/null 2>&1
464+
465+ (
466+ cd " $tmp_repo "
467+ echo " test" > testfile.txt
468+ git add testfile.txt
469+ git commit --no-verify -m " $( printf ' feat(auth): change login flow\n\nwhy: simplifying auth reduces attack surface\nconcern: this changes session handling — verify no active sessions break' ) " > /dev/null 2>&1
470+ )
471+
472+ diary_file=$( ls " $tmp_repo /.dev/diary/" * .md 2> /dev/null | head -1)
473+ if [ -n " $diary_file " ] && grep -q " verify no active sessions break" " $diary_file " ; then
474+ pass " post-commit logs concern: lines in diary"
475+ else
476+ fail " post-commit logs concern: lines in diary"
477+ fi
478+ }
479+
410480test_bootstrap_installs_planner_and_scaffold
411481test_pre_commit_blocks_large_source_change_without_plan_update
412482test_planner_validator_checks_quality_rules
@@ -427,6 +497,9 @@ test_post_commit_tags_agent_id
427497test_post_commit_no_tag_without_agent_id
428498test_reconcile_branch_script_exists
429499test_orchestrator_skill_exists
500+ test_commit_msg_allows_fixup_commits
501+ test_commit_msg_allows_squash_commits
502+ test_post_commit_logs_concerns
430503
431504echo " "
432505echo " Test results: $PASS_COUNT passed, $FAIL_COUNT failed"
0 commit comments