Define deterministic source_hash computation for daw_i18n/v1 #6
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type/design
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-contracts#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
daw_i18n/v1requires every translation resource to carry asource_hashcomputed over the canonical resource's(text, context, parameters).The contract currently does not define either:
As a result, independent conforming implementations can produce
different
source_hashvalues for the same canonical resource.This was discovered while implementing the first real
daw_i18n/v1resources inDAW/daw-lua-common.Proposed definition
Define
source_hashas SHA-256 over a canonical JSON representationcontaining exactly:
textcontextparametersRules:
contextis represented as JSONnull.parametersis represented as JSONnull.source_hashis represented as 64 lowercase hexadecimal characters.Example canonical hash input:
The hash is intended only for translation-staleness detection, not
for security.
Scope
Update the normative
daw_i18n/v1specification and contractdescriptor.
No change to resource identity, translation semantics, fallback
policy, or rendering behavior is intended.
Acceptance criteria
daw_i18n/v1normatively defines the canonical hash input.parameters.source_hashvalues for the same canonical resource.source_hashis included.Related
DAW/daw-lua-common#48Implemented
daw_i18n/v1/specification.md Section 6.1 and contract.json now
normatively define source_hash: SHA-256 over canonical JSON
{text, context, parameters}, with explicit byte-level string
serialization rules (raw UTF-8, no \uXXXX escapes, fixed control-char
escaping, no normalization) after an additional review round found
that 'canonical JSON' alone was still serializer-ambiguous for
non-ASCII text.
Three test vectors included (plain ASCII, with parameters, with
non-ASCII text/context), all independently verified.