drift_dataset_ai_chatbot - #19
Open
data-Ja3g3r wants to merge 1 commit into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CDK Drift Benchmark Suite — 32 benchmarks across 5 families
Summary
Adds
versionzied_gt/— 32 independent parallel evolutions of theaws-ai-chat-botCDK stack, one per drift scenario. Every benchmark is a real git repository with real
commits (4 to 15 each, 4 minimum) and a per-commit synthesized CloudFormation template.
All 32 share commit C1 =
9c19d32byte-for-byte; divergence starts at C2.Total: 32 benchmarks, 304 commits, 78 MB, 100% verified and typechecked. Four suites
now total 25 + 30 + 28 + 32 = 115 benchmarks.
Drift families
Each family holds severity to a single axis and every benchmark labels exactly two
commits — V2 (Mild) and V3 (Severe) — with the rest benign.
bedrock:*AI-native cross-family pairs are scoreable — G1↔T4 (Bedrock model access: in-account
wildcard vs cross-account/region), R1↔E2↔T3 (vector store: network vs data-policy vs
foreign account), G4↔T2 (
AdministratorAccess: internal vs cross-account), D1↔D5↔D6(external model/embedder/gateway bypassing the Bedrock guardrail).
Commit log structure
Every benchmark's
repository/is a genuine git repo.git log,diff,show,bisectall work (R1 shown):Author, date and identity are pinned so SHAs are reproducible. Every benchmark's C1 is
9c19d32; divergence starts at C2.Commit-count distribution (no drift-position collision within a length):
Per-benchmark layout
Each
benchmarks-chatbot/<ID>/mirrors the source dataset's<app>/cdk/folder shape:Tooling written against
aws-ai-chat-bot/cdk/cdk.out/*.template.jsonworks againstbenchmarks-chatbot/R1/commits/C5/cdk/cdk.out/*.template.jsonwith only the root pathchanged. Resource counts run 61 (baseline) → 69.
metadata.yaml — the answer key
Deliberately outside
repository/so it can't leak into anything a detector reads.Per commit:
sha,label(V1/V2/V3/VB),commit_severity,cumulative_severity, andfor drift commits a
ground_truthblock with mechanism, path, controlspresent/absent/removed, transitive reach, and a
template_assertionstring.Two severity fields deliberately:
commit_severity= drift introduced by that commit;cumulative_severity= standing risk at that commit. The commits after a Severe drift sitat non-zero cumulative severity while introducing nothing — a false-positive report there
is wrong, and so is "all clear".
Suite property worth naming
Template diff size is deliberately anti-correlated with severity across the suite. Benign
cost-allocation tag commits propagate onto every taggable resource and produce the largest
diffs in every benchmark (437–519 lines); severe commits typically flip one field:
sts:AssumeRole→*)AllowFromPublicfalse → true)TOOL_VERIFY_SIGNATUREtrue → false)Any detector triaging by diff magnitude scores worse than chance.
Quadruple-baseline oracle (free ground truth)
The source dataset's knowledge-base bucket uses
BlockPublicAccess.BLOCK_ALL; E1drifts it to all-false — the same mechanism as
benchmarks/E5(paste),benchmarks-ecs/E3and
benchmarks-support/E1. Detector performance on synthetic vs. real curated drift forone mechanism is now comparable across four different stacks.
Known limitation
The baseline ships no
package.json, so noaws-cdk-libversion is declared; alltemplates were synthesized with 2.150.0 and commits flag
version_match: falseinprovenance.json(declaring the 2.100.0 default supplied at import while synthesized with2.150.0). Within a benchmark every template comes from one library version, so cross-commit
diffs are clean. One always-truthy baseline expression,
ec2.Port.tcp(3000 || 3000), failstsc (TS2872) and is normalized to
ec2.Port.tcp(3000)— a no-op since3000 || 3000is3000. Because rawts-nodesynth does not readcdk.json, the required context (account,region,
dockerImageName, and the feature flagsenablePiiRedaction/enableChatHistory,both true) is injected via
synth_context.json, so the guardrail, Cognito and DynamoDBchat history all exist at C1.
Not included
threat-model.json,canonical_ir.json, the7.*graph IRs,architecture.pnganddiagram.pyfrom the source dataset are absent — they come from tooling outside thisgenerator. A stale threat model copied forward would falsely assert "nothing changed" at
exactly the commits where the guardrail is bypassed or the vector store is opened, which is
worse than having none. Run your own pipeline over
commits/C*/cdk/to produce them.