@@ -212,20 +212,20 @@ def test_an_archived_repo_still_marked_active_is_found(self) -> None:
212212 """**一覧では稼働中に見える。**
213213
214214 この判定は前からあったが、 archived を先に飛ばしていたので
215- 一度も動いていなかった。 旧い言葉(production)でも見つけること。
215+ 一度も動いていなかった。
216216 """
217- for lc in ("active" , "production " ):
217+ for lc in ("active" , "maintenance " ):
218218 with self .subTest (lifecycle = lc ):
219219 findings , _ = A .classify (_org (), {"r" : _repo (
220220 archived = True , properties = _props (lifecycle = lc ))}, {})
221221 self .assertEqual (_codes (findings ), ["archive_drift" ])
222222
223223
224224class ItSpeaksTheStandardVocabularyTest (unittest .TestCase ):
225- """**Custom Properties を標準 (§6)の言葉へ寄せる 。**
225+ """**Custom Properties は標準 (§6)の言葉で書く 。**
226226
227- 寄せる途中は旧い言葉も通す(所見は INFO)。 寄せたかどうかは 、
228- この監査の所見が 0 件になることで確かめる 。
227+ 2026-09-30 に寄せ終えた。 決めた値の表で所見 0 件になること 、
228+ 旧い言葉がもう通らないことを確かめる 。
229229 """
230230
231231 #: 決めた Target(as_is_inventory.md §9.1)。 名前は伏せている
@@ -247,14 +247,11 @@ class ItSpeaksTheStandardVocabularyTest(unittest.TestCase):
247247 "standard" , "internal" , "none" ),
248248 }
249249
250- #: 寄せる前の実測値(2026-09-30)。 名前は伏せている。
251- BEFORE = {
252- "core-a" : (True , "core" , "development" , "developers" ),
253- "core-b" : (True , "core" , "development" , "developers" ),
254- "customer-a" : (True , "customer" , "production" , "developers" ),
255- "customer-b" : (True , "customer" , "production" , "developers" ),
256- "platform" : (False , "org-config" , "production" , "maintainers" ),
257- "docs" : (True , "docs" , "production" , "maintainers" ),
250+ #: 寄せる前に使っていた言葉(2026-09-30 まで)。
251+ OLD_WORDS = {
252+ "repo_type" : ("core" , "customer" , "docs" , "org-config" ,
253+ "template" , "workflow" ),
254+ "lifecycle" : ("development" , "production" ),
258255 }
259256
260257 def test_all_eight_properties_of_the_standard_are_audited (self ) -> None :
@@ -278,51 +275,34 @@ def test_the_decided_target_has_no_findings(self) -> None:
278275 findings , _ = A .classify (_org (), repos , {})
279276 self .assertEqual (findings , [])
280277
281- def test_the_values_before_the_change_are_only_on_the_way (self ) -> None :
282- """**寄せる前の実測値で、 余計な所見を出さないこと 。**
278+ def test_the_old_words_are_no_longer_accepted (self ) -> None :
279+ """**寄せ終えたので、 旧い言葉は「標準に無い値」になる 。**
283280
284- 出るのは「寄せる途中」(INFO)と「定義が無い」の 2 種類だけ。
285- 旧い言葉を誤りとして数えると、 適用前から直すものが埋もれる 。
281+ 定義からも外したので入れられないはずだが、 選択肢を戻されたときに
282+ 気づけるようにする 。
286283 """
287- repos = {}
288- for name , (private , rt , lc , ot ) in self .BEFORE .items ():
289- repos [name ] = _repo (private = private , properties = {
290- "repo_type" : rt , "lifecycle" : lc , "owner_team" : ot ,
291- "core_version" : None })
292- org = _org (properties = _schema (
293- ["repo_type" , "lifecycle" , "owner_team" , "core_version" ]))
294- findings , _ = A .classify (org , repos , {})
295- legacy = [f for f in findings if f ["code" ] == "legacy_value" ]
296- undefined = [f for f in findings
297- if f ["code" ] == "missing_property_definition" ]
298- self .assertEqual (len (legacy ), 18 , "6 件 × 3 Property" )
299- self .assertTrue (all (f ["severity" ] == A .INFO for f in legacy ))
300- self .assertEqual (sorted (f ["message" ].split ()[2 ] for f in undefined ),
301- ["criticality" , "data_classification" , "domain" ,
302- "governance_profile" , "production_impact" ])
303- self .assertEqual (len (findings ), 18 + 5 , _codes (findings ))
304-
305- def test_a_legacy_value_names_where_it_goes (self ) -> None :
306- findings , _ = A .classify (_org (), {"r" : _repo (
307- properties = _props (repo_type = "core" ))}, {})
308- self .assertEqual (_codes (findings ), ["legacy_value" ])
309- self .assertIn ("product-core" , findings [0 ]["message" ])
310-
311- def test_a_legacy_value_is_judged_by_its_new_meaning (self ) -> None :
312- """**寄せる途中も組の判定を止めない。** core は product-core として
313- strict を求める。"""
314- findings , _ = A .classify (_org (), {"r" : _repo (properties = _props (
315- repo_type = "core" , governance_profile = "standard" ,
316- production_impact = "indirect" ))}, {})
317- self .assertEqual (_codes (findings ), ["legacy_value" , "profile_mismatch" ])
318-
319- def test_a_team_name_as_owner_has_no_automatic_mapping (self ) -> None :
320- """developers / maintainers は Team の名前。 機能の言葉へは
321- Repository ごとに寄せる(機械では決まらない)。"""
322- findings , _ = A .classify (_org (), {"r" : _repo (
323- properties = _props (owner_team = "developers" ))}, {})
324- self .assertEqual (_codes (findings ), ["legacy_value" ])
325- self .assertIn ("Repository ごと" , findings [0 ]["message" ])
284+ for key , words in self .OLD_WORDS .items ():
285+ for w in words :
286+ with self .subTest (key = key , value = w ):
287+ findings , _ = A .classify (_org (), {"r" : _repo (
288+ properties = _props (** {key : w }))}, {})
289+ self .assertEqual (_codes (findings ), ["unknown_value" ])
290+ self .assertEqual (findings [0 ]["severity" ], A .WARNING )
291+
292+ def test_a_team_name_as_owner_is_found (self ) -> None :
293+ """**担当は機能の言葉で表す。** Team は権限の単位(D12)。
294+
295+ Team の一覧は API から取るので、 Team が増えても表を直さなくてよい。
296+ """
297+ org = _org (teams = {"developers" : [], "maintainers" : []})
298+ for team in ("developers" , "maintainers" ):
299+ with self .subTest (owner_team = team ):
300+ findings , _ = A .classify (org , {"r" : _repo (
301+ properties = _props (owner_team = team ))}, {})
302+ self .assertEqual (_codes (findings ), ["team_as_owner" ])
303+ findings , _ = A .classify (org , {"r" : _repo (
304+ properties = _props (owner_team = "platform" ))}, {})
305+ self .assertEqual (findings , [], "機能の言葉まで Team 名と誤認しています" )
326306
327307 def test_owner_team_is_an_open_vocabulary (self ) -> None :
328308 """標準も owner_team の選択肢を閉じていない(「...」)。"""
@@ -333,20 +313,12 @@ def test_owner_team_is_an_open_vocabulary(self) -> None:
333313 self .assertEqual (findings , [])
334314
335315 def test_a_value_outside_the_standard_is_found (self ) -> None :
336- """いまの定義にある `template` は標準に無い(使用 0 件) 。"""
316+ """標準に無い値(定義から外した `template` など)を見つける 。"""
337317 findings , _ = A .classify (_org (), {"r" : _repo (
338318 properties = _props (repo_type = "template" ))}, {})
339319 self .assertEqual (_codes (findings ), ["unknown_value" ])
340320 self .assertEqual (findings [0 ]["severity" ], A .WARNING )
341321
342- def test_every_legacy_word_goes_to_a_standard_word (self ) -> None :
343- for key , table in A .LEGACY .items ():
344- for old , new in table .items ():
345- with self .subTest (key = key , old = old ):
346- self .assertNotIn (old , A .STANDARD [key ] or ())
347- if new is not None :
348- self .assertIn (new , A .STANDARD [key ])
349-
350322 def test_a_missing_value_is_found (self ) -> None :
351323 findings , _ = A .classify (_org (), {"r" : _repo (
352324 properties = _props (governance_profile = None ))}, {})
0 commit comments