Dagger
Search

intent

No long description provided.

Installation

dagger install github.com/context-and-oss/cicd/src/cross-cutting/intent@v5.1.5

Entrypoint

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
NameTypeDefault ValueDescription
srcDirectory !-

Repository source directory.

diffFile -

Output of git diff <base>...HEAD as a file. When provided, scopes the gate to artifacts changed by this diff and enables refs-infer-coupling: whole text for new/copied/renamed artifacts, newly introduced references for artifacts edited in place. Other prose rules always read the whole artifact. An empty diff falls back to a full-repo audit; a diff that is not a git diff, or carries no b/ prefixes, is refused.

commitShaString !-

Git commit SHA for evidence provenance.

branchString !-

Git branch name.

repoUrlString !-

Repository URL.

failOnString !"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.

dependabotActionsPinBoolean -

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.

notRequiredBoolean -

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 (required: false plus a warning). The orchestrators set this whenever their opt-in --require-intent is absent; a direct call gates normally, because a gate you asked for by name must never be the one that quietly does nothing.

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 (if !querybuilder.IsZeroValue(opts[i].NotRequired)), so an optional bool can only ever be transmitted as true. A positively-named “required” parameter defaulting to on could therefore never be turned off by a caller: the orchestrator would pass false, the client would drop it, and the gate would run anyway. Keep the state that must reach the server — “do not check” — as the non-zero one.

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 string
func (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)
}