Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 10 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Java 17 (Apache Jena 5.6.0 is compiled to class file 61)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

# `make check` runs `make shell`, which REFUSES rather than skips when bashrs
# is absent -- that refusal is correct and must not be softened. So the tool
# has to be here. Removing the examples removed cargo-deny and Java 17 with
# them, because nothing in this repository has needed either since; bashrs
# still has a subject, scripts/check-required-contexts.sh, which is itself
# one of the gates.
- name: Cache cargo tools
uses: actions/cache@v4
with:
path: ~/.cargo/bin
key: cargo-tools-${{ runner.os }}-deny0.19-bashrs
key: cargo-tools-${{ runner.os }}-bashrs

- name: Install cargo-deny and bashrs
run: |
cargo deny --version 2>/dev/null | grep -q "cargo-deny 0.19" || cargo install --locked cargo-deny --version "~0.19"
command -v bashrs >/dev/null 2>&1 || cargo install --locked bashrs
- name: Install bashrs
run: command -v bashrs >/dev/null 2>&1 || cargo install --locked bashrs

- name: Course structure, examples, shell lint, supply chain, contexts
- name: Course structure, shell lint, required contexts
run: make check

# `pmat comply` is deliberately NOT run here. It exits 1 on CB-2100 in this
# repository and in paiml/rmedia alike -- a condition neither repo can
# currently satisfy -- so wiring it into the required check would make the
# gate unpassable, and the only way out would be `|| true`, which is a gate
# that cannot fail. Comply is run locally and reviewed; it is not faked here.
- name: Per-example quality gates (fmt, clippy -D warnings, tests)
run: |
for d in examples/*/; do
test -f "$d/Cargo.toml" || continue
( cd "$d" && cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test )
done
29 changes: 3 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL := /bin/bash

.PHONY: help lint test test-fast coverage fmt fmt-check check bench examples supply-chain contexts shell
.PHONY: help lint test test-fast coverage fmt fmt-check check bench contexts shell

help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
Expand Down Expand Up @@ -44,43 +44,20 @@ fmt: ## Format (no-op for markdown repo)
fmt-check: ## Check formatting
@echo "No formatter configured for markdown-only repo"

check: lint shell test examples supply-chain contexts ## Run all checks
check: lint shell test contexts ## Run all checks
@echo "=== All checks passed ==="

bench: ## Benchmark (no-op)
@echo "No benchmarks for this repo"

examples: ## Validate the worked examples and run each one's own gates
@echo "=== examples: consistency ==="
@./scripts/check-examples.sh --self-test
@./scripts/check-examples.sh
@echo "=== examples: gate-the-write ==="
@cd examples/gate-the-write && cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test
@echo "=== examples: readme-shacl ==="
@$(MAKE) --no-print-directory -C examples/readme-shacl check

# cargo-deny is PINNED, for the same reason Jena is: 0.19 takes --config on the
# `check` subcommand and 0.20 takes it globally, so an unpinned install makes the
# invocation wrong on whichever side of the bump you are not on. Caught in CI:
# "error: unexpected argument '--config' found" against a green local run.
supply-chain: ## cargo-deny over every example, against the repo's one policy
@command -v cargo-deny >/dev/null 2>&1 || { \
echo "NOT RUN: cargo-deny is absent, so no supply-chain policy was enforced."; \
echo " cargo install --locked cargo-deny --version \"~0.19\""; exit 1; }
@for d in examples/*/; do \
test -f "$$d/Cargo.toml" || continue; \
echo " cargo deny: $$d"; \
( cd "$$d" && cargo deny --manifest-path Cargo.toml check --config "$(CURDIR)/deny.toml" ) || exit 1; \
done

contexts: ## The required status checks on disk must match the live ruleset
@./scripts/check-required-contexts.sh

shell: ## Every gate here is a shell script, so the scripts are gated too
@command -v bashrs >/dev/null 2>&1 || { \
echo "NOT RUN: bashrs is absent, so no shell script was linted."; \
echo " cargo install --locked bashrs"; exit 1; }
@for s in scripts/*.sh examples/*/scripts/*.sh; do \
@for s in scripts/*.sh; do \
test -f "$$s" || continue; \
echo " bashrs lint $$s"; \
bashrs lint "$$s" || exit 1; \
Expand Down
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ agents and multi-modal programming to serverless multi-model architectures.

**Enroll on Coursera:** [AI Tooling Specialization](https://www.coursera.org/specializations/ai-tooling)

## Worked examples

Runnable code for the courses. Each directory is self-contained, states its
own contract, and fails closed — a check that crashes, or never runs, does not
return a pass.

| example | what it covers |
|---|---|
| [`examples/gate-the-write`](examples/gate-the-write) | constraints compiled from an ontology, applied to output the model never saw them with |
| [`examples/readme-shacl`](examples/readme-shacl) | a README's own frontmatter, judged by a closed SHACL shape it cannot see |

## Courses

| # | Course | Focus | Companion Repo | Capstone |
Expand Down
34 changes: 0 additions & 34 deletions deny.toml

This file was deleted.

7 changes: 0 additions & 7 deletions examples/gate-the-write/Cargo.lock

This file was deleted.

9 changes: 0 additions & 9 deletions examples/gate-the-write/Cargo.toml

This file was deleted.

46 changes: 0 additions & 46 deletions examples/gate-the-write/README.md

This file was deleted.

28 changes: 0 additions & 28 deletions examples/gate-the-write/example.toml

This file was deleted.

12 changes: 0 additions & 12 deletions examples/gate-the-write/ontology.txt

This file was deleted.

7 changes: 0 additions & 7 deletions examples/gate-the-write/proposed-bad.txt

This file was deleted.

5 changes: 0 additions & 5 deletions examples/gate-the-write/proposed-ok.txt

This file was deleted.

Loading
Loading