fix(hub): commit rows run only after their reviews, which now hold two hours
Stage 2.0's commit row failed because its approvals lived 15 minutes and the row ran before them (operator picks 2026-11-20). A review approval now holds two hours (signing.REVIEW_LIFETIME 7200 for all-review batches, signing.lifetime and checked_approval shared by the verifier and the hub). operator.py run reads the approval.py verify steps of a row's command (VERIFY_STEP, the same pattern signing uses), asks the hub through the client's hub_api for each review and skips the row with 'waits <name>: <why>; the row stays open' until every one is approved; a hub that does not answer, a missing client or a port above 65535 also skips it. The inbox lists each commit row's reviews (inbox.linked) with a reviews k/n approved pill; its Run button becomes 'Approve n and run', which brings the row's pending reviews into the selection, signs each rule and red-gate review alone first and then the rest once; approving.apply settles operator rows after the reviews they verify. kvb-git-diff and requirement 020 describe it.
Stacked on grantall (14bb4f3). Conflicts in page-inbox.js (grantNote and DENY_NOTE next to the ux reason chips) and kvb-git-diff/SKILL.md (the superseded line next to the two-hour paragraph) keep both sides. ruff and node --check pass.
Tests: tests/test_operator.py ran once before the commit (operator exception): 51 passed, 61 subtests. test_hub_approval, test_hub_console, test_hub_grant_mode and the fixture updates are written, not run: the full suite runs once on master after all bundles (operator order).
Security: MEDUSA over the staged tree on master: 100, no findings, all 16 files covered. WEB-SSRF at skills/kvb-org-operator/scripts/operator.py:996 (urllib.request to the local hub at base_url(port)) stays accepted as by design after kvb-think-criticize with 1 skeptic over 2 rounds and the operator's accept on 2026-11-21: the port is checked against 65535, the opener has no proxy and no redirects.
🎯 Fix: 92 %
💥 Break: 5 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 87
🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 %
Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
14bb4f38df
commit
0fa05c54d5
16 files changed
+288
-33
No files matched your search
@@ -150,6 +150,23 @@ class TestApproval(unittest.TestCase):
|
||||
self.approvers.write_text('{"credentials": []}', encoding="utf-8")
|
||||
self.refused(signer.proof(self.payload([self.item], int(self.now) + 60), ORIGIN), self.item, "", "no key is pinned")
|
||||
|
||||
def test_a_review_approval_lives_two_hours_and_every_other_kind_fifteen_minutes(self):
|
||||
signer = key(-7, "main")
|
||||
signer.pin(self.approvers, ORIGIN)
|
||||
tree = signing.review_item("0123456789abcdef", "/repo/.git", "/repo", "main", "a" * 40)
|
||||
later = int(self.now) + signing.LIFETIME + 60
|
||||
verifier.check(signer.proof(self.payload([tree], later), ORIGIN), tree, "pass", self.trust, self.now)
|
||||
self.refused(signer.proof(self.payload([tree], int(self.now) + signing.REVIEW_LIFETIME + 60), ORIGIN), tree, "pass", "too far")
|
||||
self.refused(signer.proof(self.payload([self.item, tree], later), ORIGIN), self.item, "", "too far")
|
||||
self.assertEqual((signing.lifetime([tree]), signing.lifetime([tree, self.item]), signing.lifetime([])), (signing.REVIEW_LIFETIME, signing.LIFETIME, signing.LIFETIME))
|
||||
|
||||
def test_the_operator_runner_reads_the_verify_steps_of_a_commit_row_as_the_hub_does(self):
|
||||
runner = (HUB.parent / "skills" / "kvb-org-operator" / "scripts" / "operator.py").read_text(encoding="utf-8")
|
||||
self.assertIn(f'VERIFY_STEP = re.compile(r"{signing.VERIFY_STEP.pattern}")', runner)
|
||||
first, second = "a" * 16, "b" * 16
|
||||
command = f"approval.py verify --port 1 --review {first} && approval.py verify --review {second} --gate pass --port 2; approval.py verify --port 1 --review {first}; approval.py verify --review {'c' * 16}; echo --port 3"
|
||||
self.assertEqual(signing.verified_reviews(command), [first, second])
|
||||
|
||||
def test_one_bulk_signature_serves_each_listed_item_once(self):
|
||||
signer = key(-8, "main")
|
||||
signer.pin(self.approvers, ORIGIN)
|
||||
|
||||
Reference in new issue
Block a user