intent
No long description provided.
Installation
dagger install github.com/context-and-oss/cicd/src/cross-cutting/intent@v5.1.5Entrypoint
Return Type
Intent Example
dagger -m github.com/context-and-oss/cicd/src/cross-cutting/intent@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
func (m *MyModule) Example() *dagger.Intent {
return dag.
Intent()
}@function
def example() -> dagger.Intent:
return (
dag.intent()
)@func()
example(): Intent {
return dag
.intent()
}Types
Intent 🔗
Intent is a format-agnostic gate that verifies a change was intentional and understood — not vibed in a second. It accepts any artifact (capsule YAML, spec markdown, bug.md, etc.) and applies three tiers of checks: 1. Presence — the change is covered by an intent artifact. 2. Semantic — deterministic rules: no placeholder text, no weasel words, causal language required, minimum length, coupling to diff. 3. (future) — LLM-based quality scoring (opt-in, not yet implemented).
Scope: when a diff is supplied, the gate judges only the artifacts the change actually touches — a PR owns the intent of what it changes, not the repo’s pre-existing artifact debt. With no diff (or an empty one) it falls back to auditing every discovered artifact.
check() 🔗
Check validates that src contains at least one intent artifact proving the change was intentional and understood. Returns a JSON evidence envelope.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| src | Directory ! | - | Repository source directory. |
| diff | File | - | Output of |
| commitSha | String ! | - | Git commit SHA for evidence provenance. |
| branch | String ! | - | Git branch name. |
| repoUrl | String ! | - | Repository URL. |
| failOn | String ! | "error" | Minimum finding severity that fails the gate: error|warn|never. |
| globs | [String ! ] | - | Glob patterns used to discover intent artifacts. Repeatable, optional. Defaults: .capsules/.yaml|yml, specs/.md, docs/specs/*.md, .intent.md, .changes/.md, changes/*.md. |
| dependabotActionsPin | Boolean | - | Asserts the diff originates from a pull request whose actor is exactly dependabot[bot] and is limited to the approved GitHub Actions pin-bump shape (specs/harden-workflow-supply-chain.md). The caller (the reusable/dogfood precommit workflow) sets this only after checking the PR actor itself — it is never inferred here and never trusted blindly: the module independently re-validates every diff hunk before accepting it as a substitute for a human intent artifact. Commit/push execution (post-merge) must never set this — dependabot origin cannot be inferred after merge. |
| notRequired | Boolean | - | Declares that this change is not required to carry a change-intent
artifact: the gate discovers nothing, reads no diff, applies no rule, and
returns an envelope that says so ( The flag is negative on purpose, and inverting it would break the gate.
Dagger’s generated Go client omits any optional argument holding its zero
value ( Do not write a default pragma into this comment even as prose. Dagger’s parser reads pragmas anywhere in a parameter’s doc block, so quoting one as an example silently becomes that parameter’s real default — measured: it made notRequired default to on, which turns the gate off for every direct caller. |
Example
dagger -m github.com/context-and-oss/cicd/src/cross-cutting/intent@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
check --src DIR_PATH --commit-sha string --branch string --repo-url string --fail-on stringfunc (m *MyModule) Example(src *dagger.Directory, commitSha string, branch string, repoUrl string, failOn string) *dagger.File {
return dag.
Intent().
Check(src, commitSha, branch, repoUrl, failOn)
}@function
def example(src: dagger.Directory, commitsha: str, branch: str, repourl: str, failon: str) -> dagger.File:
return (
dag.intent()
.check(src, commitsha, branch, repourl, failon)
)@func()
example(src: Directory, commitSha: string, branch: string, repoUrl: string, failOn: string): File {
return dag
.intent()
.check(src, commitSha, branch, repoUrl, failOn)
}