Skip to content
Closed
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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default review ownership for Collar
* @logohere
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Report a reproducible bug
labels: bug
---

## What happened?

## Expected behavior

## Reproduction steps

1.
2.
3.

## Environment

- Collar version:
- OS:
- Branch/commit:

## Notes

- Keep reports focused and reproducible.
- If this touches agent behavior, mention the relevant `.dag` path.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
about: Propose a small, focused improvement
labels: enhancement
---

## What problem are you solving?

## Proposed change

## Why this scope?

## Alternatives considered

## Notes

- Prefer updating existing systems over adding new layers.
- If this affects agent behavior, include the `.dag` path involved.
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Pull request template

PRs must use the repo template:

- `.github/pull_request_template.md`

Keep it lean:
- explain why the change exists
- note `.dag` / dotdog impact
- show tests or verification
- call out any intentional scope cuts
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ DAG-first. `Entity→Target:verb(card)`.

## Rules

1. **NEVER read `.dog`** — agents query `.dag` via the router
2. **DAG-path notation** — all behavioral guidance in compact format
3. **Compile before commit** — run `dag-regen.sh --all` after any `.md`/`.dog` change
4. **Test harness fallback** — simulate fresh install, verify constants load from `dags/`
1. **Query `.dag` first** — agent behavior comes from `.dag` routes, not prose
2. **Keep dotdog in the loop** — compile/spec changes through the dotdog path
3. **Use the PR template** — every PR should use `.github/pull_request_template.md`
4. **DAG-path notation** — all behavioral guidance in compact format
5. **Compile before commit** — run `dag-regen.sh --all` after any `.md`/`.dog` change
6. **Test harness fallback** — simulate fresh install, verify constants load from `dags/`

## Project Structure

Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ collar setup # first-time setup wizard

