-
Notifications
You must be signed in to change notification settings - Fork 0
Codex/culture layer validation #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,9 +24,29 @@ jobs: | |
|
|
||
| - name: Validate examples with SHACL | ||
| run: | | ||
| # We check if there are any .ttl files in examples/rdf to validate | ||
| if ls examples/rdf/*.ttl 1> /dev/null 2>&1; then | ||
| python scripts/validate_rdf.py examples/rdf/*.ttl --shapes shacl/hacp-core.ttl | ||
| else | ||
| if ! ls examples/rdf/*.ttl 1> /dev/null 2>&1; then | ||
| echo "No RDF examples found to validate." | ||
| exit 0 | ||
| fi | ||
|
|
||
| positive_examples=( | ||
| examples/rdf/irreversible_task.ttl | ||
| examples/rdf/low_confidence_escalation.ttl | ||
| examples/rdf/multi_agent_handoff.ttl | ||
| ) | ||
| positive_culture_examples=( | ||
| examples/rdf/culture_profile.ttl | ||
| ) | ||
| negative_examples=( | ||
| examples/rdf/failed_validation.ttl | ||
| ) | ||
|
|
||
| python scripts/validate_rdf.py "${positive_examples[@]}" --shapes shacl/hacp-core.ttl | ||
| python scripts/validate_rdf.py "${positive_culture_examples[@]}" --shapes shacl/culture-profile.shacl.ttl | ||
|
|
||
| if python scripts/validate_rdf.py "${negative_examples[@]}" --shapes shacl/hacp-core.ttl; then | ||
| echo "Expected SHACL failure for negative fixtures, but validation passed." | ||
| exit 1 | ||
| else | ||
| echo "Negative fixtures failed core SHACL as expected." | ||
|
Comment on lines
+47
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Negative test masks script errors as expected failuresMedium Severity The negative fixture test treats any non-zero exit code from |
||
| fi | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,6 +31,11 @@ Every task MUST be classified before execution along these axes: | |||||
|
|
||||||
| Unclassified tasks MUST default to **Human-Led, AI-Assisted** handling. Silent delegation is prohibited. | ||||||
|
|
||||||
| ### 3.2 Culture Policy Binding | ||||||
|
|
||||||
| Teams MAY publish a Culture Profile artifact that defines decision-rights model, dissent channels, and risk policy tiers. | ||||||
| For tasks where `importance=High` OR `reversibility=Irreversible`, collaboration **MUST** apply the matching Culture Profile `risk_policy` tier rules, including `requires_divergence` when that flag is set. | ||||||
|
||||||
| For tasks where `importance=High` OR `reversibility=Irreversible`, collaboration **MUST** apply the matching Culture Profile `risk_policy` tier rules, including `requires_divergence` when that flag is set. | |
| When a Culture Profile is present, tasks where `importance=High` OR `reversibility=Irreversible` **MUST** apply the matching Culture Profile `risk_policy` tier rules, including `requires_divergence` when that flag is set. If no Culture Profile exists, such tasks MUST still follow a documented, human-governed risk policy and escalation path consistent with this protocol. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| team_id: "team-alpha" | ||
| decision_rights_model: "RACI" | ||
| dissent_channels: | ||
| - name: "Minority Report" | ||
| preserves_dissent: true | ||
| anonymous: false | ||
| risk_policy: | ||
| tiers: | ||
| - name: "low" | ||
| requires_divergence: false | ||
| requires_minority_report: false | ||
| requires_second_order_effects: false | ||
| requires_audit_trail: true | ||
| escalation_required: false | ||
| - name: "high" | ||
| requires_divergence: true | ||
| requires_minority_report: true | ||
| requires_second_order_effects: true | ||
| requires_audit_trail: true | ||
| escalation_required: true | ||
| norms: | ||
| - name: "Disagree in writing before commit" | ||
| type: "decision" | ||
| incentives: | ||
| - name: "Escalate uncertainty early" | ||
| polarity: "reward" | ||
| rituals: | ||
| - name: "Incident Review" | ||
| cadence: "per-incident" | ||
| metrics: | ||
| - name: "Escalation Lead Time" | ||
| description: "Median time from uncertainty detection to human escalation." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| @prefix : <http://nkllon.org/hacp#> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
|
||
| :team-alpha-culture a :CultureProfile ; | ||
| :teamId "team-alpha" ; | ||
| :decisionRightsModel "RACI" ; | ||
| :hasDissentChannel :minority-report ; | ||
| :hasRiskPolicy :team-alpha-risk-policy . | ||
|
|
||
| :minority-report a :DissentChannel ; | ||
| :channelName "Minority Report" ; | ||
| :preservesDissent true . | ||
|
|
||
| :team-alpha-risk-policy a :RiskPolicy ; | ||
| :hasRiskTier :risk-tier-low, :risk-tier-high . | ||
|
|
||
| :risk-tier-low a :RiskTier ; | ||
| :tierName "low" ; | ||
| :requiresDivergence false ; | ||
| :requiresAuditTrail true . | ||
|
|
||
| :risk-tier-high a :RiskTier ; | ||
| :tierName "high" ; | ||
| :requiresDivergence true ; | ||
| :requiresAuditTrail true . |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| # YAML schema (human-readable) for Culture Profile | ||
| title: HACP Culture Profile | ||
| type: object | ||
| required: | ||
| - team_id | ||
| - decision_rights_model | ||
| - dissent_channels | ||
| - risk_policy | ||
|
|
||
| properties: | ||
| team_id: | ||
| type: string | ||
| description: Unique team identifier (maps to Team entity in higher-level models). | ||
|
|
||
| decision_rights_model: | ||
| type: string | ||
| enum: [RACI, DACI, RAPID, Bespoke] | ||
| description: Team decision-rights topology. | ||
|
|
||
| dissent_channels: | ||
| type: array | ||
| minItems: 1 | ||
| items: | ||
| type: object | ||
| required: [name, preserves_dissent] | ||
| properties: | ||
| name: | ||
| type: string | ||
| description: Human name for the dissent channel. | ||
| preserves_dissent: | ||
| type: boolean | ||
| description: If true, dissent must be durably recorded and linkable to a decision artifact. | ||
| anonymous: | ||
| type: boolean | ||
| default: false | ||
| description: If true, this channel supports anonymous dissent. | ||
|
|
||
| risk_policy: | ||
| type: object | ||
| required: [tiers] | ||
| properties: | ||
| tiers: | ||
| type: array | ||
| minItems: 2 | ||
| items: | ||
| type: object | ||
| required: [name, requires_divergence, requires_audit_trail] | ||
| properties: | ||
| name: | ||
| type: string | ||
| description: "Tier name (for example: low/high or 1-4)." | ||
| requires_divergence: | ||
| type: boolean | ||
| description: If true, divergence-before-convergence is mandatory at this tier. | ||
| requires_minority_report: | ||
| type: boolean | ||
| default: false | ||
| requires_second_order_effects: | ||
| type: boolean | ||
| default: false | ||
| requires_audit_trail: | ||
| type: boolean | ||
| description: If true, decisions must preserve an auditable rationale chain. | ||
| escalation_required: | ||
| type: boolean | ||
| default: false | ||
| description: If true, explicit escalation to a defined authority group is required. | ||
|
|
||
| norms: | ||
| type: array | ||
| description: Explicit team norms (communication/decision/learning). | ||
| items: | ||
| type: object | ||
| required: [name, type] | ||
| properties: | ||
| name: | ||
| type: string | ||
| type: | ||
| type: string | ||
| enum: [communication, decision, review, learning, safety, execution] | ||
|
|
||
| incentives: | ||
| type: array | ||
| description: Explicit or implicit incentive signals that affect decision dynamics. | ||
| items: | ||
| type: object | ||
| required: [name, polarity] | ||
| properties: | ||
| name: | ||
| type: string | ||
| polarity: | ||
| type: string | ||
| enum: [reward, penalty, mixed] | ||
|
|
||
| rituals: | ||
| type: array | ||
| description: Team cadences (retro, design review, incident review, weekly planning). | ||
| items: | ||
| type: object | ||
| required: [name, cadence] | ||
| properties: | ||
| name: | ||
| type: string | ||
| cadence: | ||
| type: string | ||
| description: Example values include weekly, biweekly, monthly, or per-incident. | ||
|
|
||
| metrics: | ||
| type: array | ||
| description: Aggregate and non-personal signals used to operationalize culture. | ||
| items: | ||
| type: object | ||
| required: [name, description] | ||
| properties: | ||
| name: | ||
| type: string | ||
| description: | ||
| type: string |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,6 +36,12 @@ properties: | |||||
| owner: | ||||||
| type: string | ||||||
| description: Human ID responsible for the task.il or org id) | ||||||
|
||||||
| description: Human ID responsible for the task.il or org id) | |
| description: Human ID (email or org id) responsible for the task. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| @prefix : <http://nkllon.org/hacp#> . | ||
| @prefix sh: <http://www.w3.org/ns/shacl#> . | ||
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
|
||
| :CultureProfileShape | ||
| a sh:NodeShape ; | ||
| sh:targetClass :CultureProfile ; | ||
| sh:property [ | ||
| sh:path :teamId ; | ||
| sh:datatype xsd:string ; | ||
| sh:minCount 1 ; | ||
| sh:message "CultureProfile MUST declare teamId." ; | ||
| ] ; | ||
| sh:property [ | ||
| sh:path :decisionRightsModel ; | ||
| sh:datatype xsd:string ; | ||
| sh:minCount 1 ; | ||
| sh:message "CultureProfile MUST declare decisionRightsModel." ; | ||
| ] ; | ||
| sh:property [ | ||
| sh:path :hasDissentChannel ; | ||
| sh:minCount 1 ; | ||
| sh:message "CultureProfile MUST declare at least one dissent channel." ; | ||
| ] ; | ||
| sh:property [ | ||
| sh:path :hasRiskPolicy ; | ||
| sh:minCount 1 ; | ||
| sh:message "CultureProfile MUST declare a risk policy." ; | ||
| ] . | ||
|
|
||
| :RiskPolicyShape | ||
| a sh:NodeShape ; | ||
| sh:targetClass :RiskPolicy ; | ||
| sh:property [ | ||
| sh:path :hasRiskTier ; | ||
| sh:minCount 2 ; | ||
| sh:message "RiskPolicy MUST define at least two risk tiers." ; | ||
| ] . | ||
|
|
||
| :RiskTierShape | ||
| a sh:NodeShape ; | ||
| sh:targetClass :RiskTier ; | ||
| sh:property [ | ||
| sh:path :tierName ; | ||
| sh:datatype xsd:string ; | ||
| sh:minCount 1 ; | ||
| sh:message "RiskTier MUST have tierName." ; | ||
| ] ; | ||
| sh:property [ | ||
| sh:path :requiresDivergence ; | ||
| sh:datatype xsd:boolean ; | ||
| sh:minCount 1 ; | ||
| sh:message "RiskTier MUST specify requiresDivergence (true/false)." ; | ||
| ] ; | ||
| sh:property [ | ||
| sh:path :requiresAuditTrail ; | ||
| sh:datatype xsd:boolean ; | ||
| sh:minCount 1 ; | ||
| sh:message "RiskTier MUST specify requiresAuditTrail (true/false)." ; | ||
| ] . | ||
|
|
||
| :DissentChannelShape | ||
| a sh:NodeShape ; | ||
| sh:targetClass :DissentChannel ; | ||
| sh:property [ | ||
| sh:path :channelName ; | ||
| sh:datatype xsd:string ; | ||
| sh:minCount 1 ; | ||
| sh:message "DissentChannel MUST have channelName." ; | ||
| ] ; | ||
| sh:property [ | ||
| sh:path :preservesDissent ; | ||
| sh:datatype xsd:boolean ; | ||
| sh:minCount 1 ; | ||
| sh:message "DissentChannel MUST specify preservesDissent (true/false)." ; | ||
| ] . |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow now validates only a hardcoded subset of positive fixtures, so any new
.ttlexample added underexamples/rdfwill be skipped unless someone also edits this list. That regresses the previous wildcard coverage and can let broken example artifacts merge with a green CI run, which undermines the repository’s SHACL-based compliance checks.Useful? React with 👍 / 👎.