Skip to content
Draft
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
34 changes: 34 additions & 0 deletions .agents/agents/adversarial_pr_reviewer/agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Adversarial PR Reviewer Subagent Definition

Name: adversarial_pr_reviewer
Description: Autonomous adversarial security and domain-expert code reviewer for UltiMaker repositories.

## System Role & Instructions

You are an adversarial, security-focused Senior Software Architect performing autonomous code reviews across UltiMaker cloud services, web applications, core C++/WASM math libraries, and firmware ecosystems.

### Review Protocol & Verification Checklist

1. **Security & Safety Guardrails**:
- **No Hardcoded Absolute Paths**: Ensure zero absolute user paths (`/home/<user>/`, `/Users/<user>/`).
- **No Leaked Secrets**: Scan for unencrypted private keys, GCP tokens, passwords, or API keys.
- **OWASP Compliance**: Verify against the profile-matched sections in `.agents/rules/07-owasp-security-rules.md` (IoT, API, and/or Web depending on the repo).
- **Memory & Resource Safety**: In C/C++ libraries or WASM, verify memory bounds, absence of memory leaks, and error handling that follows the convention documented in `.agents/rules/03-core-cpp-architecture-rules.md`.

2. **Domain Architecture & Standards**:
- **Cloud Services**: Verify async handlers, query parameterization, container security, and API documentation sync.
- **Frontend & Web Apps**: Verify DESIGN.md token usage, WCAG 2.1 AA accessibility, Storybook coverage.
- **Core C++ / WASM Libraries**: Verify the repo's C++ standard, CMake/Conan presets, unit test coverage, and the documented error-handling style (std::expected vs exceptions).
- **Firmware (if applicable)**: Verify DBus proxy bindings, state machine safety, and recipe version pinning.

3. **Work Tracking & Commit Standards**:
- **Jira Reference**: Ensure commit titles and PR title start with bracketed Jira ticket prefix `[PROJECT-KEY-123]`.
- **No Semantic Prefixes**: Reject `feat:`, `fix:`, `chore:` in commit/PR titles.
- **Minimal Diff & Scope Protection**: Reject mass re-formatting or edits to vendor SDKs (`vendor/`, `third_party/`).

### Output Format

Return a structured Markdown audit report:
- 🚨 **Critical Vulnerabilities & Policy Blockers** (Must be fixed before PR approval)
- ⚠️ **Warnings & Architectural Recommendations**
- ✅ **Passed Verification Checks**
105 changes: 105 additions & 0 deletions .agents/aiignore-generated.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"comment": "Records what compile_aiignore.py generated, so the next run replaces only its own entries and leaves hand-written rules alone. Do not edit.",
"claude_deny": [
"Read(./**/*.pem)",
"Read(./**/*.key)",
"Read(./**/*.p12)",
"Read(./**/*.pfx)",
"Read(./**/*.jks)",
"Read(./**/*.keystore)",
"Read(./**/id_rsa)",
"Read(./**/id_ecdsa)",
"Read(./**/id_ed25519)",
"Read(./**/*.gpg)",
"Read(./**/*.asc)",
"Read(./**/.env)",
"Read(./**/.env.*)",
"Read(./**/*.tfvars)",
"Read(./**/.netrc)",
"Read(./**/.npmrc)",
"Read(./**/credentials.json)",
"Read(./**/service-account*.json)",
"Read(./**/secrets/**)",
"Read(./**/vendor/**)",
"Read(./**/third_party/**)",
"Read(./**/node_modules/**)",
"Read(./**/build/**)",
"Read(./**/dist/**)",
"Read(./**/out/**)",
"Read(./**/target/**)",
"Read(./**/.venv/**)",
"Read(./**/venv/**)",
"Read(./**/__pycache__/**)",
"Read(./**/*.o)",
"Read(./**/*.a)",
"Read(./**/*.so)",
"Read(./**/*.dylib)",
"Read(./**/*.dll)",
"Read(./**/*.exe)",
"Read(./**/.mypy_cache/**)",
"Read(./**/.pytest_cache/**)",
"Read(./**/.ruff_cache/**)",
"Read(./**/*.stl)",
"Read(./**/*.3mf)",
"Read(./**/*.gcode)",
"Read(./**/*.ufp)",
"Read(./**/*.obj)",
"Read(./**/*.step)",
"Read(./**/*.stp)",
"Read(./**/*.log)",
"Read(./**/logdump*/**)",
"Read(./**/customer-data/**)",
"Read(./**/pii/**)"
],
"opencode_rules": [
"**/*.3mf",
"**/*.a",
"**/*.asc",
"**/*.dll",
"**/*.dylib",
"**/*.exe",
"**/*.gcode",
"**/*.gpg",
"**/*.jks",
"**/*.key",
"**/*.keystore",
"**/*.log",
"**/*.o",
"**/*.obj",
"**/*.p12",
"**/*.pem",
"**/*.pfx",
"**/*.so",
"**/*.step",
"**/*.stl",
"**/*.stp",
"**/*.tfvars",
"**/*.ufp",
"**/.env",
"**/.env.*",
"**/.mypy_cache/**",
"**/.netrc",
"**/.npmrc",
"**/.pytest_cache/**",
"**/.ruff_cache/**",
"**/.venv/**",
"**/__pycache__/**",
"**/build/**",
"**/credentials.json",
"**/customer-data/**",
"**/dist/**",
"**/id_ecdsa",
"**/id_ed25519",
"**/id_rsa",
"**/logdump*/**",
"**/node_modules/**",
"**/out/**",
"**/pii/**",
"**/secrets/**",
"**/service-account*.json",
"**/target/**",
"**/third_party/**",
"**/vendor/**",
"**/venv/**"
]
}
58 changes: 58 additions & 0 deletions .agents/bootstrap-observations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Custom Rule Proposals — ci

These are observations about how *this* repository actually works, gathered by
the agentic bootstrap. They are **not rules yet**. Each one is a signal plus the
question it raises; an agent (or a human) has to decide whether the observation
deserves to become a rule, and what the rule should actually say.

**How to act on this document**

1. Work through the proposals below, highest confidence first.
2. For each, verify the evidence yourself — the detectors are heuristics and can
misread a repository.
3. For the ones worth keeping, write a rule file in `.agents/rules/` numbered
`20-*.md` or higher. Numbers `01`–`19` are regenerated by the bootstrap and
would overwrite your work; `20+` is never touched by `--update`.
4. Replace every `<placeholder>` in a draft with the concrete answer for this
repository. A rule that still contains a placeholder is worse than no rule.
5. Run `bash scripts/sync_agentic_configs.sh` so the new rule is symlinked into
`.claude/rules/` and `.opencode/rules/`.
6. Delete or annotate proposals you reject, so the next run does not re-litigate
a settled decision.

---

## 1. Commits are small and tightly scoped

**Category:** commit-style **Confidence:** medium

**Evidence**

- median 1 files per commit, 90th percentile 9

**Question to reason about**

Should the scope rule name a concrete file-count expectation derived from this repository's own history?

**Draft rule (needs review and placeholder resolution)**

> Keep commits tightly scoped: this repository's median commit touches 1 files. A commit touching more than 9 files needs an explicit justification in the message.

---

## 2. History keeps merge commits

**Category:** git-workflow **Confidence:** medium

**Evidence**

- 11/40 sampled commits are merges (mostly pull request merges)
- `Merge pull request`: 11, `Merge branch`: 0

**Question to reason about**

Is the merge commit intentional (preserving branch topology), and should agents therefore NOT rebase published branches?

**Draft rule (needs review and placeholder resolution)**

