Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion dag/extdeps/container/oci/digest.dag
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import std.content_hash {
sha256_hex_digest,
content_hash_validate_lower_hex_length,
}
import extdeps.external_authority { ExternalAuthority }
import extdeps.external_authority { ExternalAuthority, ExternalModelScope, ExternalSubjectRef }
import std.decl_ref { DeclarationRef, WholeDeclaration }
import extdeps.uri { Uri, Https }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
Expand All @@ -16,6 +17,20 @@ data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
}
}

data extdeps_model_scope: ExternalModelScope = ExternalModelScope {
subject: ExternalSubjectRef {
declaration: DeclarationRef {
module_path: "extdeps.container.oci.digest",
decl_name: "OciContentDigest",
field: WholeDeclaration
}
},
first_citation: extdeps_external_authority_anchor,
further_citations: []
}

data qualified_self_reference_emit_defect_note: String = "WHY first_citation IS A BARE REFERENCE HERE WHILE THE actions_environment PRECEDENT WRITES A DOTTED PATH, recorded because it is a live emitter defect rather than a style preference. Writing first_citation: extdeps.container.oci.digest.extdeps_external_authority_anchor -- the fully qualified self-reference, exactly the form dag/extdeps/github/actions_environment.dag uses -- emits crate::extdeps_cargo::extdeps_external_authority_anchor.clone(): the WRONG MODULE (extdeps_cargo is unrelated to this one) and a fn item rather than a call, so the generated stage0 fails to compile with E0308. The bare same-module reference emits extdeps_external_authority_anchor() correctly.\n\nTHE PRECEDENT NEVER EXERCISED THIS. dag/extdeps/github/actions_environment.dag is not in the regen input closure, so no generated Rust is produced from it and its dotted spelling has never reached the emitter. This module IS in that closure, which is why the defect surfaced here first and why copying the precedent verbatim is not safe.\n\nTHIS IS NOT A DODGE, AND THE DISTINCTION MATTERS (DESIGN.md 5, unmarked workaround): a bare reference to a sibling declaration in the SAME module is the natural spelling, not a respelling chosen to avoid an obstacle. What would have been a workaround is silently picking it and saying nothing, which is why this row exists. The defect is real, is not fixed here, and is not this PR to fix: qualified declaration references in a data initializer resolve to the wrong module and lose their call. DISSOLVE-ON: the emitter resolving a qualified declaration reference to its declaring module and emitting a call, at which point either spelling works and this note deletes."

data oci_content_digest_note: String = "OCI digest authority (image-spec descriptor.md; distribution-spec digest): algorithm-qualified content address with wire form algorithm:encoded. Modelled as OciContentDigest coproduct (review 45466) — OciSha256Digest(Sha256Digest) | OciSha512Digest(OciSha512DigestBody) | OciOtherDigest(OciOtherDigestBody) — so algorithm tag and payload cannot be forged independently. sha256 arm carries std.content_hash.Sha256Digest directly; sha512 body uses OciSha512DigestHex (String where lower_hex_128); other body uses OciOtherDigestAlgorithm (String where oci_other_digest_algorithm — construction-walls reserved sha256/sha512 wire tokens and cites image-spec algorithm grammar algorithm-component ([a-z0-9]+) separated by [+._-], review 45505) plus OciOtherDigestEncoded (String where oci_other_digest_encoded — [a-zA-Z0-9=_-]+ per descriptor.md, review 45479/45731). Equality is substrate structural == on the coproduct (no parallel oci_content_digest_eq predicate). dissolve-on: cite digest-length law per algorithm when a second validated sha512 consumer needs more than length-128 wire check."

