Skip to content

Add a tlog-policy parser - #269

Open
BenBirt wants to merge 1 commit into
transparency-dev:mainfrom
BenBirt:claude/tlog-policy-parser-feasibility-u7w89l
Open

Add a tlog-policy parser#269
BenBirt wants to merge 1 commit into
transparency-dev:mainfrom
BenBirt:claude/tlog-policy-parser-feasibility-u7w89l

Conversation

@BenBirt

@BenBirt BenBirt commented Jul 24, 2026

Copy link
Copy Markdown

No description provided.

@BenBirt
BenBirt requested a review from a team as a code owner July 24, 2026 11:31
@BenBirt
BenBirt requested a review from mhutchinson July 24, 2026 11:31
@google-cla

google-cla Bot commented Jul 24, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov-commenter

codecov-commenter commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.55319% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.97%. Comparing base (fa00c16) to head (d94901d).
⚠️ Report is 180 commits behind head on main.

Files with missing lines Patch % Lines
policy/tlog_policy.go 92.55% 7 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #269      +/-   ##
==========================================
- Coverage   82.57%   79.97%   -2.60%     
==========================================
  Files           5        9       +4     
  Lines         241      884     +643     
==========================================
+ Hits          199      707     +508     
- Misses         30       97      +67     
- Partials       12       80      +68     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

A new `TLogPolicy` type exposing `Marshal`/`Unmarshal` functions, and `Satisfied`/`Verified` for checking quorum satisfaction / verifying checkpoints.
@BenBirt
BenBirt force-pushed the claude/tlog-policy-parser-feasibility-u7w89l branch from c3b8c21 to d94901d Compare July 24, 2026 12:27

@mhutchinson mhutchinson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I'd like to have @AlCutter approve too.

@mhutchinson
mhutchinson requested a review from AlCutter July 27, 2026 09:50
Comment thread policy/tlog_policy.go
// log <vkey> [<url>]
type Log struct {
// Verifier verifies this log's checkpoint signatures. Its Name() is the
// key name from the vkey, which per the spec MUST correspond to the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, tlog-checkpoint says "The log’s key name in its signature line SHOULD match the origin line".

While mostly it'd be cool if everyone treated that as a MUST, MTC unfortunately doesn't. I think it's okay, in that Satisfied will still works even if Verify doesn't, so mostly just flagging it for thoughts rather than requesting any particular changes.

Comment thread policy/tlog_policy.go
// Witness keys must be tlog-cosignature verifier keys: key types 0x04
// (Ed25519 cosignature/v1) and 0x06 (ML-DSA-44) are supported, and any
// other key type, including plain Ed25519 (0x01), is rejected.
// Log keys may use any note signature algorithm known to the note

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitty - note resolves to sumbdb/note in the imports of this file, and that package only knows about 0x01 signatures, whereas f_note knows about ~all the important ones for tlogs.

You use f_note when parsing verifiers, so it'll work as expected I think, so just the comment is a bit misleading.

Comment thread policy/tlog_policy.go
}

visiting := make(map[string]bool)
var satisfied func(name string) bool

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitty: can shrink this a tad if you want by dropping the param name

Suggested change
var satisfied func(name string) bool
var satisfied func(string) bool

Comment thread policy/tlog_policy.go
// checkpoint for the group to be considered to have witnessed it.
// The "any" and "all" keywords are resolved to 1 and len(Members)
// respectively during parsing, so 1 <= Threshold <= len(Members).
Threshold int

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it uint and avoid possibility of it being negative?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants