Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
e56aaf2
feat(breg): replay stewardship, proposal parties and facility roles
jeremi Dec 3, 2026
e7cc32c
feat(breg): preflight archived reader and applicant replay
jeremi Dec 3, 2026
6531aad
feat(casework): mark unread Proposal messages in the review inbox
jeremi Dec 3, 2026
fc6155a
fix(breg): name Record types in authoring diagnostic codes
jeremi Dec 3, 2026
682f777
test(breg): verify TLS attachment staging cancellation
jeremi Dec 3, 2026
c095df8
fix(breg): enforce reference target authority on direct writes
jeremi Dec 3, 2026
4e86cdb
test(breg): cover reference reasons in direct and ingestion Batch
jeremi Dec 3, 2026
abc2093
fix(breg): enforce bare reference grant field selection
jeremi Dec 3, 2026
951f086
fix(breg): account for the Reference grant in the client inventory
jeremi Dec 3, 2026
545e26f
fix(breg): remove duplicate provenance schema default
jeremi Dec 3, 2026
6291bc8
fix(breg): wire proposal message types into history erasure tests
jeremi Dec 3, 2026
47f50d7
fix(breg): gate sealed project unit test on runtime
jeremi Dec 3, 2026
ba60513
test(review): format the form-want compatibility case
jeremi Dec 3, 2026
61807cc
chore(breg): format lifecycle artifact imports
jeremi Dec 3, 2026
1d65748
fix(identifiers): refresh Draft B catalog and authoring schemas
jeremi Dec 3, 2026
1f30e6c
fix(casework): refresh the TypeScript review context contract
jeremi Dec 3, 2026
5074fbb
fix(breg): refresh Proposal event and explain artifacts
jeremi Dec 3, 2026
756deef
docs(breg): align Proposal event reference with the native schema
jeremi Dec 3, 2026
f719c15
test(breg): expect the Action create boundary refusal
jeremi Dec 3, 2026
40065b7
chore: align applicant draft with the platform docs test
jeremi Dec 3, 2026
0d86f17
fix(breg): sync native Node Proposal declarations
jeremi Dec 3, 2026
d02886b
fix(casework): synchronize the unified Node client facade
jeremi Dec 3, 2026
6a61de6
test(breg): expect the claim-based Action Create refusal
jeremi Dec 3, 2026
2f5d88f
chore: align applicant draft with the platform fixture repairs
jeremi Dec 3, 2026
5b9fb72
test(breg): pin revisions for Proposal Problem schemas
jeremi Dec 3, 2026
2dbfde3
test(breg): cover compatible ask wants while advancing the feed
jeremi Dec 3, 2026
26a2cea
chore: align applicant draft with the platform live harness
jeremi Dec 3, 2026
015a263
fix(breg): stabilize review form citation constraint names
jeremi Dec 3, 2026
41ed8bd
chore: align applicant fixtures with the platform problem registry
jeremi Dec 3, 2026
0f97880
chore: align fixture detail lifetime with the platform repair
jeremi Dec 3, 2026
03a1551
chore(identifiers): refresh the BReg Action contract source digest
jeremi Dec 3, 2026
1ba81da
chore: align applicant draft with the release closeout
jeremi Dec 3, 2026
3696d77
docs(breg): clarify authority to set Record references
jeremi Dec 3, 2026
3a23446
fix(breg): scope membership refusal metrics to BReg
jeremi Dec 3, 2026
4a66e71
test(breg): cover subject metadata for Proposal readers
jeremi Dec 3, 2026
af6f530
fix(breg): restore rehearsal of predecessor reference declarations
jeremi Dec 3, 2026
a195bf8
fix(breg): enforce Proposal subject-field write validation
jeremi Dec 3, 2026
4267c17
fix(metrics): satisfy pinned rustfmt
jeremi Dec 3, 2026
e075cf3
test(docs): pin the messaged Proposal lifecycle transition
jeremi Dec 3, 2026
248df60
docs: align refusal label counts with recorder declarations
jeremi Dec 3, 2026
acc4d4b
test(adapter): expect only shared refusal labels
jeremi Dec 3, 2026
1cf3055
chore(release): align applicant candidate with platform verification
jeremi Dec 3, 2026
27ba23a
docs: align BReg refusal counts and release history
jeremi Dec 3, 2026
e3636e0
fix(breg): create development package artifacts privately
jeremi Dec 3, 2026
07a37f5
chore(breg): refresh ODRL examples for current project revisions
jeremi Dec 3, 2026
7cd44e3
fix(breg): refresh canonical facility Proposal contracts
jeremi Dec 3, 2026
7636ea9
fix(breg): refresh canonical Minimal and journey contracts
jeremi Dec 3, 2026
49344e2
docs(breg): clarify Proposal Submit subject-field checks
jeremi Dec 3, 2026
5c17b81
chore(identifiers): bind the generated BReg journey schema
jeremi Dec 3, 2026
a4c47d0
chore(release): align applicant fixtures with platform verification
jeremi Dec 3, 2026
7c369ff
fix(breg): sync example TypeScript clients with canonical OpenAPI
jeremi Dec 3, 2026
efa63d3
fix(breg): sync the required-attachment OpenAPI example
jeremi Dec 3, 2026
1cfd0dc
chore(release): carry A test fixes into the B candidate
jeremi Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ jobs:
# of this feature set.
- name: Base Registry Engine schema-gated tests
if: matrix.lane == 'contracts'
run: cargo test --locked -p registry-breg --features runtime,tooling,schema --lib --test action_evidence_compiler --test proposal_hooks --test value_type_consistency
run: cargo test --locked -p registry-breg --features runtime,tooling,schema --lib --test action_evidence_compiler --test proposal_additional_forms --test proposal_hooks --test value_type_consistency

- name: BReg client contract consistency
if: matrix.lane == 'contracts'
Expand Down
68 changes: 34 additions & 34 deletions clients/typescript/generated/breg-facility.ts

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions clients/typescript/generated/breg-minimal.ts

Large diffs are not rendered by default.

40 changes: 28 additions & 12 deletions clients/typescript/generated/casework.ts

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions clients/typescript/tests/casework.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,45 @@ test('Casework returns an empty pending answer and rejects an undeclared bare st
assert.equal(data, undefined)
await assert.rejects(client(410).call('getReviewAsk', { path: ask }), { kind: 'unexpected', status: 410 })
})

test('Casework accepts source threads with absent optional fields and still requires message identity', async () => {
const digest = 'sha256:' + '0'.repeat(64)
const policy = { id: 'address-review', version: '1', digest }
const taskContext = {
taskId: id, requestId: id, requesterReference: 'case-1', policy,
subject: { id, source: 'registry', type: 'proposal', version: '1', digest },
context: { mode: 'current-source', reference: 'proposal-ref', bindingStatus: 'current' },
policyClosure: {
identity: policy, purpose: 'approval', stages: [], displaySchema: { type: 'object' },
context: { mode: 'current-source', provider: 'registry', contract: { id: 'context', revision: digest, schemaDigest: digest } },
retention: { terminalRetentionDays: 30, accountabilityRetentionDays: 30 },
dependencies: {
accessProfiles: [], queues: [], teams: [], clocks: [], calendars: [],
contextProvider: null, taskTemplates: [], trustedProducers: [],
inbox: { defaultPageSize: 25, maximumCandidateScan: 100, maximumSourceReads: 25,
maximumConcurrentSourceReads: 4, pageDeadlineMilliseconds: 2000 },
},
},
}
const sentAt = '2026-12-01T10:00:00.000000Z'
const official = { id, from: 'official', mine: true, sentAt, text: 'Received' }
const erased = { id: '00000000-0000-4000-8000-000000000002', from: 'party', partyRole: 'owner', mine: false, sentAt }
const link = { path: '/v1/proposals/' + id + '/messages', accessProfile: 'reviewer', operation: 'message' }
const availability = { available: true, observedRevision: 2 }
const links = {
message: { ...link, method: 'POST', ifMatch: '"proposal-2"', availability },
markRead: { ...link, method: 'POST', path: link.path + '/read', availability },
list: { ...link, method: 'GET', availability },
}
const readContext = (messages: unknown) => client(200, JSON.stringify({ ...taskContext, messages }),
{ 'content-type': 'application/json', traceparent }).call('getReviewTaskContext', { path: { taskId: id } })

const thread = { count: 2, unread: 1, lastSentAt: sentAt, items: [erased, official], links }
assert.equal((await readContext(undefined)).data.messages, undefined)
for (const messages of [{ count: 0, unread: 0, items: [], links }, { count: 2, unread: 1, lastSentAt: sentAt }, thread]) {
const { data } = await readContext(messages)
assert.deepEqual(data.messages, messages)
}
const { id: _id, ...withoutIdentity } = official
await assert.rejects(readContext({ ...thread, items: [withoutIdentity] }), { kind: 'unexpected', reason: 'schema', status: 200 })
})
2 changes: 2 additions & 0 deletions clients/typescript/tests/live/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,8 @@ export function stageMainPlan(root: string, dhis2Origin: string): string {
'read-updated-contact': 'editor',
'start-registration': 'editor',
'submit-registration': 'editor',
'await-registration': 'editor',
'read-registered-contact': 'editor',
},
},
journeyFile: 'dev-journeys.yaml',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ impl Breg {
{"action": "register-household", "operations": ["start"], "targets": [{"recordType": "household", "rowBoundaries": [{"field": "owner", "claim": "sub", "operator": "equals"}]}]}
],
"proposals": [
{"action": "propose-item", "operations": ["get", "submit"], "ownership": "caller", "targets": [{"recordType": "item", "rowBoundaries": [{"field": "owner", "claim": "sub", "operator": "equals"}]}]},
{"action": "manual-item", "operations": ["get", "submit", "apply"], "ownership": "caller", "targets": [{"recordType": "item", "rowBoundaries": [{"field": "owner", "claim": "sub", "operator": "equals"}]}]},
{"action": "register-household", "operations": ["get", "submit"], "ownership": "caller", "targets": [{"recordType": "household", "rowBoundaries": [{"field": "owner", "claim": "sub", "operator": "equals"}]}]}
{"action": "propose-item", "operations": ["get", "submit"], "party": "owner", "targets": [{"recordType": "item", "rowBoundaries": [{"field": "owner", "claim": "sub", "operator": "equals"}]}]},
{"action": "manual-item", "operations": ["get", "submit", "apply"], "party": "owner", "targets": [{"recordType": "item", "rowBoundaries": [{"field": "owner", "claim": "sub", "operator": "equals"}]}]},
{"action": "register-household", "operations": ["get", "submit"], "party": "owner", "targets": [{"recordType": "household", "rowBoundaries": [{"field": "owner", "claim": "sub", "operator": "equals"}]}]}
]
}
}}
Expand Down
5 changes: 4 additions & 1 deletion crates/registry-adapter/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,10 @@ mod tests {
.lines()
.filter(|line| line.starts_with("adapter_request_refusals_total{check=\""))
.count();
assert_eq!(declared, registry_platform_authcommon::FailedCheck::COUNT);
assert_eq!(
declared,
registry_platform_authcommon::FailedCheck::shared().count()
);
}