- [dotdog](https://github.com/specdog/dotdog) — `.dog` spec format + compiler
- [specdog](https://github.com/specdog) — the org
- PRs use an agentic template: `.github/pull_request_template.md`

## PR system

Collar PRs should stay lean and agentic:

- use `.github/pull_request_template.md`
- explain the reasoning, not just the diff
- prefer updating existing systems over adding new ones
- keep `.dag` as the first-read source for agent behavior
- avoid adding skills or layers that inflate token use unless the change clearly needs them
- include tests or verification for behavior changes

## Governance

- Branch protection on `main` requires PR review and a passing check
- Security issues should go through `SECURITY.md`
- Bugs and features have issue templates in `.github/ISSUE_TEMPLATE/`

## Dogfood

Expand Down
25 changes: 25 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Security Policy

## Supported Versions

Security fixes land on the default branch and current release line.

## Reporting a Vulnerability

Do not open a public issue for security bugs.

Use one of these instead:
- GitHub Security Advisory for this repository
- Direct contact with the maintainers through the private security channel

Include:
- affected version or commit
- impact
- reproduction steps
- any suggested mitigation

## Review Expectations

- prefer minimal, targeted fixes
- avoid adding new systems unless the fix requires them
- keep `.dag`/dotdog paths lean when changing agent behavior
12 changes: 11 additions & 1 deletion dag_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,17 @@ def _resolve_sudo_user_profile_env(name: str) -> str | None:
if _cfg_path.exists():
with open(_cfg_path, encoding="utf-8") as _f:
_early_cfg_raw = _yaml_early.safe_load(_f) or {}
if "DAG_REDACT_SECRETS" not in os.environ:
# Managed scope: overlay administrator-pinned values so a managed
# security.redact_secrets / network.force_ipv4 wins here too. This early
# bridge reads config.yaml directly (before load_config is usable), so
# without the overlay a managed redact_secrets toggle would be ignored.
# Fail-open via the shared helper.
try:
from hermes_cli import managed_scope
_early_cfg_raw = managed_scope.apply_managed_overlay(_early_cfg_raw)
except Exception:
pass
if "DAG_REDACT_SECRETS" not in os.environ and "HERMES_REDACT_SECRETS" not in os.environ:
_early_sec_cfg = _early_cfg_raw.get("security", {})
if isinstance(_early_sec_cfg, dict):
_early_redact = _early_sec_cfg.get("redact_secrets")
Expand Down
8 changes: 8 additions & 0 deletions dag_cli/send_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ def _load_dag_env() -> None:
except Exception:
pass

# Managed scope: overlay administrator-pinned values before bridging to env,
# so a managed top-level scalar wins here too. Fail-open via the helper.
try:
from hermes_cli import managed_scope
raw = managed_scope.apply_managed_overlay(raw if isinstance(raw, dict) else {})
except Exception:
pass

if not isinstance(raw, dict):
return

Expand Down
20 changes: 20 additions & 0 deletions gateway/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,15 @@ def _reload_runtime_env_preserving_config_authority() -> None:
cfg = _yaml.safe_load(f) or {}
from dag_cli.config import _expand_env_vars
cfg = _expand_env_vars(cfg)
# Managed scope: keep administrator-pinned values authoritative on every
# turn too. This per-turn reload re-bridges config→env, so without the
# overlay a managed agent.max_turns / timezone / redact_secrets would be
# replaced by the user's value after the first turn. Fail-open.
try:
from hermes_cli import managed_scope
cfg = managed_scope.apply_managed_overlay(cfg)
except Exception:
pass
except Exception:
return

Expand All @@ -1126,6 +1135,17 @@ def _reload_runtime_env_preserving_config_authority() -> None:
# Expand ${ENV_VAR} references before bridging to env vars.
from dag_cli.config import _expand_env_vars
_cfg = _expand_env_vars(_cfg)
# Managed scope: overlay administrator-pinned values BEFORE bridging to
# env vars, so a managed timezone / redact_secrets / max_turns / terminal
# setting wins over the user's value at the env layer too. This bridge
# reads config.yaml directly (not via load_config), so without the
# overlay every HERMES_*/TERMINAL_* env var below would carry the user's
# value even when an administrator pinned it. Fail-open via the helper.
try:
from hermes_cli import managed_scope
_cfg = managed_scope.apply_managed_overlay(_cfg)
except Exception:
pass
# Top-level simple values (fallback only — don't override .env)
for _key, _val in _cfg.items():
if isinstance(_val, (str, int, float, bool)) and _key not in os.environ:
Expand Down
31 changes: 19 additions & 12 deletions skills/github/github-pr-workflow/templates/pr-body-bugfix.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
## Bug Description

<!-- What was happening? -->

Fixes #
-

## Root Cause

<!-- What was causing the bug? -->
-

## Fix

<!-- What does this PR change to fix it? -->
-

-
## Why this fix

## How to Verify
- Why this approach?
- Why this scope?
- Why not a larger refactor?

## DAG / spec impact

<!-- Steps a reviewer can follow to confirm the fix -->
- [ ] Uses existing `.dag` / dotdog systems
- [ ] No new skill unless required
- [ ] Keeps token overhead low
- [ ] Updates existing behavior instead of adding layers

## How to Verify

1.
2.
3.

## Test Plan

- [ ] Added regression test for this bug
- [ ] Added regression test
- [ ] Existing tests still pass
- [ ] Manual verification of the fix

## Risk Assessment

<!-- Could this fix break anything else? What's the blast radius? -->

Low / Medium / High — <!-- explanation -->
- Impact:
- Rollback:
- Notes:
43 changes: 25 additions & 18 deletions skills/github/github-pr-workflow/templates/pr-body-feature.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
## Summary

<!-- 1-3 bullet points describing what this PR does -->
-

-
## Why this change

## Motivation
- Why now?
- What user or upstream need does it address?
- Why this scope and not more?

<!-- Why is this change needed? Link to issue if applicable -->
## DAG / spec impact

Closes #
- [ ] Uses existing `.dag` / dotdog systems
- [ ] No new skill unless required
- [ ] Keeps token overhead low
- [ ] Updates existing behavior instead of adding layers

## Changes
If any box is unchecked, explain why.

<!-- Detailed list of changes made -->
## Changes

-
-

## Test Plan
## Reasoning

<!-- How was this tested? Checklist of verification steps -->
- What was the design choice?
- What alternative was rejected?
- What did you intentionally leave out to keep Collar lean?

- [ ] Unit tests pass (`pytest`)
- [ ] Manual testing of new functionality
- [ ] No regressions in existing behavior

## Screenshots / Examples
## Test Plan

<!-- If UI changes or new output, show before/after -->
- [ ] Unit tests pass
- [ ] Manual verification completed
- [ ] No regression in existing behavior

## Notes for Reviewers
## Risk

<!-- Anything reviewers should pay special attention to -->
- Impact:
- Rollback:
- Notes:
Loading