feat: migrate live inventory to five-facet 0.3 and close WP-0006
All seven data/resources records now carry description, decision, reef/secret refs, and potential vs actual consumers. Discovered resources use decision.status: gap. Validators require live inventory to be 0.3. WP-0006 T03 done; workplan finished.
This commit is contained in:
parent
6e57a65360
commit
dafc812daa
11 changed files with 165 additions and 11 deletions
|
|
@ -75,9 +75,34 @@ class PortfolioTest(unittest.TestCase):
|
|||
def test_v02_records_remain_valid(self):
|
||||
v02 = [r for _, r in self.records() if r.get("schema_version") == "0.2"]
|
||||
self.assertGreaterEqual(len(v02), 1)
|
||||
self.assertTrue(all(r["record_scope"] == "example" for r in v02))
|
||||
for record in v02:
|
||||
validate_record(record)
|
||||
|
||||
def test_live_inventory_is_v03_with_consumers(self):
|
||||
live = [
|
||||
(path, record)
|
||||
for path, record in self.records()
|
||||
if record.get("record_scope") == "inventory"
|
||||
]
|
||||
self.assertGreaterEqual(len(live), 7)
|
||||
for path, record in live:
|
||||
with self.subTest(path=path):
|
||||
self.assertEqual(record["schema_version"], "0.3")
|
||||
for facet in (
|
||||
"description",
|
||||
"decision",
|
||||
"operational_refs",
|
||||
"credential_handles",
|
||||
"consumers",
|
||||
):
|
||||
self.assertIn(facet, record)
|
||||
consumers = record["consumers"]
|
||||
self.assertIn("potential", consumers)
|
||||
self.assertIn("actual", consumers)
|
||||
self.assertTrue(consumers["potential"])
|
||||
validate_record(record)
|
||||
|
||||
def test_unknown_commission_date_is_preserved(self):
|
||||
record = deepcopy(next(r for _, r in self.records() if r["status"] == "active"))
|
||||
record["lifecycle"]["commissioned_on"] = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue