configuration/constants/evidence.governance.constants.ts

configuration/constants/evidence.governance.constants.ts is a file in Bane's Lab Site. 35 lines of code and 12 definitions.

import { ALGO_FACE, ARCH_FACE, LEX_FACE } from "@govlab/constants";
import { definitionNode as definition, fileNode as file, groundedBy } from "#core/factories/evidence.factory";
import type { Evidence } from "#types/evidence.types";

const FILENAME_MATCHER = "governance~shared/matchers/filename.matcher.ts";
const SEGMENT_MATCHER = "governance~shared/matchers/segment.matcher.ts";
const RULES = "governance~rules/eslint/";

const PLAN_FACTORY = "pipeline~core/factories/plan.factory.ts";
const STAGE_COORDINATOR = "pipeline~core/coordinators/stage.coordinator.ts";
const CODEMOD_SELECTOR = "governance~codemods/selectors/codemod.selector.ts";
const SECRET_RESOLVER = "secrets~core/resolvers/environment.resolver.ts";
const KIND_VALIDATOR = "build-scripts~core/validators/catalog.kind.validator.ts";
const README_PLUGIN = "docs~core/plugins/manifest.readme.plugin.ts";

const DIALECT = definition("parseDialect", FILENAME_MATCHER);
const GATE = [definition("stagesFor", PLAN_FACTORY), definition("runStages", STAGE_COORDINATOR)];

export const GOVERNANCE_EVIDENCE: readonly Evidence[] = [
    ...groundedBy([DIALECT], ARCH_FACE, ["case-dialect"]),
    ...groundedBy([DIALECT], ALGO_FACE, ["dialect-resolution"]),
    ...groundedBy([definition("wordsOf", SEGMENT_MATCHER)], LEX_FACE, ["word-boundary-case"]),
    ...groundedBy([file(`${RULES}closure-tests-centralized.eslint.rule.ts`)], ARCH_FACE, ["mirrored-test-placement"]),
    ...groundedBy([file(`${RULES}closure-no-import-cycles.eslint.rule.ts`)], ARCH_FACE, ["directed-acyclic-graph"]),
    ...groundedBy([file(`${RULES}no-plaintext-transport.eslint.rule.ts`)], ARCH_FACE, ["encryption-in-transit"]),
    ...groundedBy([file(`${RULES}no-port-literal.eslint.rule.ts`)], ARCH_FACE, ["configuration-externalization"]),
    ...groundedBy([file(`${RULES}no-raw-file-write.eslint.rule.ts`)], ARCH_FACE, ["idempotency"]),
    ...groundedBy(GATE, ARCH_FACE, ["fitness-functions", "orchestration", "pipeline-architecture"]),
    ...groundedBy([file(`${RULES}closure-rule-shape.eslint.rule.ts`), ...GATE], ARCH_FACE, [
        "policy-as-code",
        "policy-enforcement",
    ]),
    ...groundedBy([definition("applyCodemod", CODEMOD_SELECTOR)], ARCH_FACE, ["auto-remediation"]),
    ...groundedBy([definition("textOf", SECRET_RESOLVER), definition("portOf", SECRET_RESOLVER)], ARCH_FACE, [
        "secrets-management",
    ]),
    ...groundedBy([definition("schemaFindings", KIND_VALIDATOR)], ARCH_FACE, ["schema-validation"]),
    ...groundedBy([file(README_PLUGIN)], ARCH_FACE, ["manifest-based-design"]),
];