/// The refusal line a scope refusal writes, driven through the recording
Expand Down
6 changes: 5 additions & 1 deletion crates/registry-adapter/tests/facade_refusals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,11 @@ async fn every_refusal_keeps_its_answer_and_is_counted_and_logged_under_its_chec
expected.values().sum::<u64>(),
"no other check was counted: {counted:?}"
);
assert_eq!(counted.len(), 45, "every check is declared at zero");
assert_eq!(counted.len(), 45, "every shared check is declared");
assert!(
!counted.contains_key("membership"),
"membership is a BReg-only check"
);

let stderr = served.wait_for_stderr("\"request refused\"", STDERR_WAIT);
std::thread::sleep(Duration::from_millis(300));
Expand Down
55 changes: 54 additions & 1 deletion crates/registry-breg-client-node/__test__/additions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ test('additions preserve the submitted version and use exact binary exchanges',
const document = {id, actionId: 'correct', actionRevision: revision, submissionVersion: 1, revision: 2, state: 'submitted', effectDigest: revision, links: {},
additions: {other: {id: 'other', maximumBytes: 64, maximumCount: 2, contentTypes: ['text/plain'], classification: 'restricted', items: [],
links: {add: {method: 'POST', path: `/v1/proposals/${id}/additions/other`, accessProfile: 'writer', operation: 'add', ifMatch: '"condition"'}}}}};
const formId = 'details';
const formEntryId = '00000000-0000-4000-8000-000000000004';
const formPath = `/v1/proposals/${id}/additional-forms/${formId}`;
const messageId = '00000000-0000-4000-8000-000000000005';
const threadPath = `/v1/proposals/${id}/messages`;
const requests = [];
const server = http.createServer(async (request, response) => {
const chunks = []; for await (const chunk of request) chunks.push(chunk);
Expand All @@ -27,7 +32,30 @@ test('additions preserve the submitted version and use exact binary exchanges',
response.setHeader('x-content-type-options', 'nosniff'); response.setHeader('vary', 'authorization');
return response.end(bytes);
}
if (request.method === 'POST') {
if (request.url.includes(threadPath)) {
response.setHeader('content-type', 'application/json'); response.setHeader('vary', 'authorization, accept');
if (request.method === 'GET') return response.end(JSON.stringify({items: document.messages.items}));
if (!request.url.includes(threadPath + '/read')) {
const {text} = JSON.parse(requests.at(-1).body.toString());
document.revision++;
for (const link of Object.values(document.messages.links)) link.availability.observedRevision = document.revision;
document.additions.other.links.add.availability.observedRevision = document.revision;
document.additionalForms[formId].links.add.availability.observedRevision = document.revision;
document.messages.count++;
document.messages.items.unshift({id: messageId, from: 'party', partyRole: 'owner',
mine: true, sentAt: '2026-11-27T00:00:00Z', text});
}
return response.end(JSON.stringify(document));
}
if (request.method === 'POST' && request.url.includes(formPath)) {
document.revision++;
document.formEntryId = formEntryId;
document.additions.other.links.add.availability.observedRevision = document.revision;
const slot = document.additionalForms[formId];
slot.items.push({id: formEntryId, submissionVersion: 1, addedAt: '2026-11-27T00:00:00Z',
input: JSON.parse(requests.at(-1).body.toString()).input});
slot.links.add.availability.observedRevision = document.revision;
} else if (request.method === 'POST') {
document.revision++;
document.additions.other.items.push({id: file, submissionVersion: 1, sha256: createHash('sha256').update(bytes).digest('hex'),
byteSize: bytes.length, contentType: 'text/plain', addedAt: '2026-11-27T00:00:00Z', verificationStatus: 'notRequired',
Expand Down Expand Up @@ -60,5 +88,30 @@ test('additions preserve the submitted version and use exact binary exchanges',
const retained = await client.getProposal(contract.selectProposalGet('writer'), id);
assert.equal(JSON.parse(retained.documentJson).additions.other.items.length, 2);
assert.deepEqual((await client.downloadProposalAddition(retained, file)).body, bytes);
document.additionalForms = {[formId]: {id: formId, maximumCount: 2, items: [],
links: {add: {method: 'POST', path: formPath, accessProfile: 'writer', operation: 'add',
ifMatch: '"form-condition"', availability: {available: true, observedRevision: document.revision}}}}};
const withForm = await client.getProposal(contract.selectProposalGet('writer'), id);
const sent = await client.addProposalFormEntry(withForm, formId, {confirmed: true}, 'form-one');
assert.equal(JSON.parse(sent.documentJson).formEntryId, formEntryId);
assert.deepEqual(JSON.parse(requests.at(-1).body.toString()), {input: {confirmed: true}});
assert.equal(requests.at(-1).headers['idempotency-key'], 'form-one');
assert.equal(requests.at(-1).headers['if-match'], '"form-condition"');
const threadLink = (method, tail = '') => ({method, path: threadPath + tail, accessProfile: 'writer',
operation: 'message', availability: {available: true, observedRevision: document.revision}});
document.messages = {count: 0, unread: 0, items: [], links: {
message: {...threadLink('POST'), ifMatch: '"message-condition"'},
markRead: threadLink('POST', '/read'), list: threadLink('GET'),
}};
const current = await client.getProposal(contract.selectProposalGet('writer'), id);
const delivered = await client.sendProposalMessage(current, '<b>literal</b>', 'send-one');
assert.equal(JSON.parse(delivered.documentJson).messages.items[0].text, '<b>literal</b>');
assert.equal(requests.at(-1).headers['idempotency-key'], 'send-one');
const page = await client.listProposalMessages(delivered, null, 2);
assert.equal(page.value.items[0].id, messageId);
await client.markProposalMessagesRead(delivered, messageId);
assert.deepEqual(JSON.parse(requests.at(-1).body.toString()), {through: messageId});
assert.equal(requests.at(-1).headers['if-match'], undefined);
assert.equal(requests.at(-1).headers['idempotency-key'], undefined);
} finally { await new Promise(resolve => server.close(resolve)); }
});
9 changes: 6 additions & 3 deletions crates/registry-breg-client-node/__test__/proposals.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ const id = '00000000-0000-4000-8000-000000000001';
const metadata = {
id: 'proposal-client', version: '1', revision, metadataVersion: '2', recordTypes: [], operations: [],
proposals: {method: 'GET', path: '/v1/proposals', accessProfiles: ['author'],
actions: [{actionId: 'correct', accessProfile: 'author', operations: ['get', 'list', 'submit'], readableInputs: [], readableContextFields: []}],
actions: [{actionId: 'correct', accessProfile: 'author', party: 'owner', operations: ['get', 'list', 'submit'], readableInputs: [], writableInputs: ['address'], readableContextFields: []}],
get: {method: 'GET', path: '/v1/proposals/{proposal_id}', accessProfiles: ['author']}},
actions: [{id: 'correct', apiName: 'correct', revision, display: {}, execution: {mode: 'proposal'},
attachments: [{id: 'supporting-file', required: true, contentTypes: ['application/pdf'], maximumBytes: 1024}],
route: '/v1/actions/correct/proposals', inputMode: 'fixed', inputs: [
{id: 'address', apiName: 'address', required: true, nullable: false, classification: 'internal',
schema: {type: 'string', minLength: 1, maxLength: 100},
fieldType: {type: 'string', minimumLength: 1, maximumLength: 100}},
], referenceInputs: [], requiredConditionKeys: [], resultEffects: [],
], referenceInputs: [], requiredConditionKeys: [], resultEffects: [], subject: {input: 'address'}, writableInputs: ['address'],
access: {selectedProfile: 'author'}, routes: {start: {method: 'POST', path: '/v1/actions/correct/proposals', operationId: 'actions.correct.start',
requiresIdempotencyKey: true, inputSchema: 'action-correct-invoke-input', responseSchema: 'action-correct-invoke-response'}},
bounds: {maximumTargets: 16, maximumFieldMutations: 128, maximumSnapshotBytes: 2097152}}],
};
const proposal = {id, actionId: 'correct', actionRevision: revision, submissionVersion: 1, revision: 1, state: 'draft', links: {
const proposal = {id, actionId: 'correct', actionRevision: revision, submissionVersion: 1, revision: 1, state: 'draft', partyRole: 'owner', links: {
self: {method: 'GET', path: `/v1/proposals/${id}`, accessProfile: 'author', operation: 'get'},
edit: {method: 'POST', path: `/v1/proposals/${id}/edit`, accessProfile: 'author', operation: 'edit', ifMatch: '"draft-condition"'},
submit: {method: 'POST', path: `/v1/proposals/${id}/submit`, accessProfile: 'author', operation: 'submit', ifMatch: '"draft-condition"'},
Expand Down Expand Up @@ -86,10 +86,13 @@ test('proposal object methods preserve exact bodies and refuse JSON strings befo
const client = new BaseRegistryClient({baseUrl: `http://127.0.0.1:${server.address().port}/tenant/`});
const contract = await client.registryContract('author');
assert.deepEqual(contract.proposalActions, metadata.proposals.actions);
assert.equal(contract.actions[0].subjectInput, 'address');
assert.deepEqual(contract.actions[0].writableInputs, ['address']);
assert.deepEqual(contract.actions[0].attachments, metadata.actions[0].attachments);
const getBinding = contract.selectProposalGet('author');
const located = await client.getProposal(getBinding, id);
assert.equal(located.identifier, id);
assert.equal(JSON.parse(located.documentJson).partyRole, 'owner');
assert.equal(requests.at(-1).url, `/tenant/v1/proposals/${id}?accessProfile=author`);
const getCount = requests.length;
for (const invalid of ['../secret', id.toUpperCase(), '00000000-0000-0000-0000-00000000000A']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test('review-only binding reads context and exact document without Proposal Get'
const binding = contract.selectProposalReviewContext('reviewer', 'correct');
assert.ok(binding instanceof BRegProposalReviewBinding);
const observed = (await client.readProposalReviewById(binding, id)).value;
assert.equal(new URL(requests.at(-1), 'http://local').searchParams.get('include'), 'answers');
assert.deepEqual(new URL(requests.at(-1), 'http://local').searchParams.getAll('include'), ['answers', 'messages']);
const batch = await client.readProposalReviewContextBatch(binding, [id, concealedId]);
assert.deepEqual(batch.value, [observed, null]);
const batchUrl = new URL(requests.at(-1), 'http://local');
Expand Down
Loading
Loading