Skip to content

fix(verify): a package cannot state a fork its vocabulary lacks - #124

Open
cloudronin wants to merge 1 commit into
mainfrom
fix/provenance-jurisdiction
Open

fix(verify): a package cannot state a fork its vocabulary lacks#124
cloudronin wants to merge 1 commit into
mainfrom
fix/provenance-jurisdiction

Conversation

@cloudronin

Copy link
Copy Markdown
Owner

The report

uofa verify packs/vv40/examples/morrison/cou1/uofa-morrison-cou1.jsonld

  ✓ Measurement hash match
  ✓ Measurement signature valid
Warning: decision 1: provenance '<absent>' — the fork says which warrant is
         owed, so this record cannot be checked at all.

Two passing signatures, then a warning that reads like the package is broken.

It is not broken

The package declares context v0.5. decisionProvenance arrived in v0.9. The term is not in its vocabulary — it cannot state a fork.

The message described this checker's expectation, not the package's condition. verify's own preceding line already said the package was old:

context '.../v0.5.jsonld' is not resolvable ... validating against v0.9.jsonld

It knew, and asked anyway.

This is the shape protocol_check already fixed for the run-log pins, one file over.

After

decision 1: no provenance fork — this package declares context v0.5,
            which predates the term; advised, not refused.

Reading and signing split, deliberately

path behaviour
verify — reads an existing artifact advises when the package predates the term
sign_package_scoped — makes a new claim today still refuses, but names age as the cause

The signing refusal now says how to fix it:

this package declares context v0.5, which predates decisionProvenance … re-import under a context of v0.9 or later, then sign. uofa verify reads it as-is.

unclassified_records is unchanged — it still reports the fact for every package. Only the callers decide whether that fact is a refusal or a note. The check narrows; it does not weaken.

An inlined context declares no version and is not treated as old: silence is not a claim of age, and such a document is usually signed, so the term was available when it was made.

Verification

  • 3432 passed, 14 skipped
  • Test seen red by disabling the branch
  • A modern forkless package is still caught (unclassified_records → 1)

One thing worth recording. The test's first draft built its fixture with the key decision; the real block key is hasDecisionRecord. decision_records found nothing, so the test went green on the exact case it exists to catch. The fixture now reads DECISION_BLOCK_KEY and the reason is written into it.

Reported live. `uofa verify packs/vv40/examples/morrison/cou1/...` printed

    decision 1: provenance '<absent>' — the fork says which warrant is owed,
    so this record cannot be checked at all.

beside two PASSING signatures. The package declares context v0.5;
`decisionProvenance` arrived in v0.9. The term is not in its vocabulary, so the
message described this checker's expectation rather than the package's
condition -- and read to anyone running it as though the package were broken.

The same shape `protocol_check` already fixed for the run-log pins, one file
over: refusing a package for lacking a field that did not exist when it was
written punishes age rather than negligence.

`sign_roles` gains `PROVENANCE_INTRODUCED = (0, 9)` and `predates_provenance`.
An inlined context declares no version and is NOT treated as old -- silence is
not a claim of age, and such a document is usually signed, so the term was
available when it was made.

**Reading and signing split, deliberately.** `verify` reads an existing
artifact and now advises. `sign_package_scoped` makes a NEW claim today and
still REFUSES -- narrowing the check, never weakening it -- but names age as the
cause and says the fix is re-importing under a current context, rather than
leaving the caller hunting for a field to fill.

`unclassified_records` is unchanged: it still reports the fact for every
package. Only the callers decide whether that fact is a refusal or a note.

Test seen red by disabling the branch. Its first draft built a fixture keyed
`decision` where the real block key is `hasDecisionRecord`, so the checker found
nothing and the test went green on the exact case it exists to catch; the
fixture now reads DECISION_BLOCK_KEY and the reason is recorded in it.

3432 passed, 14 skipped.
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.

1 participant