-
Notifications
You must be signed in to change notification settings - Fork 1
feat(narrative-ci): add fixtures, OPA gates, deterministic pipeline scaffolding, and evidence bundles #19505
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
Closed
BrianCLong
wants to merge
1
commit into
main
from
codex/implement-summit/intelgraph-integration-patch-nzf4g7
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package narrative_ci.determinism | ||
|
|
||
| default allow = false | ||
|
|
||
| deny_keys := {"ts", "timestamp", "created_at", "updated_at", "time", "datetime"} | ||
|
|
||
| allow { | ||
| not has_bad_key(input.payload) | ||
| } | ||
|
|
||
| has_bad_key(x) { | ||
| is_object(x) | ||
| some k | ||
| x[k] | ||
| deny_keys[k] | ||
| } | ||
|
|
||
| has_bad_key(x) { | ||
| is_object(x) | ||
| some k | ||
| has_bad_key(x[k]) | ||
| } | ||
|
|
||
| has_bad_key(x) { | ||
| is_array(x) | ||
| some i | ||
| has_bad_key(x[i]) | ||
| } | ||
|
|
||
| is_object(x) { type_name(x) == "object" } | ||
| is_array(x) { type_name(x) == "array" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "payload": { "ok": 1, "ts": "2026-02-07T00:00:00Z" } } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "payload": { "ok": 1, "note": "no timestamps here" } } |
4 changes: 4 additions & 0 deletions
4
.github/policies/narrative_ci/fixtures/tier_taxonomy_fail.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "allowed_tiers": ["fringe", "mainstream"], | ||
| "handoff_candidates": [{ "to_tier": "govt_cert" }] | ||
| } |
4 changes: 4 additions & 0 deletions
4
.github/policies/narrative_ci/fixtures/tier_taxonomy_pass.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "allowed_tiers": ["fringe", "mainstream", "govt_cert"], | ||
| "handoff_candidates": [{ "to_tier": "govt_cert" }] | ||
| } |
4 changes: 4 additions & 0 deletions
4
.github/policies/narrative_ci/fixtures/traceability_fail.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "inferred_nodes": [{ "type": "Claim", "id": "clm_missing_receipt" }], | ||
| "receipts": [] | ||
| } |
9 changes: 9 additions & 0 deletions
9
.github/policies/narrative_ci/fixtures/traceability_pass.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "inferred_nodes": [{ "type": "Claim", "id": "clm_ok" }], | ||
| "receipts": [ | ||
| { | ||
| "target": { "type": "Claim", "id": "clm_ok" }, | ||
| "sources": [{ "artifact_id": "art_x", "content_sha256": "sha256:abc" }] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package narrative_ci.tier_taxonomy | ||
|
|
||
| default allow = false | ||
|
|
||
| allow { | ||
| allowed := { t | t := input.allowed_tiers[_] } | ||
| every_candidate_tier_allowed(allowed) | ||
| } | ||
|
|
||
| every_candidate_tier_allowed(allowed) { | ||
| cands := input.handoff_candidates | ||
| not exists_disallowed(cands, allowed) | ||
| } | ||
|
|
||
| exists_disallowed(cands, allowed) { | ||
| some i | ||
| t := cands[i].to_tier | ||
| not allowed[t] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package narrative_ci.traceability | ||
|
|
||
| default allow = false | ||
|
|
||
| allow { | ||
| every_inferred_has_receipt | ||
| every_receipt_has_artifact | ||
| } | ||
|
|
||
| every_inferred_has_receipt { | ||
| inferred := input.inferred_nodes | ||
| receipts := { r.target.id | r := input.receipts[_] } | ||
| not exists_missing(inferred, receipts) | ||
| } | ||
|
|
||
| exists_missing(inferred, receipts) { | ||
| some i | ||
| inferred[i].id != "" | ||
| not receipts[inferred[i].id] | ||
| } | ||
|
|
||
| every_receipt_has_artifact { | ||
| some r | ||
| r := input.receipts[_] | ||
| count(r.sources) > 0 | ||
| r.sources[0].artifact_id != "" | ||
| r.sources[0].content_sha256 != "" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: narrative-ci-verify | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "intelgraph/schema/**" | ||
| - "intelgraph/pipelines/narrative_ci/**" | ||
| - "schemas/narrative/**" | ||
| - "fixtures/feb07_2026/**" | ||
| - ".github/policies/narrative_ci/**" | ||
| - ".github/workflows/narrative-ci-verify.yml" | ||
| workflow_dispatch: {} | ||
|
|
||
| jobs: | ||
| verify: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install OPA | ||
| run: | | ||
| set -euo pipefail | ||
| curl -sSfL -o opa https://openpolicyagent.org/downloads/latest/opa_linux_amd64_static | ||
| chmod +x opa | ||
| sudo mv opa /usr/local/bin/opa | ||
|
|
||
| - name: OPA fixtures | ||
| run: | | ||
| set -euo pipefail | ||
| opa eval -d .github/policies/narrative_ci/traceability.rego -i .github/policies/narrative_ci/fixtures/traceability_pass.json "data.narrative_ci.traceability.allow" | rg "true" | ||
| ! opa eval -d .github/policies/narrative_ci/traceability.rego -i .github/policies/narrative_ci/fixtures/traceability_fail.json "data.narrative_ci.traceability.allow" | rg "true" | ||
|
|
||
| opa eval -d .github/policies/narrative_ci/determinism.rego -i .github/policies/narrative_ci/fixtures/determinism_pass.json "data.narrative_ci.determinism.allow" | rg "true" | ||
| ! opa eval -d .github/policies/narrative_ci/determinism.rego -i .github/policies/narrative_ci/fixtures/determinism_fail.json "data.narrative_ci.determinism.allow" | rg "true" | ||
|
|
||
| opa eval -d .github/policies/narrative_ci/tier_taxonomy.rego -i .github/policies/narrative_ci/fixtures/tier_taxonomy_pass.json "data.narrative_ci.tier_taxonomy.allow" | rg "true" | ||
| ! opa eval -d .github/policies/narrative_ci/tier_taxonomy.rego -i .github/policies/narrative_ci/fixtures/tier_taxonomy_fail.json "data.narrative_ci.tier_taxonomy.allow" | rg "true" | ||
|
|
||
| - name: Determinism linter (out/**) | ||
| run: | | ||
| set -euo pipefail | ||
| if [ -d out ]; then | ||
| ! rg -n "\"(ts|timestamp|created_at|updated_at|datetime|time)\"" out || (echo "timestamp-like keys found in deterministic outputs" && exit 1) | ||
| fi | ||
|
|
||
| - name: Upload fixtures + policies (debug) | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: narrative-ci-fixtures | ||
| path: | | ||
| fixtures/feb07_2026/** | ||
| .github/policies/narrative_ci/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "evidence_id": "EVD-SITUPDATE-2026-02-07-DELTA-001", | ||
| "metrics": { "fixture": true } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "evidence_id": "EVD-SITUPDATE-2026-02-07-DELTA-001", | ||
| "subject": { "type": "narrative_ci_fixture", "name": "SITUPDATE-2026-02-07" }, | ||
| "result": "pass", | ||
| "artifacts": [] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "ts_utc": "2026-02-07T00:00:00Z" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "evidence_id": "EVD-SITUPDATE-2026-02-07-GATES-001", | ||
| "metrics": { "fixture": true } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "evidence_id": "EVD-SITUPDATE-2026-02-07-GATES-001", | ||
| "subject": { "type": "narrative_ci_fixture", "name": "SITUPDATE-2026-02-07" }, | ||
| "result": "pass", | ||
| "artifacts": [] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "ts_utc": "2026-02-07T00:00:00Z" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "evidence_id": "EVD-SITUPDATE-2026-02-07-HANDOFF-001", | ||
| "metrics": { "fixture": true } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "evidence_id": "EVD-SITUPDATE-2026-02-07-HANDOFF-001", | ||
| "subject": { "type": "narrative_ci_fixture", "name": "SITUPDATE-2026-02-07" }, | ||
| "result": "pass", | ||
| "artifacts": [] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "ts_utc": "2026-02-07T00:00:00Z" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "evidence_id": "EVD-SITUPDATE-2026-02-07-STATE-001", | ||
| "metrics": { "fixture": true } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "evidence_id": "EVD-SITUPDATE-2026-02-07-STATE-001", | ||
| "subject": { "type": "narrative_ci_fixture", "name": "SITUPDATE-2026-02-07" }, | ||
| "result": "pass", | ||
| "artifacts": [] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "ts_utc": "2026-02-07T00:00:00Z" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "version": 1, | ||
| "artifacts": [ | ||
| { | ||
| "artifact_id": "art_reuters_alekseyev_2026_02_07", | ||
| "kind": "news_report", | ||
| "uri": "https://www.reuters.com/world/two-suspects-attempted-killing-russian-general-will-soon-be-interrogated-2026-02-07/", | ||
| "content_sha256": "sha256:REPLACE_WITH_REAL_HASH_IF_AVAILABLE", | ||
| "outlet": "Reuters", | ||
| "outlet_tier": "mainstream", | ||
| "lang": "en" | ||
| }, | ||
| { | ||
| "artifact_id": "art_guardian_alekseyev_2026_02_06", | ||
| "kind": "news_report", | ||
| "uri": "https://www.theguardian.com/world/2026/feb/06/russia-military-general-vladimir-alekseyev", | ||
| "content_sha256": "sha256:REPLACE_WITH_REAL_HASH_IF_AVAILABLE", | ||
| "outlet": "The Guardian", | ||
| "outlet_tier": "mainstream", | ||
| "lang": "en" | ||
| }, | ||
| { | ||
| "artifact_id": "art_unit42_shadow_campaigns", | ||
| "kind": "vendor_intel", | ||
| "uri": "https://unit42.paloaltonetworks.com/shadow-campaigns-uncovering-global-espionage/", | ||
| "content_sha256": "sha256:REPLACE_WITH_REAL_HASH_IF_AVAILABLE", | ||
| "outlet": "Palo Alto Unit 42", | ||
| "outlet_tier": "vendor_intel", | ||
| "lang": "en" | ||
| }, | ||
| { | ||
| "artifact_id": "art_bleepingcomputer_signal_germany", | ||
| "kind": "security_news", | ||
| "uri": "https://www.bleepingcomputer.com/news/security/germany-warns-of-signal-account-hijacking-targeting-senior-figures/", | ||
| "content_sha256": "sha256:REPLACE_WITH_REAL_HASH_IF_AVAILABLE", | ||
| "outlet": "BleepingComputer", | ||
| "outlet_tier": "mainstream", | ||
| "lang": "en" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "version": 1, | ||
| "run_id": "run_0002", | ||
| "narratives": [ | ||
| { | ||
| "narrative_id": "narr_alekseyev_hit", | ||
| "title": "Alekseyev assassination attempt", | ||
| "state": "Contested" | ||
| }, | ||
| { | ||
| "narrative_id": "narr_shadow_campaigns", | ||
| "title": "Shadow Campaigns global espionage", | ||
| "state": "Normalized" | ||
| }, | ||
| { | ||
| "narrative_id": "narr_signal_phishing", | ||
| "title": "Signal account hijacking via fake support", | ||
| "state": "Seeded" | ||
| } | ||
| ], | ||
| "claims": [ | ||
| { | ||
| "claim_id": "clm_alekseyev_regained_consciousness", | ||
| "claim_hash": "hash:cur_regained_consciousness", | ||
| "text_norm": "Alekseyev regained consciousness after surgery following the assassination attempt.", | ||
| "verifiability": 0.7, | ||
| "confidence": 0.6, | ||
| "supporting_artifact_ids": ["art_reuters_alekseyev_2026_02_07"] | ||
| }, | ||
| { | ||
| "claim_id": "clm_shadow_campaigns_37_155", | ||
| "claim_hash": "hash:cur_shadow_37_155", | ||
| "text_norm": "Shadow Campaigns compromised targets across 37 countries and conducted reconnaissance across 155 countries.", | ||
| "verifiability": 0.9, | ||
| "confidence": 0.8, | ||
| "supporting_artifact_ids": ["art_unit42_shadow_campaigns"] | ||
| }, | ||
| { | ||
| "claim_id": "clm_signal_hijacking_fake_support", | ||
| "claim_hash": "hash:cur_signal_fake_support", | ||
| "text_norm": "Targets are being phished via fake Signal support chats to hijack Signal accounts.", | ||
| "verifiability": 0.85, | ||
| "confidence": 0.75, | ||
| "supporting_artifact_ids": ["art_bleepingcomputer_signal_germany"] | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
every_receipt_has_artifactrule in.github/policies/narrative_ci/traceability.regois implemented using an existential ('some') check instead of a universal ('every') check. This logic error means the policy will pass if at least one receipt has an artifact, even if others have no sources, leading to traceability gaps. This defeats the purpose of the traceability gate, which aims to ensure all governed outputs have complete provenance. Furthermore, the current implementation could fail if no receipts are present, even when none are required. The rule should be rewritten to ensure all receipts are properly validated.