feat(ai-sdk): searchControls — recall control sources on implementation questions (#39)
CI / detect-changes (push) Successful in 5s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / build-sha-integrity (push) Successful in 6s
CI / validate-canonical-controls (push) Successful in 3s
CI / loc-budget (push) Successful in 18s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Has been skipped
CI / test-go (push) Successful in 58s
CI / iace-gt-coverage (push) Successful in 15s
CI / test-python-backend (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
CI / detect-changes (push) Successful in 5s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / build-sha-integrity (push) Successful in 6s
CI / validate-canonical-controls (push) Successful in 3s
CI / loc-budget (push) Successful in 18s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Has been skipped
CI / test-go (push) Successful in 58s
CI / iace-gt-coverage (push) Successful in 15s
CI / test-python-backend (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
This commit was merged in pull request #39.
This commit is contained in:
@@ -48,3 +48,32 @@ func TestApplyControlRoles_PoolPreference(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsControlPoolRole(t *testing.T) {
|
||||
for _, r := range []string{roleOperationalReq, roleProceduralReq, roleControlStandard, roleImplGuidance} {
|
||||
if !isControlPoolRole(r) {
|
||||
t.Errorf("%q should be in the control-pool", r)
|
||||
}
|
||||
}
|
||||
for _, r := range []string{roleObligation, roleInterpretation, roleDefinition} {
|
||||
if isControlPoolRole(r) {
|
||||
t.Errorf("%q should NOT be in the control-pool", r)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestControlRoleOf_Payload(t *testing.T) {
|
||||
// searchControls filters its deep dense pull by classifying the raw Qdrant payload.
|
||||
nist := map[string]interface{}{"regulation_short": "NIST SP 800-82r3", "article": "AU-8"}
|
||||
if got := controlRoleOf(nist); got != roleControlStandard {
|
||||
t.Errorf("untagged NIST payload role = %q, want control_standard", got)
|
||||
}
|
||||
craAnnex := map[string]interface{}{"regulation_short": "CRA", "article": "Anhang-I", "category": "regulation"}
|
||||
if got := controlRoleOf(craAnnex); got != roleOperationalReq {
|
||||
t.Errorf("CRA Anhang payload role = %q, want operational_requirement", got)
|
||||
}
|
||||
dora := map[string]interface{}{"regulation_short": "DORA", "article_label": "Art. 5 DORA", "category": "regulation"}
|
||||
if got := controlRoleOf(dora); isControlPoolRole(got) {
|
||||
t.Errorf("DORA abstract article role = %q must be excluded from the control-pool", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user