> This repository preserves merge topology. Do not rewrite or rebase branches that have already been pushed; integrate with merges.
129 changes: 129 additions & 0 deletions .agents/bootstrap-profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"stacks": {
"has_frontend": false,
"has_cloud": false,
"has_cpp": false,
"has_infra": false,
"has_qml": false,
"has_freertos": false,
"has_debian": false,
"has_materials": false
},
"git": {
"commits_sampled": 41,
"jira_keys": {
"CES": 7,
"SEM": 1
},
"branch_jira_key": "UC",
"history_jira_key": "CES",
"dominant_jira_key": "UC",
"semantic_prefix_ratio": 0.0
},
"submodules": [],
"ci": {
"providers": [
"github-actions"
],
"workflows": [
".github/workflows/flake8.yml",
".github/workflows/mypy.yml",
".github/workflows/pycodestyle.yml",
".github/workflows/pylint.yml",
".github/workflows/pytest.yml",
".github/workflows/vulture.yml"
],
"signals": {
"tests": true,
"lint": true,
"build": false
}
},
"tests": {
"frameworks": [],
"commands": []
},
"linters": {
"ruff": false,
"black": false,
"flake8": false,
"mypy": false,
"eslint": false,
"prettier": false,
"clang_format": false,
"clang_tidy": false,
"pre_commit_config": true
},
"cpp": {},
"c": {},
"python": {},
"ui": {
"has_ui": false,
"design_md_exists": false,
"token_sources": [],
"uses_stardust": false
},
"pr_template": {
"exists": false,
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"has_why": false,
"has_what": false,
"has_how": false,
"content": "Jira ticket: [{{ jira_key }}-XXXX](https://ultimaker.atlassian.net/browse/{{ jira_key }}-XXXX)\n\n## Why\n<!-- Describe the problem, user request, or business context driving this change -->\n\n## What\n<!-- High-level summary of the changes introduced in this PR -->\n\n## How\n<!-- Technical & architectural implementation details, design decisions, and changed components -->\n\n## Verification & Validation (V&V)\n<!-- Detail how changes were tested: unit tests, integration tests, E2E visual checks, screenshots/recordings -->\n- [ ] Automated unit/integration tests pass\n- [ ] Pre-commit static checks pass cleanly (`pre-commit run --all-files`)\n- [ ] Visual evidence attached for UI changes (if applicable)\n\n## PR Checklist\n- [ ] Initiating developer reviewed AI-generated code\n- [ ] No hardcoded absolute local paths or secrets introduced\n- [ ] Standing file-size and complexity budgets respected\n"
},
"build_commands": [],
"directory_map": [
{
"name": "local",
"count": 9,
"extensions": ".sh"
},
{
"name": "cfg",
"count": 7,
"extensions": ".ini, .txt"
}
],
"artifact_dirs": [],
"has_api_surface": false,
"license": {
"declared": null,
"source": null,
"proprietary": false
},
"has_package_json": false,
"file_count": 35,
"complexity": {},
"skills": {
"catalog_root": "~/dev/um/UltiCortex",
"catalog_size": 25,
"matched": [
"software-architect"
]
},
"observations": [
{
"category": "commit-style",
"title": "Commits are small and tightly scoped",
"evidence": [
"median 1 files per commit, 90th percentile 9"
],
"question": "Should the scope rule name a concrete file-count expectation derived from this repository's own history?",
"draft_rule": "Keep commits tightly scoped: this repository's median commit touches 1 files. A commit touching more than 9 files needs an explicit justification in the message.",
"confidence": "medium",
"data": {}
},
{
"category": "git-workflow",
"title": "History keeps merge commits",
"evidence": [
"11/40 sampled commits are merges (mostly pull request merges)",
"`Merge pull request`: 11, `Merge branch`: 0"
],
"question": "Is the merge commit intentional (preserving branch topology), and should agents therefore NOT rebase published branches?",
"draft_rule": "This repository preserves merge topology. Do not rewrite or rebase branches that have already been pushed; integrate with merges.",
"confidence": "medium",
"data": {}
}
]
}
8 changes: 8 additions & 0 deletions .agents/file-size-baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"budget": 400,
"comment": "Files recorded here were already over budget when the ratchet was introduced. They may shrink, never grow. Entries are removed automatically once a file falls within budget. Do not add entries by hand to excuse a new violation.",
"exclude": [],
"exclude_comment": "Path fragments excluded from the budget entirely \u2014 use for vendored or generated trees this project does not own. After editing, re-run with --init to reseed.",
"files": {},
"policy": "ratchet"
}
30 changes: 30 additions & 0 deletions .agents/hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"safety-and-compliance": {
"PreToolUse": [
{
"matcher": "run_command|write_to_file|replace_file_content|multi_replace_file_content",
"hooks": [
{
"type": "command",
"command": "python3 .agents/hooks/pretool_guard.py",
"timeout": 15
}
]
},

{
"matcher": "run_command",
"hooks": [
{
"type": "command",
"command": "python3 .agents/hooks/block_name_matched_kill.py",
"timeout": 10
}
]
}

],
"PostToolUse": [
]
}
}
Loading