@chrono-meta/fh-gate 3.43.0 → 3.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/AGENTS.md +5 -1
  3. package/docs/USER_GUIDE.md +95 -0
  4. package/knowledge/shared/harness-core/governance_engineering_definition.md +16 -0
  5. package/knowledge/shared/learnings/subagent_invocations_log.yaml +12 -0
  6. package/knowledge/shared/plugin-catalog/recommended_plugins.md +53 -9
  7. package/package.json +8 -1
  8. package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
  9. package/plugins/fh-commons/skills/ko-tech-writer/SKILL.md +47 -12
  10. package/plugins/fh-commons/skills/ko-tech-writer/SKILL_detail.md +60 -0
  11. package/plugins/fh-commons/skills/ko-tech-writer/fixtures/sense_negative.md +30 -0
  12. package/plugins/fh-commons/skills/ko-tech-writer/fixtures/sense_positive.md +56 -0
  13. package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
  14. package/plugins/fh-meta/CHANGELOG.md +23 -0
  15. package/plugins/fh-meta/skills/auto-decorrelation/SKILL.md +45 -1
  16. package/plugins/fh-meta/skills/sim-conductor/SKILL_detail.md +3 -3
  17. package/plugins/fh-meta/skills/steel-quench/SKILL_detail.md +8 -4
  18. package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
  19. package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
  20. package/scripts/agy_launch_guard.sh +49 -0
  21. package/scripts/agy_remote_run.sh +187 -0
  22. package/scripts/codex_launch_guard.sh +87 -0
  23. package/scripts/finding_fleet.sh +35 -2
  24. package/scripts/finding_verifier.sh +6 -2
  25. package/scripts/ko_tech_writer_calibrate.py +88 -1
  26. package/scripts/live_eval_trace.py +23 -4
  27. package/scripts/prepush_guard_check.sh +33 -20
  28. package/scripts/probe_live_eval.sh +1 -1
  29. package/scripts/probe_live_eval_lib.py +7 -5
  30. package/scripts/selfcheck.sh +51 -2
  31. package/scripts/session_checklist.py +109 -5
  32. package/scripts/sidecar_calibrate.sh +10 -2
  33. package/scripts/sidecar_wait.sh +21 -1
  34. package/scripts/test_agy_launch_guard_lanes.sh +227 -0
  35. package/scripts/test_agy_remote_run_lanes.sh +228 -0
  36. package/scripts/test_codex_launch_guard_lanes.sh +138 -0
  37. package/scripts/test_finding_pipeline_lanes.sh +6 -2
  38. package/scripts/test_live_eval_trace_lanes.sh +54 -8
  39. package/scripts/test_preprep_speech_coach_lanes.sh +18 -2
  40. package/scripts/test_prepush_guard_failure_visibility_lanes.sh +152 -0
  41. package/scripts/test_session_checklist_lanes.sh +205 -0
  42. package/scripts/test_sidecar_calibrate_lanes.sh +4 -0
  43. package/scripts/test_sidecar_wait_stdin.sh +18 -0
@@ -4,6 +4,38 @@
4
4
 
5
5
  ## §Step-2-provenance
6
6
 
7
+ > **2026-11-16 추가분의 출처 (같은 원고의 다음 판, 운영자 통독 1회)**: 운영자 요청은 «이 샘플의 낱말만 가르는 게 아니라 그건 예시로 두고 다양한 패턴의 글을 분석하고 작성하게»였다. 그래서 낱말 목록이 아니라 **절차**(S35 의 (a) 늘어놓기 → (b) 뜻 묶기)와 **예방**(Step 1 의 용어표)으로 올렸다. 쌍은 교정 지점의 짧은 구절이고 고유명사 · 회사 맥락은 없다.
8
+ >
9
+ > | 반영 자리 | origin | 쌍 수 | 쌍 |
10
+ > |---|---|---|---|
11
+ > | S35 낱말 뜻 흔들림 — 쓰다 | O | 1 | 글쓰기 뜻과 사용 뜻이 한 문서에 섞임 → 글쓰기 뜻만 남기고 사용 뜻은 사용 · 적용 · 활용 · 인용 · 운용 |
12
+ > | S35 — 세다 / 재다 | O | 1 | 셈 · 측정 · 판정이 섞임 → 세다는 실제 셈만, 값은 측정, 기준 충족은 인정 · 판단. 짧은 쌍: 「통과로 세지 않았다」 → 「통과가 아니라 미측정으로 남겼다」 |
13
+ > | S35 — 기계 | O | 1 | «판단 없는 코드»로 정의한 낱말이 «기계가 만든 산출물»에서 AI 를 가리킴 |
14
+ > | S20 짧은 꼴 | O | 1 | 「동료 심사를 거치지 않은 공개 프리프린트」 → 「프리프린트」 |
15
+ > | S7 먼 자리 풀이 | O | 1 | 앞 절에서 풀이한 「되돌림」이 뒤 표 칸에 홀로 나옴 → 그 칸에도 짧은 풀이 |
16
+ > | S8 목적어 빠진 «멈추다» | O | 1 | 「게이트가 멈춘다」 → 「게이트가 작업을 멈춰 세운다」 — 11-15 모델 후보(같은 원고 · 같은 꼴) 뒤에 나온 교정이라 독립 확인이 아니다. 운영자 쌍 1건으로만 센다 |
17
+ > | 후보 메모: 참조 하나에 가리킴 하나 | O | 1 | 「3.2절에서 소개합니다(부록 A)」 → 두 번째 가리킴 삭제 |
18
+ > | 후보 메모: 동형어 «감사합니다» | 모델 | — | 역할 표 두 곳에서 다시 나옴 — candidate 유지 |
19
+ > 🟥 **S35 의 세 쌍은 한 번의 통독에서 나왔다 — 독립 확인 세 번이 아니다.** 세 쌍이 한 클래스인 이유: 셋 다 «한 문서 안 같은 낱말 · 다른 뜻»이고, 고치는 방법도 같다(한 낱말에 한 뜻, 나머지는 구체적인 낱말로).
20
+ > 🟥 **(a) 단계 레인 `C22` 는 만든 픽스처(`fixtures/sense_positive.md` 활용형 53줄 · `sense_negative.md` 겹치는 낱말 27줄)로만 보정했다. 첫 판 패턴은 활용형 열거형이었고 라운드마다 새 형태를 놓쳤다(쓰인 · 쓰입니다 → 독립 검토가 찾은 쓰였다 · 쓰도 · 씀 · 셀 것). 그래서 쓰다는 어간 일치 + 이름 붙인 제외로 바꿨고, 세다 · 재다는 «세 · 재»로 시작하는 다른 낱말이 너무 많아 어미 목록으로 남겼다(목록 밖은 조용히 빠진다 — `--senses` 출력이 적는다). 🟥 픽스처가 어미 목록의 모든 갈래를 덮지는 않는다 — 갈래 하나를 지워도 초록인 자리가 있다(알려진 잔여).** 실문서 재현율은 UNMEASURED. 되돌림 팔(최종 패턴 기준): 쓰다의 «쓰레» 제외를 지우면 음성 1건으로 빨강 · 재다에서 «죠»를 빼면 「재죠」 줄을 놓쳐 빨강 · 세다에서 홀로 선 «셀»을 빼면 두 줄을 놓쳐 빨강(첫 판 기준 두 팔 — 「던」 빼기 · 「세계」 섞기 — 도 빨강이었다). (b) 뜻 묶기는 레인이 없다 — S35 는 «검출»을 주장하지 않는다.
21
+
22
+ > **2026-11-15 추가분의 출처 (발표 기술문서 개고, 운영자 통독 1회)**: 운영자가 원고 전체를 직접 읽고 줄 단위로 낸 교정(약 27건) 가운데, 다른 문서에도 옮겨 쓸 수 있는 꼴만 일반화해 올렸다. 원고의 문장 전체는 옮기지 않았다 — 아래 쌍은 교정 지점의 짧은 구절 · 짧은 문장 단위이고, 고유명사 · 회사 맥락은 들어 있지 않다. 근거 원장은 그 개고의 판 기록(내부 기록 — 배포본 독자에게는 도달하지 않는다).
23
+ >
24
+ > | 반영 자리 | origin | 쌍 수 | 쌍 |
25
+ > |---|---|---|---|
26
+ > | S11 단위 없는 번호 ① | O | 2 | 「(2.1)」→「(2.1절)」 · 「1.2에서 본 것처럼」→「1.2절에서 본 것처럼」 |
27
+ > | S11 단위를 나눠 쓰는 번호 묶음 ② | O | 1 | 「3·4장」→「3장, 4장」 |
28
+ > | S23 외국식 표현 | O | 3 | 「독립이 회복되지 않는다」→「독립성이 보장되지 않는다」(영문 인용 축자 번역) · 「가드의 거절이 옳았습니다」→「가드가 맞게 작동했습니다」 · 「남는 것이 건전할 때까지」→「새 결함이 더 나오지 않을 때까지」 |
29
+ > | S19 이웃 꼴(뉘앙스 어긋남) | O | 1 | 「지어낼 수는 없고」→「만들어 낼 수는 없고」 |
30
+ > | S16 자산 사이 대조 | O | 1 | 파생 장표는 「테스트」, 원고는 「검사」 — 되돌림 문맥만 「테스트」로, 게이트·훅·타입 검사의 「검사」는 유지 |
31
+ > | 후보 메모: 표 열의 형태 | O | 1 | 명사구 열의 한 행이 완결 문장 → 명사구 |
32
+ > | S8 후보 예 | 모델(교차 계열) | — | 「게이트가 멈췄다」(목적어 빠진 타동사가 자동사로 읽힘) |
33
+ > | 후보 메모: 동형어 | 모델(교차 계열) | — | 습니다체 끝의 「감사합니다」(audit / 고마움) |
34
+ > 🟥 **전부 운영자 통독 한 번에서 나왔다 — S11 의 쌍 3건, S23 의 3건은 독립 확인 세 번이 아니다.**
35
+ > 🟥 **자리 결정**: 「3·4장」은 S25(가운뎃점 밀도)가 아니라 S11 에 붙였다. S25 의 레인 `C17` 은 한 줄에 점 3개 이상을 세는데 이 꼴은 점이 하나이고, 운영자 처방(번호마다 단위를 붙여 쉼표로 풂)이 S11 ①과 같은 방향 — 번호마다 단위가 바로 보이게 하기 — 이기 때문이다. 다만 ①은 단위가 아예 없고 ②는 단위를 나눠 쓴다는 점이 달라, ②는 쌍 1건짜리 관찰로만 두었다. S25 행에는 «레인 밖, S11 에서 본다»는 표지만 달았다.
36
+ > 🟥 **레인은 짓지 않았다.** 「(2.1)」 꼴은 수식 번호·버전과 겹쳐 쌍 2건으로 정규식을 세우면 과차단이 된다. 재발이 쌓이면 «괄호 안 맨 절 번호» 후보 레인부터 올린다.
37
+ > 모델이 찾은 두 건(S8 예 · 동형어)은 교차 계열 검토(아래 §Step-5-crossfamily-ko)가 낸 지적이다. 운영자가 교정한 쌍이 아니므로 candidate 로만 두고, 이 파일의 유지 규칙대로 운영자 쌍이 생기기 전에는 클래스 근거로 세지 않는다.
38
+
7
39
  > **S30~S34 의 출처 (2026-11-12~13, 발표 기술문서 개고)**: 운영자가 원고 전체를 직접 읽고 낸 피드백 한 번(2026-11-12)과, 그 뒤 독립 독자 라운드(처음 읽는 독자 1 · 한국어 교열 1 · 수리 부분 재독 2)에서 나온 쌍이다. 근거 원장은 그 개고의 판별 이력(문서 frontmatter 의 판 기록과 개고 커밋 — 내부 기록이라 배포본 독자에게는 도달하지 않는다).
