1
0

NAP2027 0.1.1: labotas uzdevumu [315]–[318] ailes; pašreizējā institūcija (KEM)

Uzdevumu teksta pirmie vārdi 68. lpp. bija nonākuši ailē „Nr.”; pārbaudei
pievienota apgrieztā vārdu pārbaude. Atribūts currentOrg/currentSince:
septiņiem VARAM vides un klimata uzdevumiem — KEM 20-0000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016679RwmHsuTFfxt26wP6rk
This commit is contained in:
2026-10-11 13:01:14 +00:00
parent bcdd26b8d9
commit bc915bc6d2
10 changed files with 114 additions and 37 deletions

View File

@@ -27,7 +27,8 @@ REG_URL = "https://processgit.org/Valsts-Pirmkods/Valdibas-Deklaracija-as-Code/r
def main():
reg_src = sys.argv[sys.argv.index("--registry") + 1] if "--registry" in sys.argv else REG_URL
reg = etree.parse(reg_src if os.path.exists(reg_src) else urllib.request.urlopen(reg_src))
reg = etree.parse(reg_src if os.path.exists(reg_src) else
urllib.request.urlopen(urllib.request.Request(reg_src, headers={"User-Agent": "strategy-as-code-validate/0.1"})))
ids = {o.get("id") for o in reg.getroot() if etree.QName(o).localname == "Organization"}
xsd = etree.XMLSchema(etree.parse(os.path.join(ROOT, "schemas/strategija-0.1.xsd")))
cat = yaml.safe_load(open(os.path.join(ROOT, "planosanas-dokumenti.yaml"), encoding="utf-8"))
@@ -47,7 +48,7 @@ def main():
sha = hashlib.sha256(open(src, "rb").read()).hexdigest()
if sha != root.findtext("s:Metadata/s:Source/s:SHA256", namespaces=NS):
errors.append(f"{d['id']}: avota sha256 nesakrīt")
used = {e.get("org") for e in root.iter() if e.get("org")}
used = {e.get(k) for e in root.iter() for k in ("org", "currentOrg") if e.get(k)}
missing = sorted(used - ids)
if missing:
errors.append(f"{d['id']}: VPK ID nav reģistrā: {', '.join(missing)}")