fn oci_encoded_digest_char_allowed(cp: Int) -> Bool {
Expand Down
3 changes: 2 additions & 1 deletion dag/extdeps/transports/rest.dag
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module extdeps.transports.rest

import std.types { HttpMethod, GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, FermiDepth, NonEmptyStr, HttpStatus, Bool, String, Int, List, ContentHash }
import std.types { HttpMethod, GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, FermiDepth, NonEmptyStr, HttpStatus, Bool, String, Int, List }
import std.content_hash { ContentHash }
import std.serialization { WireFormat }
import std.fidelity { TransportFidelity }
import std.effect_grant { Envelope, HandlerBinding, Read, Write, CoveredBy, NoCoveringGrant, covering_grant, NamespacePosition, ServiceOpTree }
Expand Down
1 change: 1 addition & 0 deletions dag/gunbc/extdeps_scope_frontier.dag
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ fn scope_placement_refused_paths(added: List<String>, carriers: List<String>, ma
data scope_carrier_paths: List<String> = [
"dag/extdeps/automation/playwright.dag",
"dag/extdeps/browser/chromium.dag",
"dag/extdeps/container/oci/digest.dag",
"dag/extdeps/github/actions_environment.dag",
"dag/extdeps/os/debian.dag",
"dag/extdeps/session_dashboard.dag",
Expand Down
34 changes: 33 additions & 1 deletion src/v1/stage0/src/extdeps_container_oci_digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
// Source module: extdeps.container.oci.digest

use self::OciContentDigest::*;
pub use crate::extdeps_external_authority::ExternalAuthority;
pub use crate::extdeps_external_authority::{
ExternalAuthority, ExternalModelScope, ExternalSubjectRef,
};
use crate::extdeps_uri::UriScheme::Https;
pub use crate::extdeps_uri::{Uri, UriScheme};
pub use crate::std_content_hash::Sha256Digest;
pub use crate::std_content_hash::{content_hash_validate_lower_hex_length, sha256_hex_digest};
use crate::std_decl_ref::DeclField::WholeDeclaration;
pub use crate::std_decl_ref::{DeclField, DeclarationRef};
pub use crate::std_types::NonEmptyStr;
use crate::v1_rt;
use crate::v1_rt::{VecCompat, VecJoin};
Expand All @@ -29,6 +33,34 @@ pub fn extdeps_external_authority_anchor() -> Rc<ExternalAuthority> {
CACHED.with(|c: &Rc<ExternalAuthority>| c.clone())
}

pub fn extdeps_model_scope() -> Rc<ExternalModelScope> {
thread_local! {
static CACHED: Rc<ExternalModelScope> = {
Rc::new(ExternalModelScope {
subject: Rc::new(ExternalSubjectRef {
declaration: Rc::new(DeclarationRef {
module_path: "extdeps.container.oci.digest".to_string(),
decl_name: "OciContentDigest".to_string(),
field: Rc::new(DeclField::WholeDeclaration),
}),
}),
first_citation: extdeps_external_authority_anchor(),
further_citations: Rc::new(vec![]),
})
};
}
CACHED.with(|c: &Rc<ExternalModelScope>| c.clone())
}

pub fn qualified_self_reference_emit_defect_note() -> String {
thread_local! {
static CACHED: String = {
"WHY first_citation IS A BARE REFERENCE HERE WHILE THE actions_environment PRECEDENT WRITES A DOTTED PATH, recorded because it is a live emitter defect rather than a style preference. Writing first_citation: extdeps.container.oci.digest.extdeps_external_authority_anchor -- the fully qualified self-reference, exactly the form dag/extdeps/github/actions_environment.dag uses -- emits crate::extdeps_cargo::extdeps_external_authority_anchor.clone(): the WRONG MODULE (extdeps_cargo is unrelated to this one) and a fn item rather than a call, so the generated stage0 fails to compile with E0308. The bare same-module reference emits extdeps_external_authority_anchor() correctly.\n\nTHE PRECEDENT NEVER EXERCISED THIS. dag/extdeps/github/actions_environment.dag is not in the regen input closure, so no generated Rust is produced from it and its dotted spelling has never reached the emitter. This module IS in that closure, which is why the defect surfaced here first and why copying the precedent verbatim is not safe.\n\nTHIS IS NOT A DODGE, AND THE DISTINCTION MATTERS (DESIGN.md 5, unmarked workaround): a bare reference to a sibling declaration in the SAME module is the natural spelling, not a respelling chosen to avoid an obstacle. What would have been a workaround is silently picking it and saying nothing, which is why this row exists. The defect is real, is not fixed here, and is not this PR to fix: qualified declaration references in a data initializer resolve to the wrong module and lose their call. DISSOLVE-ON: the emitter resolving a qualified declaration reference to its declaring module and emitting a call, at which point either spelling works and this note deletes.".to_string()
};
}
CACHED.with(|c: &String| c.clone())
}

pub fn oci_content_digest_note() -> String {
thread_local! {
static CACHED: String = {
Expand Down
Loading