8
40
  > origin 은 **O(운영자 직접)** 만 이 표에 올렸다. 독립 독자가 낸 지적은 쌍마다 원문과 대조해 반영했지만, 그 자체로 새 클래스를 세우는 근거로 쓰지 않았다(독자 에이전트는 같은 계열 모델이라 R 로 세지 않는다).
9
41
  >
@@ -88,6 +120,34 @@ carry-forward 를 인용하는 문단 세 줄 아래에서, 위 자산을 **한
88
120
  > 게이트라 관측 방식이 다르다. 정확한 표현은 **「관측 방식이 다른 둘에서 같은 방향이 나왔다」**
89
121
  > 까지이고, `n=2` 는 센 표현이다(그 세션이 스스로 이 조건을 붙여 넘겼다).
90
122
 
123
+ ## §Step-5-crossfamily-ko
124
+
125
+ **잠정 관찰 — n=1 (검토 묶음 하나, 약 33 블록), 2026-11-15.** 운영자 교정을 반영한 변경 문단 묶음 하나를
126
+ 같은 내용 그대로 세 독자에게 보냈다: Gemini 3.8 Flash · Gemini 4 Hydrogen(`agy` 의 `gemini-4-hydrogen-high`) ·
127
+ Sonnet 초심자 콜드리드.
128
+
129
+ - **Gemini 3.8 Flash**: S 6건을 냈는데 원문 대조에서 대부분 거짓이었다(참·거짓 건수는 이 기록에 없다). 꼴은 과격식화 쪽이다 — 화제-설명
130
+ 구문(«이 검사는 결과가 …»)과 이중 주어 구문을 비문으로 판정했다. 둘 다 한국어의 정상 구문이다.
131
+ - **Gemini 4 Hydrogen**: 실제 오독 지점(독자가 다른 뜻으로 읽는 자리)을 찾았다(건수는 이 기록에 없다). 어느 모델이 위 §Step-2-provenance 의 모델 후보 두 건을 냈는지는 이 기록에서 가르지 않는다.
132
+ - **Sonnet 초심자 콜드리드**: 매번 새 A 를 냈다 — SKILL.md Step 5 의 «초심자 콜드리드는 A = 0 으로 수렴하지
133
+ 않는다» 항목의 근거다.
134
+
135
+ ⇒ 한국어 문장 검토에 교차 계열 모델을 고른다면 **Hydrogen 을 시험 삼아 병행해 본다** — 이 스킬은 기본 검토 모델을 정하지 않는다. 🟥 이건 묶음 하나의 관찰이지
136
+ 측정이 아니다 — 같은 묶음을 반복하지 않았고(reps=1), 정답지(심은 오답)가 없었다. Flash 의 «한국어 문법 지적»은
137
+ 비문 판정이 정상 구문을 향하는지부터 원문과 대조한다. 묶음이 더 쌓이면 이 절을 측정으로 바꾸거나 지운다.
138
+
139
+ ## §Step-5-seeded-pass
140
+
141
+ **관찰 — n=1 (원고 하나, 패턴 주입 통독 1회), 2026-11-16.** 같은 원고를 세 모델 검토자(초심자 콜드리드 ·
142
+ Gemini 3.8 Flash · Gemini 4 Hydrogen)가 읽었지만 «쓰다 · 세다 · 기계»의 뜻 흔들림은 셋 다 놓쳤고, 운영자가
143
+ 사람 통독에서 찾았다. 그 뒤 운영자 교정 쌍을 **낱말이 아니라 부류 7개**로 추상화한 짧은 지시문을 주고 Hydrogen 에게
144
+ 문서 전체를 한 번 읽혔더니 같은 꼴이 29곳 더 나왔다 — 남은 «쓰다» 활용형, 목적어 빠진 게이트 문장 넷, 정의보다 먼저
145
+ 나온 «기계», 표 칸 형태 불일치. (29곳의 참·거짓 대조 결과는 이 기록에 없다.)
146
+
147
+ ⇒ SKILL.md Step 5 의 «부류로 추상화해 한 번 더 훑기» 항목의 근거다. 🟥 이건 한 원고 · 한 실행의 관찰이다 —
148
+ 같은 지시문을 다른 원고에 돌려 본 적이 없고, 부류 없이 같은 모델에게 «전체를 다시 읽어라»만 준 대조 팔도 없다.
149
+ 그래서 «부류 주입이 효과를 냈다»가 아니라 «부류를 주고 읽혔더니 운영자 자리 밖에서 같은 꼴이 더 나왔다»까지만 말한다.
150
+
91
151
  ## §Step-5s-provenance
92
152
 
93
153
  > **출처와 그 한계 (읽고 인용해라)**: 이 절의 축은 2026-08-09 낭독 렌즈 필드런의 **교정판**
@@ -0,0 +1,30 @@
1
+ <!-- S35 낱말 뜻 흔들림 — 늘어놓기(a) known-negative. 대상 낱말과 앞 글자가 겹치는 다른 낱말만 담았다 — 한 건도 잡히면 안 된다. -->
2
+ <!-- 🟥 표면이 같은 동형어(재고 = 재다+고 / 재고 = 재고품, 셀 = 세다 / 셀 = cell, 쓴 = 쓰다 / 쓴맛)는 여기 넣지 않았다 — 표면으로 못 가르고, 가르는 것은 (b) 판단 단계다. -->
3
+
4
+ 쓰레기 파일을 정리했다.
5
+ 쓰나미 경보 시스템을 예로 든다.
6
+ 써클 모양 아이콘을 넣었다.
7
+ 써드파티 라이브러리를 검토했다.
8
+ 써머리 섹션을 앞으로 옮겼다.
9
+ 세계 여러 팀이 같은 방식을 택했다.
10
+ 세션이 끊기면 다시 연결한다.
11
+ 세부 항목은 부록에 둔다.
12
+ 센터에서 받은 자료다.
13
+ 센서 값이 튀었다.
14
+ 셀프 리뷰는 짝 리뷰를 대신하지 못한다.
15
+ 세면대 사진은 빠졌다.
16
+ 재료 목록을 정리했다.
17
+ 재현 절차를 적었다.
18
+ 재시작 뒤에 다시 확인한다.
19
+ 재지정된 경로를 확인했다.
20
+ 재보험 사례는 다루지 않는다.
21
+ 재면접 일정이 잡혔다.
22
+ 글쓰기 교재를 참고했다.
23
+ 공작기계 제조사 사례다.
24
+ 세다리 의자 사진은 뺐다.
25
+ 서버가 쓰러진 사례다.
26
+ 쓰라린 실패에서 배웠다.
27
+ 고양이를 쓰다듬는 사진이다.
28
+ 잽싸게 되돌렸다.
29
+ 재도전 일정을 잡았다.
30
+ 재지급 절차는 다루지 않는다.
@@ -0,0 +1,56 @@
1
+ <!-- S35 낱말 뜻 흔들림 — 늘어놓기(a) known-positive. 줄마다 활용형 하나 · 기대 낱말은 줄 끝 주석에. -->
2
+ <!-- 문장은 만든 일반 예문이다(어느 원고의 문장도 아니다). 뜻은 일부러 섞었다 — 이 레인은 뜻을 가르지 않고 «빠짐없이 늘어놓는가»만 잰다. -->
3
+
4
+ 설계 문서를 쓰다 보면 용어가 흔들린다. <!-- 쓰다 -->
5
+ 이 스크립트는 캐시를 쓴다. <!-- 쓰다 -->
6
+ 보고서를 쓰는 사람이 따로 있다. <!-- 쓰다 -->
7
+ 예전에 쓰던 도구를 그대로 둔다. <!-- 쓰다 -->
8
+ 이 옵션을 쓰면 속도가 빨라진다. <!-- 쓰다 -->
9
+ 초안을 쓰고 나서 검토를 받는다. <!-- 쓰다 -->
10
+ 기본값을 쓰되 경로만 바꾼다. <!-- 쓰다 -->
11
+ 같은 설정을 써서 다시 돌린다. <!-- 쓰다 -->
12
+ 지난주에 결과 요약을 썼다. <!-- 쓰다 -->
13
+ 저희는 이 방식을 씁니다. <!-- 쓰다 -->
14
+ 그 함수는 쓸 수 없다. <!-- 쓰다 -->
15
+ 이 값은 쓰지 않는다. <!-- 쓰다 -->
16
+ 문서 쓰기가 늦어졌다. <!-- 쓰다 -->
17
+ 건수를 세다 보니 하나가 빠졌다. <!-- 세다 -->
18
+ 실패한 줄을 센다. <!-- 세다 -->
19
+ 경고를 세는 스크립트가 있다. <!-- 세다 -->
20
+ 통과로 세지 않았다. <!-- 세다 -->
21
+ 줄을 세어 보니 열둘이었다. <!-- 세다 -->
22
+ 건수를 세고 나서 표에 적었다. <!-- 세다 -->
23
+ 중복을 세면 숫자가 부푼다. <!-- 세다 -->
24
+ 어제 다시 셌다. <!-- 세다 -->
25
+ 항목을 셉니다. <!-- 세다 -->
26
+ 몇 번인지 셀 수 없다. <!-- 세다 -->
27
+ 응답 시간을 재다 보면 편차가 크다. <!-- 재다 -->
28
+ 지연을 잰다. <!-- 재다 -->
29
+ 메모리를 재는 도구를 붙였다. <!-- 재다 -->
30
+ 속도를 재어 기록했다. <!-- 재다 -->
31
+ 크기를 재고 나서 비교했다. <!-- 재다 -->
32
+ 같은 조건에서 재면 값이 같다. <!-- 재다 -->
33
+ 어제 다시 쟀다. <!-- 재다 -->
34
+ 처리량을 잽니다. <!-- 재다 -->
35
+ 아직 재지 않았다. <!-- 재다 -->
36
+ 그 길이는 잴 수 없다. <!-- 재다 -->
37
+ 기계가 판정을 내린다. <!-- 기계 -->
38
+ 이 단계는 기계적으로 처리한다. <!-- 기계 -->
39
+ 이 함수는 여러 곳에서 쓰인다. <!-- 쓰다 -->
40
+ 그 값은 기본값으로 쓰입니다. <!-- 쓰다 -->
41
+ 캐시를 쓰거나 끄거나 둘 중 하나다. <!-- 쓰다 -->
42
+ 고객이 직접 쓰신 후기다. <!-- 쓰다 -->
43
+ 이 변수는 나중에 쓰일 예정이다. <!-- 쓰다 -->
44
+ 다시 세야 한다. <!-- 세다 -->
45
+ 몇 개인지 셀까 고민했다. <!-- 세다 -->
46
+ 줄을 세거나 건너뛴다. <!-- 세다 -->
47
+ 한 번 세봤다. <!-- 세다 -->
48
+ 같은 조건에서 다시 재야 한다. <!-- 재다 -->
49
+ 시간을 재거나 기록만 남긴다. <!-- 재다 -->
50
+ 그 값은 예전에 기본값으로 쓰였다. <!-- 쓰다 -->
51
+ 이 옵션은 끄고 쓰도 된다. <!-- 쓰다 -->
52
+ 초안 작성 후 검토 요청 씀. <!-- 쓰다 -->
53
+ 나중에 다시 셀 것이다. <!-- 세다 -->
54
+ 대충 세도 된다. <!-- 세다 -->
55
+ 같은 방식으로 재도 된다. <!-- 재다 -->
56
+ 지연은 이렇게 재죠. <!-- 재다 -->
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-meta",
3
- "version": "3.43.0",
3
+ "version": "3.44.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -2,6 +2,29 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### [3.44.0] — 2026-11-17
6
+
7
+ Minor by the version policy: new shipped guards and a remote runner for the cross-family sidecars (#1123, #1125, #1127), a new `--senses` listing and lane in `ko-tech-writer` (#1128), and judged procedure changes in shipped skills and canon. One change makes an existing path refuse more by default — FH scripts now start `agy` only through `agy_launch_guard.sh`, so a gemini fleet member you ran on purpose fails as refused until it runs isolated; see the `BREAKING (gate):` entry for the remedy (#1123). The same change makes `finding_fleet.sh` stop with exit 1 before any member runs when it cannot create or prove its agy shim (for example a read-only or noexec `/tmp`), so a codex-only fleet on such a machine stops too (#1123). Two other refusals are new and narrower: a codex arm is refused when its prompt, arguments or working folder name a configured company-repo root (#1127), and `sidecar_wait.sh` now reports a sidecar that rejected its model as `HARNESS-ERROR` instead of `COMPLETE` (#1127). The live-eval report can now exit 2 (`INVALID-COMPARISON`) when its arms loaded different plugin sets — a report verdict, not a commit or publish gate (#1121). This repository's own required `validate` check now proves every selfcheck shard passed without the GitHub API (#1130) — repository CI only, nothing shipped changes.
8
+ ### Added
9
+ - `scripts/codex_launch_guard.sh` (shipped): FH's codex verifier arms (`finding_fleet.sh` codex rows — including rows that call `codex` by name, through a shim first on `PATH` — `finding_verifier.sh --family codex`, the `sidecar_calibrate.sh` probe) start codex only through it. It refuses (exit 3, `HARNESS-ERROR: CODEX-REFUSED`, codex not started) when the prompt on stdin, an argument or the working folder names a root in the operator's company-repo list (`FH_COMPANY_ROOTS`, or the gitignored `.claude/rules/.company-roots`); otherwise codex runs with the prompt byte-for-byte and its own exit code. With no list configured it runs and prints «CODEX-GUARD: no company roots configured — not checked». A list that exists but cannot be read, an unreadable prompt or a failed matcher also refuses (exit 3). `.gitignore` now lists `.claude/rules/.company-roots`. It is a string check on paths (as given, real path, without `/private`, with `~`), not isolation. Not covered: a custom fleet row that calls codex by absolute path or resets `PATH` (it skips the shim), and the runtime adapters `fh-run.sh` · `fh-goal.sh` · `fh-gate.sh`, where codex is the user's own agent. `sidecar_wait.sh` reports a guard refusal as `HARNESS-ERROR reason=guard-refused`. Lanes `scripts/test_codex_launch_guard_lanes.sh` (shipped). (#1127)
10
+ - `scripts/agy_remote_run.sh` (shipped): the route FH ships for agy (the `container` / `os-user` markers remain for an isolated environment you built, unchecked by the guard) — it runs agy only as a separate OS user on another machine over ssh (frozen inputs copied in, output and requested files copied back, only its own `fh_agy_<stamp>_<hex>` work folder removed) and never starts a local agy. `--canary` (no agy) measures that the remote user cannot read the `FH_AGY_REMOTE_DENY` paths and writes a local receipt; runs are refused (exit 3) without a PASS receipt under 7 days old for the same settings, and a route that is down exits 4. `agy_launch_guard.sh` honours the new `FH_AGY_ISOLATION=remote-os-user` only when the target is this runner. Host, account and paths come from the environment only. Lanes `scripts/test_agy_remote_run_lanes.sh` (shipped) use a fake ssh/scp; the PowerShell side is not exercised by the lanes. (#1125)
11
+ - BREAKING (gate): `scripts/agy_launch_guard.sh` (shipped). FH scripts now start `agy` only through it, and it refuses (exit 3, `AGY-REFUSED` on stderr) unless `FH_AGY_ISOLATION` is exactly `container` or `os-user`. Covered callers: `finding_fleet.sh` (the default gemini row, custom rows that write `AGY_BIN`, and custom rows that call `agy` by name — through a shim put first on `PATH`; both rounds), `finding_verifier.sh --family gemini`, and `sidecar_calibrate.sh` (which now prints a `REFUSED` row instead of reading the refusal as an answer). Why: agy runs its own shell and file tools even in `--mode plan` and sends what they print to the cloud model; on 2026-11-16 a review run searched the whole machine, read its own answer key and sent file names from another repository on that machine. If you ran a gemini member on purpose, it now fails as a refused member until you run it inside a container or a separate OS user (or as a remote OS user through `scripts/agy_remote_run.sh`, `FH_AGY_ISOLATION=remote-os-user`, #1125) and set the marker there. `--sandbox` does not count: a canary test the same day showed `agy --mode plan --sandbox` reading files outside its cwd and in the home directory. The marker is self-declared: the guard checks that you said it, not that it is true — set it only where a canary check confirmed the isolation. Not covered: a fleet row that calls agy by absolute path or resets `PATH`. `auto-decorrelation` §Step 2 states the rule; lanes `scripts/test_agy_launch_guard_lanes.sh` (shipped). (#1123)
12
+ - `ko-tech-writer` S35, word-sense drift, as a procedure rather than a word list (shipped: `SKILL.md`, `SKILL_detail.md`, `fixtures/sense_positive.md`, `fixtures/sense_negative.md`, `scripts/ko_tech_writer_calibrate.py`). `ko_tech_writer_calibrate.py --senses FILE` lists occurrences of 쓰다/세다/재다/기계 (enumerated endings; compounds are not matched) with their context; a person or model then groups them by sense and flags the minority sense, and a coverage line says that 0 hits is not «none». New lane C22 checks the listing on a constructed inflection fixture and 0 hits on 27 lines of collision words; the sense grouping itself has no lane and stays a judgment. The same change adds a draft-time term table (Step 1), reading cited papers from the abstract (Step 4) and a provisional seeded whole-document pass after a correction round (Step 5) (#1128)
13
+ ### Changed
14
+ - `sidecar_wait.sh`: a sidecar CLI that refuses the requested model now gets `SIDECAR_VERDICT=HARNESS-ERROR exit=<n> reason=model-not-available` and exit 3, instead of `COMPLETE` — which read as «the reviewer answered and found nothing». Measured 2026-11-16: codex `-m gpt-5.5` and `-m gpt-5` return HTTP 400 «not supported when using Codex with a ChatGPT account» (rc 1). Documented examples (`sidecar_wait.sh` usage, `auto-decorrelation`, `sim-conductor`) no longer pin those models; they use the CLI default. `auto-decorrelation` records that codex's `--sandbox read-only` limits writes, not reads (canary files in cwd, another temp folder and the home directory were all read), so codex arms get public diffs only. Lane `test_sidecar_wait_stdin.sh` P10/P10b. (#1127)
15
+ - live-eval: the init plugin list (each plugin's source and version, never its path) is now part of the surface that `INVALID-COMPARISON` compares, next to the tool and MCP lists. Arms that loaded different plugins, or the same plugin at different versions, or one arm whose init has no plugin list, make the probe `INVALID-COMPARISON` with no pass rate and the run exits 2. Arms with the same plugins score as before. Why: the 2026-11-15 nightly had two probes where one rep loaded one more built-in plugin than the rest, with tools and MCP equal, and the report counted one surface. The plugins are still loaded from the operator's HOME; pinning them is not in this change. Lanes TR14–TR18 in `scripts/test_live_eval_trace_lanes.sh` (shipped). (#1121)
16
+ - `ko-tech-writer` S11/S16/S19/S23 carry the 2026-11-15 operator full-read pairs (shipped). S11 gives bare section numbers a unit and splits shared-unit number pairs; S16 adds a cross-asset term check that splits by meaning and never bulk-replaces; S19/S23 gain four pairs; Step 5 adds context-only neighbour blocks and a provisional beginner cold-read stop rule. No lane or script changed (#1120)
17
+ - `governance_engineering_definition.md` (shipped): the supervising placement is one root window over work sessions that each do one task in sequence. Provisional and proposal-only: when a multi-day task piles up in a session with other tasks, the governor proposes in one line moving it to a re-enterable work session; coupled work is not split (#1117)
18
+ ### Fixed
19
+ - `scripts/prepush_guard_check.sh` (shipped): when a known pair breaks, the closing `❌ BLOCKED` line now names every broken pair with its exit code and elapsed seconds (`… 5 known pair(s) broke after 10s: <pair> (rc=0, 1s); …`), and every pair line carries an `[Ns]` stamp. `selfcheck.sh` shows a failing check through its ❌-line extractor instead of the last 12 lines, with the check's total elapsed time. Why: a downstream consumer got `BLOCKED — a known pair broke` from a long selfcheck under heavy load with the pair cut off above the 12-line tail, so nobody could tell which pair broke or whether it timed out. The cause of that failure is still unmeasured; pass/fail verdicts do not change. Lane `scripts/test_prepush_guard_failure_visibility_lanes.sh` (shipped) plants a broken pair and checks the names survive the tail. (#1129)
20
+ - `session_checklist.py extract --out` (shipped) no longer drops the parts of an existing sheet that the table parser does not consume — a result section below the table, a preface, prose in between, fenced code and hand-written notes are kept in order under «이전 결과서의 표 밖 내용», so a re-run over its own output is byte-identical. An orphan row whose first cell is `-` was read as a separator and lost on the second re-extract; it now survives. Lanes L55–L58 and KR1 in `scripts/test_session_checklist_lanes.sh` (shipped) (#1108)
21
+ - `scripts/test_preprep_speech_coach_lanes.sh` (shipped): the `ffmpeg`-absent probe first resolves the real interpreter (`sys.executable` under the normal PATH), then runs it under the empty PATH. A downstream consumer saw it die with rc 127 where `python3` is a bash shim (pyenv), so the code under test was never reached. An unresolved interpreter now exits 10 (a setup error, not a pass), and a new control shows the shim case both ways (#1126)
22
+ - `.github/workflows/validate.yml` (not in the npm package): the required `validate` check no longer calls the GitHub API to prove every selfcheck shard passed. Each shard's last step writes its own job output `leg_<i>=passed:<i>/<N>`, and the check reads only `needs.selfcheck.result` and `needs.selfcheck.outputs`; a missing, extra, empty or mislabelled key, unreadable outputs, or a result other than `success` is red. The `validate` job no longer needs `actions: read` or a token. Why: a downstream consumer on GitHub Enterprise got HTTP 401 from the jobs listing with the job token although every shard had passed, so the required check could never go green; no «API failed → pass» fallback was added. `scripts/test_ci_validate_shard_count_lanes.sh` (not in the npm package) runs the step against fixtures built for the workflow's own shard count and reads the workflow as YAML to check the wiring (22 lanes; it needs PyYAML, which CI installs) (#1130)
23
+
24
+ ### Docs
25
+ - `knowledge/shared/plugin-catalog/recommended_plugins.md` (shipped) category 0.5 is re-enumerated from the live `claude-plugins-official` directory: 43 plugins (7 new, none removed), replacing a 36-plugin snapshot. Each row gains the plugin's own description and an «already covered / FH overlap» column, plus two notes: every enabled plugin also loads into headless `claude -p` runs (live-eval reports differing sets as `INVALID-COMPARISON`, #1121), so enable plugins only where clearly used; and the LSP plugins need their language server installed separately (#1122)
26
+ - `docs/USER_GUIDE.md` §4 (shipped) opens with a table comparing one Claude Code session working in sequence, one session plus subagents or worktrees, and FH, quoting two Anthropic lines with their source. It adds how work sessions stack under a supervising governor, how to ask for a close-time sweep, and an opt-in lease block for reversible maintenance on your own machine (no FH rule reads it). `AGENTS.md` points to it (#1116)
27
+
5
28
  ### [3.43.0] — 2026-11-15
6
29
 
7
30
  Minor by the version policy: a new shipped tool and lane for live-eval (#1099), a new shipped lane for `meta-prompt-builder` (#1103), and new judged procedures in shipped skills and rules. Nothing here makes an existing commit or publish gate refuse more by default, so no `BREAKING (gate)` line applies. Two checks are stricter, and neither is a consumer gate: the live-eval report can now exit 2 with `INVALID-COMPARISON` (#1099), and the checkout-only fixture-guard ratchet counts more git calls (#1097). The one new refusal path in a shipped gate script is opt-in: `remote_marker_gate.sh` reads PR bodies over the API only when `RMG_PR_LOOKUP=1` is set, and a failed lookup then exits 10 (#1105). If you run the 3.42.0 package's `test_fixture_guard_coverage_lanes.sh` directly, it no longer fails on the checkout floor (#1097). Items marked «not in the npm package» are in the repository checkout only.
@@ -50,6 +50,38 @@ single-session even when sidecars are available.
50
50
 
51
51
  ## Step 2 — Sidecar discovery (mechanical, the anti-power-waste core)
52
52
 
53
+ 🟥 **A cloud agent CLI with tools enabled must not run on a machine where company repositories are
54
+ readable.** That covers `agy` in every mode (`--mode plan` included) and any similar CLI that runs its
55
+ own shell or file tools: what those tools print goes to the cloud model. Measured 2026-11-16: given an
56
+ empty temp directory as cwd, `agy -p --mode plan` searched the whole filesystem and the home directory,
57
+ read the run's answer key in 45 of 83 conversations, and sent file names from a company repository on
58
+ the same machine to the model. **Allowed instead**: a tool-less API call (prompt and excerpt only, no
59
+ tools offered), or the CLI inside a container or a separate OS user that can see only the frozen inputs.
60
+ **`--sandbox` is not isolation**: measured 2026-11-16 with canary files, `agy -p --mode plan --sandbox`
61
+ read files it was pointed at in its cwd, in another temp folder and in the home directory. FH's scripts
62
+ start agy only through `scripts/agy_launch_guard.sh`, which refuses (exit 3, `AGY-REFUSED`) unless
63
+ `FH_AGY_ISOLATION=container` or `FH_AGY_ISOLATION=os-user`. The marker is self-declared — the guard checks
64
+ that you said it, not that it is true — so set it only inside a container or OS user where a canary check
65
+ has confirmed it (canary files outside the frozen inputs, agy asked to read those exact paths, every read
66
+ fails). Being
67
+ discovered below makes agy a *candidate*, not a recruit: on the host, without the marker, it is not
68
+ recruitable. Lanes: `scripts/test_agy_launch_guard_lanes.sh`.
69
+
70
+ **The route FH ships for agy: a separate OS user on another machine** — `scripts/agy_remote_run.sh` (the `container` / `os-user` markers remain for an isolated environment you built yourself, and the guard cannot check those).
71
+ Set `FH_AGY_BIN=<repo>/scripts/agy_remote_run.sh` and `FH_AGY_ISOLATION=remote-os-user` (the guard honours
72
+ that value only for this runner). Configuration is environment-only (`FH_AGY_REMOTE` = ssh target,
73
+ `FH_AGY_REMOTE_DENY` = `;`-separated paths that user must not read). First run
74
+ `agy_remote_run.sh --canary` — no agy, a plain remote shell tries every deny path (all must be refused)
75
+ and a positive file (must be readable) and writes a local receipt. Runs are refused without a PASS
76
+ receipt under 7 days old for the same settings, and a route that is down is a refusal (exit 4), never a
77
+ local agy. The receipt is the record of that measurement, not proof of isolation. **Name what the remote
78
+ user can still read**: on the operator's machine measured 2026-11-16, the remote user cannot read the
79
+ admin profile, the shared Public folder, the admin WSL home or the two data-drive roots, but still lists
80
+ or opens 8 sub-items the operator accepted — game folders, the two recycle bins, an antivirus decoy
81
+ folder and three device-information files — because those carry their own explicit allow entries that an
82
+ inherited deny does not override. Lanes: `scripts/test_agy_remote_run_lanes.sh` (fake ssh/scp; the
83
+ PowerShell side was run for real once).
84
+
53
85
  Build the available panel at run time; absent tools **and unreachable endpoints** drop off silently:
54
86
  ```bash
55
87
  # Sidecar-callable CLIs only. **Scope discipline**: the probe list is NOT "every agent CLI that exists".
@@ -154,11 +186,23 @@ diversity vs the orchestrator** (orchestrator = Claude/opus → recruit GPT or G
154
186
  > does not exist until the process has exited.
155
187
 
156
188
  ```bash
157
- printf '%s' "$prompt" | bash scripts/sidecar_wait.sh out.txt 900 -- codex exec -m gpt-5.5 -
189
+ printf '%s' "$prompt" | bash scripts/sidecar_wait.sh out.txt 900 -- bash scripts/codex_launch_guard.sh codex exec -
158
190
  # → SIDECAR_VERDICT=COMPLETE exit=0 bytes=48489 (read out.txt)
159
191
  # → SIDECAR_VERDICT=TIMEOUT waited=900s bytes=0 (still alive — NOT a result)
160
192
  # → SIDECAR_VERDICT=EMPTY exit=0 (the only state that means "it said nothing")
193
+ # → SIDECAR_VERDICT=HARNESS-ERROR exit=1 reason=model-not-available (exit 3 — nothing was reviewed)
161
194
  ```
195
+ No `-m` pin by default: the CLI default answers, while a pinned model can be retired under you —
196
+ on 2026-11-16 `-m gpt-5.5` and `-m gpt-5` returned HTTP 400 «not supported when using Codex with a
197
+ ChatGPT account» (rc 1). Pin only a model `sidecar_calibrate.sh` has just shown answering.
198
+ 🟥 **Send codex only public diffs.** Its `--sandbox read-only` limits writes, not reads: measured
199
+ 2026-11-16 with canary files, it read paths in its cwd, in another temp folder and in the home
200
+ directory. A codex arm on a machine that holds company checkouts must never be given company
201
+ material, and the sandbox flag is not a reason to relax that. FH starts codex verifier arms through
202
+ `scripts/codex_launch_guard.sh`, which refuses (exit 3, `HARNESS-ERROR: CODEX-REFUSED`) when the prompt, an
203
+ argument or the working folder names a root in the operator's company-repo list (`FH_COMPANY_ROOTS` or the
204
+ gitignored `.claude/rules/.company-roots`); with no list it runs and says «not checked». It is a string check
205
+ on paths, not isolation: a relative path or pasted file content without its path is not seen.
162
206
 
163
207
  The runner **refuses to emit a verdict while the process is alive**, so "the sidecar returned
164
208
  nothing" becomes unsayable until it has actually exited. Grep the typed `SIDECAR_VERDICT=` line;
@@ -173,14 +173,14 @@ Run multi-team? (a) Full panel (b) Claude sub-agents only (c) Skip to Area B
173
173
  | T1 Gemini | `gemini` pipe | beginner · main-player · challenger | `echo PROMPT \| gemini` |
174
174
  | T2 Copilot | `gh copilot suggest` | challenger · expert | `gh copilot suggest -t shell` |
175
175
  | T3 Ollama | `ollama run` | challenger | `ollama run llama3 PROMPT` |
176
- | T4 Codex | `npx @openai/codex exec` | challenger · edge-case-hunter | `echo PROMPT \| npx @openai/codex exec -m gpt-5 -` |
176
+ | T4 Codex | `npx @openai/codex exec` | challenger · edge-case-hunter | `echo PROMPT \| npx @openai/codex exec -` (no `-m`: `gpt-5` returns HTTP 400 as of 2026-11-16) |
177
177
 
178
178
  > **사이드카 대기는 기계로 한다** — `scripts/sidecar_wait.sh` 경유가 필수 형식이고, 타입 verdict
179
- > (`COMPLETE`/`TIMEOUT`/`EMPTY`)만 읽는다. **`EMPTY` 만이 "사이드카가 아무 말 안 했다"** 이다.
179
+ > (`COMPLETE`/`TIMEOUT`/`EMPTY`/`HARNESS-ERROR`)만 읽는다. `HARNESS-ERROR` = CLI 가 모델을 거절했다(아무것도 검토 안 됨). **`EMPTY` 만이 "사이드카가 아무 말 안 했다"** 이다.
180
180
  > 출력 파일을 눈으로 보고 판정하지 마라 — 살아있는 프로세스와 죽은 프로세스가 같은 0바이트를
181
181
  > 낸다(2026-07-29 실측: 1초/30초 만에 읽고 정상 동작 중인 사이드카 2종을 '실패'로 기록,
182
182
  > 실제로는 4건의 진짜 finding 이 나왔다). 정본 = `auto-decorrelation` SKILL.md §S-1b.
183
- | T5 agy | `agy -p` (gemini successor) | challenger · beginner | `agy -p "PROMPT"` — argument form only (stdin pipe prints help); timebox+retry hard rule (intermittent hang class); -p auto-approves tools → trusted artifacts only |
183
+ | T5 agy | `agy -p` (gemini successor) | challenger · beginner | `agy -p "PROMPT"` — argument form only (stdin pipe prints help); timebox+retry hard rule (intermittent hang class); -p auto-approves tools → trusted artifacts only; start it only through `scripts/agy_launch_guard.sh` (refuses unless `FH_AGY_ISOLATION=container\|os-user` — never on a host where company repos are readable, auto-decorrelation §Step 2) |
184
184
 
185
185
  ### CLI detection bash
186
186
 
@@ -300,7 +300,7 @@ Default team-persona assignments:
300
300
  | **T4 Codex** | `npx @openai/codex exec` | devil · edge-case-hunter |
301
301
 
302
302
  > **사이드카 대기는 기계로 한다** — `scripts/sidecar_wait.sh` 경유가 필수 형식이고, 타입 verdict
303
- > (`COMPLETE`/`TIMEOUT`/`EMPTY`)만 읽는다. **`EMPTY` 만이 "사이드카가 아무 말 안 했다"** 이다.
303
+ > (`COMPLETE`/`TIMEOUT`/`EMPTY`/`HARNESS-ERROR`)만 읽는다. `HARNESS-ERROR` = CLI 가 모델을 거절했다(아무것도 검토 안 됨). **`EMPTY` 만이 "사이드카가 아무 말 안 했다"** 이다.
304
304
  > 출력 파일을 눈으로 보고 판정하지 마라 — 살아있는 프로세스와 죽은 프로세스가 같은 0바이트를
305
305
  > 낸다(2026-07-29 실측: 1초/30초 만에 읽고 정상 동작 중인 사이드카 2종을 '실패'로 기록,
306
306
  > 실제로는 4건의 진짜 finding 이 나왔다). 정본 = `auto-decorrelation` SKILL.md §S-1b.
@@ -363,7 +363,10 @@ fi
363
363
  # ── T5: agy (Antigravity) — gemini successor ──────────────
364
364
  # Constraints: argument form only (`agy -p "PROMPT"`); timebox+retry is a hard rule
365
365
  # (intermittent hang class, ~50% observed 2026-06-11); -p auto-approves tool execution,
366
- # so feed only trusted artifacts — never untrusted external content. Serial by design
366
+ # so feed only trusted artifacts — never untrusted external content. 🟥 Its tools also READ the
367
+ # machine and send what they print to the cloud model: start it only through
368
+ # scripts/agy_launch_guard.sh, which refuses unless FH_AGY_ISOLATION=container|os-user — never on a
369
+ # host where company repositories are readable (auto-decorrelation §Step 2). Serial by design
367
370
  # (worst case ~6 min if the hang class fires on every call) — do NOT copy the T1-T4
368
371
  # `VAR=$(...) &` pattern: it assigns inside a background subshell.
369
372
  if [[ " ${TEAMS[*]} " =~ " agy " ]]; then
@@ -372,8 +375,9 @@ if [[ " ${TEAMS[*]} " =~ " agy " ]]; then
372
375
  # pipe can outlive it (same gap as `timeout` without process-group kill).
373
376
  tb() { perl -e 'alarm shift; exec @ARGV' "$@"; }
374
377
  agy_call() { # $1=prompt — 60s timebox, 1 retry on empty
375
- local out; out=$(tb 60 agy -p "$1" 2>/dev/null)
376
- [ -z "$out" ] && out=$(tb 60 agy -p "$1" 2>/dev/null)
378
+ local g="${FH_DIR:-.}/scripts/agy_launch_guard.sh" out
379
+ out=$(tb 60 bash "$g" agy -p "$1" 2>/dev/null)
380
+ [ -z "$out" ] && out=$(tb 60 bash "$g" agy -p "$1" 2>/dev/null)
377
381
  printf '%s' "$out"
378
382
  }
379
383
  A_DEVIL=$(agy_call "[Devil] Adversarial reviewer, no prior context.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-preprep",
3
- "version": "3.43.0",
3
+ "version": "3.44.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fh-qp",
3
- "version": "3.43.0",
3
+ "version": "3.44.0",
4
4
  "engines": {
5
5
  "claudeCode": ">=1.0.0"
6
6
  },
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env bash
2
+ # agy_launch_guard.sh — every FH launch of agy (the Antigravity CLI) goes through here.
3
+ #
4
+ # WHY. agy runs its own tools (shell commands, file reads) even in `--mode plan`, and what those tools
5
+ # print goes into the conversation the cloud model reads. Measured 2026-11-16 on a review run with an
6
+ # empty temp directory as cwd: agy ran a filesystem-wide `find` and a recursive `grep` over the home
7
+ # directory, read the run's answer key in 45 of 83 conversations, and the search output carried file
8
+ # names from a company repository checked out on the same machine. Claude-side deny rules do not bind
9
+ # agy. 🟥 `--sandbox` is NOT isolation: measured 2026-11-16 (canary test), `agy -p --mode plan --sandbox`
10
+ # from a fresh temp cwd read three canary files it was pointed at — one in cwd, one in another temp
11
+ # folder, one in the home directory. It restricts the terminal at most; file reads go through.
12
+ #
13
+ # RULE. A cloud agent CLI with tools enabled must not run on a machine where company repositories are
14
+ # readable. Allowed instead: a tool-less API call (that does not use agy, so it does not come here), or
15
+ # agy inside a container or a separate OS user that can see only the frozen inputs of the task.
16
+ #
17
+ # MARKER. FH_AGY_ISOLATION=container or FH_AGY_ISOLATION=os-user, or FH_AGY_ISOLATION=remote-os-user
18
+ # (honoured only when the target is scripts/agy_remote_run.sh beside this guard). Unset, empty, or any other value
19
+ # (including 1 / yes / true) is refused. 🟥 The marker is self-declared: this script checks that you
20
+ # said it, not that it is true — it cannot see a container or an OS user. Set it only inside a container
21
+ # or OS user where a canary check has confirmed it: place a canary file outside the frozen inputs (in
22
+ # the host home directory and in another temp folder), ask agy to read those exact paths, and set the
23
+ # marker only if every read fails. Never on the host that holds company repositories, and never because
24
+ # of `--sandbox`.
25
+ #
26
+ # Usage: bash scripts/agy_launch_guard.sh <agy-binary> [agy arguments...]
27
+ # Exit: 3 = refused, agy was not started · 2 = usage · otherwise agy's own exit code
28
+ set -uo pipefail
29
+ [ $# -ge 1 ] || { echo "usage: agy_launch_guard.sh <agy-binary> [agy arguments...]" >&2; exit 2; }
30
+ case "${FH_AGY_ISOLATION-}" in
31
+ container|os-user) exec "$@" ;;
32
+ remote-os-user)
33
+ # Honoured for ONE route only: the target must be FH's remote runner beside this guard, which runs
34
+ # agy as a separate OS user on another machine and itself refuses without a fresh canary receipt.
35
+ _here="$(cd "$(dirname "$0")" && pwd -P)"
36
+ _tgt_dir="$(cd "$(dirname "$1")" 2>/dev/null && pwd -P)"
37
+ if [ "$_tgt_dir/$(basename "$1")" = "$_here/agy_remote_run.sh" ] && [ -f "$_here/agy_remote_run.sh" ]; then
38
+ exec bash "$_here/agy_remote_run.sh" "${@:2}"
39
+ fi
40
+ echo "AGY-REFUSED: FH_AGY_ISOLATION=remote-os-user is honoured only when the target is $_here/agy_remote_run.sh (got: $1)." >&2
41
+ exit 3 ;;
42
+ esac
43
+ {
44
+ echo "AGY-REFUSED: agy was not started (FH_AGY_ISOLATION=${FH_AGY_ISOLATION-<unset>})."
45
+ echo " agy runs shell and file tools and sends their output to a cloud model, so it must not run where"
46
+ echo " company repositories are readable. Run it in a container or a separate OS user that sees only the"
47
+ echo " frozen inputs, then set FH_AGY_ISOLATION=container|os-user there — or use a tool-less API call."
48
+ } >&2
49
+ exit 3
@@ -0,0 +1,187 @@
1
+ #!/usr/bin/env bash
2
+ # agy_remote_run.sh — an agy stand-in that runs agy ONLY as a separate OS user on another machine.
3
+ #
4
+ # WHY. agy runs its own shell and file tools and sends what they print to the cloud model, so it must
5
+ # not run where company repositories are readable (scripts/agy_launch_guard.sh). This runner never
6
+ # starts agy locally: it copies the prompt and the frozen inputs into a fresh work folder in the remote
7
+ # user's home, runs agy there, streams its output back, copies requested files back, and removes only
8
+ # that work folder. If the route is not available it REFUSES — it never falls back to a local agy.
9
+ #
10
+ # REMOTE. A Windows machine reached by OpenSSH, logged in as a non-admin user whose profile cannot read
11
+ # the other profiles (measure that with --canary; do not assume it). agy installed for that user
12
+ # (default %LOCALAPPDATA%\agy\bin\agy.exe). Configuration comes only from the environment — this public
13
+ # file names no host, account or path:
14
+ # FH_AGY_REMOTE ssh target, e.g. user@host (required)
15
+ # FH_AGY_REMOTE_DENY ;-separated remote paths the user must NOT read (required for --canary); only an
16
+ # access-denied error counts, unless the entry starts with ? (then not-found is accepted too)
17
+ # FH_AGY_REMOTE_AGY remote agy path (default: %LOCALAPPDATA%\agy\bin\agy.exe)
18
+ # FH_AGY_REMOTE_RECEIPT_DIR local receipt folder (default: $HOME/.cache/fh-agy-remote — outside any repo)
19
+ #
20
+ # CANARY. `agy_remote_run.sh --canary` runs NO agy. As the remote user it tries to list or open every
21
+ # FH_AGY_REMOTE_DENY path (each must be refused) and reads a file it writes in a fresh work folder (must
22
+ # succeed), then writes a local receipt: receipt_<first 16 of sha256(target, deny list, agy path)>.txt
23
+ # with key=value lines (verdict, target_sha, epoch, denied=N/N, positive) and one line per path.
24
+ # A run is refused unless that receipt says PASS, is under 7 days old and matches the current settings.
25
+ # 🟥 The receipt records this script's own measurement on the day it ran; it is not proof of isolation.
26
+ # 🟥 A deny on a drive or folder root does NOT override an explicit allow entry on a sub-item: on the
27
+ # operator's machine (2026-11-16) the remote user could still list or open 8 such sub-items (game
28
+ # folders, the recycle bins, an antivirus decoy folder, three device-information files), which the
29
+ # operator accepted. The canary only measures the paths you list — list a sub-item only after you
30
+ # have denied it explicitly, and name the accepted ones where you record the receipt.
31
+ #
32
+ # USAGE (agy-compatible; extra flags are this runner's own and are not passed to agy):
33
+ # agy_remote_run.sh [--input <file>]... [--fetch <name>]... [--fetch-dir <dir>] -p "<prompt>" [agy flags...]
34
+ # agy_remote_run.sh --canary
35
+ # Inputs are copied under their own names ([A-Za-z0-9._-] only, no duplicates). The remote agy gets
36
+ # `--settings` limiting it to its workspace (allowNonWorkspaceAccess=false); the OS user is the barrier.
37
+ # Through FH's scripts: FH_AGY_BIN=<repo>/scripts/agy_remote_run.sh FH_AGY_ISOLATION=remote-os-user.
38
+ #
39
+ # EXIT: 0 ok · 1 remote agy exited non-zero (AGY_RC=<n> on stderr) · 2 usage · 3 refused (no target,
40
+ # no/stale/FAIL/mismatched receipt) · 4 route unavailable (ssh/scp failed) · 5 cleanup not verified
41
+ # --canary: 0 PASS · 1 FAIL · 2 usage · 4 route unavailable
42
+ set -uo pipefail
43
+ SSH=ssh; SCP=scp # by name from PATH; there is no override (the lanes put fakes first on PATH)
44
+ die() { echo "agy_remote_run: $2" >&2; exit "$1"; }
45
+ TARGET="${FH_AGY_REMOTE-}"
46
+ [ -n "$TARGET" ] || die 3 "AGY-REMOTE-REFUSED: FH_AGY_REMOTE is not set — refusing (agy is never started locally)"
47
+ case "$TARGET" in *[!A-Za-z0-9@._-]*) die 2 "FH_AGY_REMOTE must look like user@host" ;; esac
48
+ RAGY="${FH_AGY_REMOTE_AGY:-%LOCALAPPDATA%\\agy\\bin\\agy.exe}"
49
+ case "$RAGY" in *[!A-Za-z0-9%\\:._\ -]*) die 2 "FH_AGY_REMOTE_AGY may contain only letters, digits, % \\ : . _ - and spaces" ;; esac
50
+ DENY="${FH_AGY_REMOTE_DENY-}"
51
+ RDIR="${FH_AGY_REMOTE_RECEIPT_DIR:-$HOME/.cache/fh-agy-remote}"
52
+ case "$DENY$RAGY" in *$'\n'*|*$'\r'*) die 2 "FH_AGY_REMOTE_DENY / FH_AGY_REMOTE_AGY must not contain line breaks" ;; esac
53
+ # length-prefixed fields: no two different settings can produce the same hashed text
54
+ TSHA="$(printf 'v1|%d:%s|%d:%s|%d:%s' "${#TARGET}" "$TARGET" "${#DENY}" "$DENY" "${#RAGY}" "$RAGY" | shasum -a 256 2>/dev/null | cut -c1-64)"
55
+ printf '%s' "$TSHA" | grep -Eq '^[0-9a-f]{64}$' || die 4 "could not compute the settings hash (shasum) — refusing"
56
+ RECEIPT="$RDIR/receipt_${TSHA:0:16}.txt"
57
+ SSHO=(-o BatchMode=yes -o ConnectTimeout=15)
58
+ WD="fh_agy_$(date +%Y%m%d%H%M%S)_$(od -An -N3 -tx1 /dev/urandom | tr -d ' \n')"
59
+ LOCAL="$(mktemp -d "${TMPDIR:-/tmp}/fh_agy_remote.XXXXXX")" || die 4 "cannot create a local temp folder"
60
+ trap 'rm -rf "$LOCAL"' EXIT
61
+
62
+ remote_mkdir() { "$SSH" "${SSHO[@]}" "$TARGET" "mkdir $WD" </dev/null >/dev/null 2>&1; }
63
+ remote_put() { "$SCP" -q "${SSHO[@]}" "$@" "$TARGET:$WD/" </dev/null >/dev/null 2>&1; }
64
+ remote_ps() { "$SSH" "${SSHO[@]}" "$TARGET" "powershell -NoProfile -ExecutionPolicy Bypass -File $WD\\$1" </dev/null; }
65
+ remote_cleanup() { # only the folder this run created; the remote script re-checks the name and parent
66
+ cat > "$LOCAL/cleanup.ps1" <<'PS'
67
+ $n = Split-Path -Leaf $PSScriptRoot
68
+ $parent = Split-Path -Parent $PSScriptRoot
69
+ if ($n -notmatch '^fh_agy_[0-9]{14}_[0-9a-f]{6}$' -or $parent -ne $env:USERPROFILE) { "CLEANUP-REFUSED $n"; exit 3 }
70
+ Set-Location $env:USERPROFILE; Remove-Item -LiteralPath $PSScriptRoot -Recurse -Force
71
+ if (Test-Path -LiteralPath $PSScriptRoot) { "CLEANUP-FAILED"; exit 5 } else { "CLEANUP-OK" }
72
+ PS
73
+ remote_put "$LOCAL/cleanup.ps1" || return 5
74
+ local co; co="$(remote_ps cleanup.ps1 2>/dev/null)" # capture first: no early-exit reader on a pipe
75
+ case "$(printf '%s' "$co" | tr -d '\r')" in CLEANUP-OK|*$'\n'CLEANUP-OK) return 0 ;; *) return 5 ;; esac
76
+ }
77
+ # An interrupt after the remote folder exists still removes it (only this run's folder, re-checked remotely).
78
+ CREATED=0
79
+ on_signal() { trap - INT TERM; [ "$CREATED" = 1 ] && remote_cleanup; echo "agy_remote_run: interrupted" >&2; exit 130; }
80
+ trap on_signal INT TERM
81
+
82
+ if [ "${1-}" = "--canary" ]; then
83
+ [ $# -eq 1 ] || die 2 "--canary takes no other arguments"
84
+ [ -n "$DENY" ] || die 2 "FH_AGY_REMOTE_DENY is empty — a canary with nothing to deny measures nothing"
85
+ printf '%s\n' "$DENY" | tr ';' '\n' | sed '/^$/d' > "$LOCAL/deny.txt"
86
+ cat > "$LOCAL/canary.ps1" <<'PS'
87
+ foreach ($p in Get-Content -LiteralPath (Join-Path $PSScriptRoot 'deny.txt') -Encoding UTF8) {
88
+ $absentOk = $p.StartsWith('?'); if ($absentOk) { $p = $p.Substring(1) }
89
+ try { $i = Get-Item -LiteralPath $p -Force -ErrorAction Stop
90
+ if ($i.PSIsContainer) { [void](Get-ChildItem -LiteralPath $p -Force -ErrorAction Stop) } else { [IO.File]::OpenRead($p).Close() }
91
+ "DENY-FAIL $p (readable)" }
92
+ catch { $x = $_.Exception; $e = $x.GetType().Name # walk wrapped errors (OpenRead wraps its own)
93
+ while ($null -ne $x.InnerException) { $x = $x.InnerException; $e = $e + '/' + $x.GetType().Name }
94
+ if ($e -match 'UnauthorizedAccess' -or ($absentOk -and $e -match 'NotFound')) { "DENY-OK $p ($e)" }
95
+ else { "DENY-FAIL $p (not measured: $e)" } } }
96
+ $f = Join-Path $PSScriptRoot 'positive.txt'; Set-Content -LiteralPath $f -Value 'FH-POSITIVE'
97
+ try { if ((Get-Content -LiteralPath $f -Raw).Trim() -eq 'FH-POSITIVE') { 'POS-OK' } else { 'POS-FAIL' } } catch { 'POS-FAIL' }
98
+ PS
99
+ remote_mkdir || die 4 "AGY-REMOTE-UNAVAILABLE: cannot reach $TARGET (mkdir failed)"
100
+ CREATED=1
101
+ remote_put "$LOCAL/deny.txt" "$LOCAL/canary.ps1" || { remote_cleanup; die 4 "AGY-REMOTE-UNAVAILABLE: copy to $TARGET failed"; }
102
+ out="$(remote_ps canary.ps1 2>&1)"; prc=$?; out="$(printf '%s' "$out" | tr -d '\r')"
103
+ remote_cleanup; crc=$?
104
+ want=$(grep -c '' "$LOCAL/deny.txt")
105
+ ok=$(printf '%s\n' "$out" | grep -c '^DENY-OK ')
106
+ bad=$(printf '%s\n' "$out" | grep -c '^DENY-FAIL ')
107
+ pos=$(printf '%s\n' "$out" | grep -q '^POS-OK$' && echo READ || echo FAIL)
108
+ verdict=FAIL; [ "$ok" -eq "$want" ] && [ "$bad" -eq 0 ] && [ "$pos" = READ ] && [ "$want" -gt 0 ] && [ "$crc" -eq 0 ] && [ "$prc" -eq 0 ] && verdict=PASS
109
+ mkdir -p "$RDIR" || die 4 "cannot create $RDIR"
110
+ { echo "verdict=$verdict"; echo "target_sha=$TSHA"; echo "epoch=$(date +%s)"; echo "denied=$ok/$want"
111
+ echo "positive=$pos"; echo "cleanup=$([ "$crc" -eq 0 ] && echo OK || echo UNVERIFIED)"
112
+ printf '%s\n' "$out" | grep -E '^(DENY-OK|DENY-FAIL|POS-OK|POS-FAIL)'; } > "$RECEIPT.tmp" && mv "$RECEIPT.tmp" "$RECEIPT" \
113
+ || die 4 "could not write the receipt $RECEIPT — the canary result is not recorded"
114
+ echo "AGY-REMOTE-CANARY $verdict denied=$ok/$want positive=$pos receipt=$RECEIPT"
115
+ [ "$verdict" = PASS ] && exit 0 || exit 1
116
+ fi
117
+
118
+ # ── run mode: receipt first, then the route ───────────────────────────────────────────────────────
119
+ [ -f "$RECEIPT" ] || die 3 "AGY-REMOTE-REFUSED: no canary receipt for these settings — run: agy_remote_run.sh --canary"
120
+ r_get() { sed -n "s/^$1=//p" "$RECEIPT" | sed -n 1p; } # first value only; sed reads to the end
121
+ [ "$(r_get verdict)" = PASS ] || die 3 "AGY-REMOTE-REFUSED: the last canary did not pass ($RECEIPT)"
122
+ [ "$(r_get target_sha)" = "$TSHA" ] || die 3 "AGY-REMOTE-REFUSED: receipt is for different settings"
123
+ age=$(( $(date +%s) - $(r_get epoch | grep -E '^[0-9]+$' || echo 0) ))
124
+ [ "$age" -le 604800 ] || die 3 "AGY-REMOTE-REFUSED: canary receipt is older than 7 days — run --canary again"
125
+ [ "$age" -ge 0 ] || die 3 "AGY-REMOTE-REFUSED: canary receipt is dated in the future — run --canary again"
126
+
127
+ PROMPT=""; HAVEP=0; INPUTS=(); FETCH=(); FDIR=""; PASS=()
128
+ while [ $# -gt 0 ]; do
129
+ case "$1" in
130
+ --input) [ $# -ge 2 ] || die 2 "--input needs a file"; INPUTS+=("$2"); shift 2 ;;
131
+ --fetch) [ $# -ge 2 ] || die 2 "--fetch needs a name"
132
+ [ "$2" = "$(basename "$2")" ] || die 2 "--fetch takes a bare file name inside the work folder, not a path: $2"
133
+ FETCH+=("$2"); shift 2 ;;
134
+ --fetch-dir) [ $# -ge 2 ] || die 2 "--fetch-dir needs a folder"; FDIR="$2"; shift 2 ;;
135
+ -p|--print|--prompt) [ $# -ge 2 ] || die 2 "$1 needs a prompt"; PROMPT="$2"; HAVEP=1; shift 2 ;;
136
+ --settings) die 2 "--settings is set by this runner (workspace-only); remove it" ;;
137
+ *) case "$1" in *$'\n'*) die 2 "an agy argument contains a newline" ;; esac; PASS+=("$1"); shift ;;
138
+ esac
139
+ done
140
+ [ "$HAVEP" -eq 1 ] || die 2 "a prompt is required (-p)"
141
+ [ "${#FETCH[@]}" -eq 0 ] || [ -n "$FDIR" ] || die 2 "--fetch needs --fetch-dir"
142
+ seen=" "
143
+ for f in ${INPUTS[@]+"${INPUTS[@]}"} ${FETCH[@]+"${FETCH[@]}"}; do
144
+ b="$(basename "$f")"
145
+ lb="$(printf '%s' "$b" | tr 'A-Z' 'a-z')" # Windows names are case-insensitive
146
+ case "$b" in ''|*[!A-Za-z0-9._-]*) die 2 "file name not allowed: $b" ;; esac
147
+ case "$lb" in prompt.txt|args.txt|settings.json|run.ps1|cleanup.ps1|agy_path.txt|canary.ps1|deny.txt) die 2 "file name reserved by the runner: $b" ;; esac
148
+ done
149
+ for f in ${INPUTS[@]+"${INPUTS[@]}"}; do
150
+ [ -f "$f" ] || die 2 "input not found: $f"
151
+ b="$(basename "$f" | tr 'A-Z' 'a-z')"; case "$seen" in *" $b "*) die 2 "two inputs share the name $b (Windows ignores case)" ;; esac; seen="$seen$b "
152
+ done
153
+ printf '%s' "$PROMPT" > "$LOCAL/prompt.txt"
154
+ : > "$LOCAL/args.txt"; for a in ${PASS[@]+"${PASS[@]}"}; do printf '%s\n' "$a" >> "$LOCAL/args.txt"; done
155
+ printf '{"toolPermission":"always-proceed","allowNonWorkspaceAccess":false}\n' > "$LOCAL/settings.json"
156
+ printf '%s' "$RAGY" > "$LOCAL/agy_path.txt"
157
+ cat > "$LOCAL/run.ps1" <<'PS'
158
+ Set-Location $PSScriptRoot
159
+ $p = Get-Content -LiteralPath 'prompt.txt' -Raw -Encoding UTF8
160
+ $a = @(Get-Content -LiteralPath 'args.txt' -Encoding UTF8 | Where-Object { $_ -ne '' })
161
+ $agy = [Environment]::ExpandEnvironmentVariables((Get-Content -LiteralPath 'agy_path.txt' -Raw -Encoding UTF8).Trim())
162
+ & $agy -p $p @a --settings (Join-Path $PSScriptRoot 'settings.json')
163
+ # printed after agy has exited: the runner trusts only the LAST line, which agy's output cannot follow
164
+ $rc = $LASTEXITCODE
165
+ "FH_AGY_RC=$rc"
166
+ exit $rc # the ssh exit status carries the same code, which nothing agy leaves behind can rewrite
167
+ PS
168
+ remote_mkdir || die 4 "AGY-REMOTE-UNAVAILABLE: cannot reach $TARGET (mkdir failed) — not falling back to a local agy"
169
+ CREATED=1
170
+ remote_put "$LOCAL/prompt.txt" "$LOCAL/args.txt" "$LOCAL/settings.json" "$LOCAL/agy_path.txt" "$LOCAL/run.ps1" ${INPUTS[@]+"${INPUTS[@]}"} \
171
+ || { remote_cleanup; die 4 "AGY-REMOTE-UNAVAILABLE: copy to $TARGET failed"; }
172
+ remote_ps run.ps1 > "$LOCAL/out.txt" 2> "$LOCAL/err.txt"; src=$?
173
+ tr -d '\r' < "$LOCAL/out.txt" | sed '$ { /^FH_AGY_RC=/d; }'; tr -d '\r' < "$LOCAL/err.txt" >&2
174
+ last="$(tr -d '\r' < "$LOCAL/out.txt" | sed '/^$/d' | tail -1)"
175
+ arc="$(printf '%s' "$last" | sed -n 's/^FH_AGY_RC=\(-\{0,1\}[0-9][0-9]*\)$/\1/p')"
176
+ frc=0
177
+ for n in ${FETCH[@]+"${FETCH[@]}"}; do
178
+ mkdir -p "$FDIR" && "$SCP" -q "${SSHO[@]}" "$TARGET:$WD/$n" "$FDIR/" </dev/null >/dev/null 2>&1 || { echo "agy_remote_run: could not fetch $n" >&2; frc=4; }
179
+ done
180
+ remote_cleanup || { echo "agy_remote_run: remote work folder $WD not confirmed removed" >&2; exit 5; }
181
+ [ -n "$arc" ] || { echo "agy_remote_run: no exit code came back from the remote side (ssh exited $src) — route failed" >&2; exit 4; }
182
+ # success needs BOTH: the printed code and the ssh exit status agree (a line printed later by a leftover
183
+ # child cannot change the exit status; an ssh failure cannot print the line)
184
+ [ "$src" = "$(( arc & 255 ))" ] || { echo "agy_remote_run: ssh exited $src but the remote printed FH_AGY_RC=$arc — route or output not trusted" >&2; exit 4; }
185
+ [ "$frc" -eq 0 ] || exit 4
186
+ [ "$arc" = 0 ] && exit 0
187
+ echo "AGY_RC=$arc" >&2; exit 1