Skip to content

Documented init --dir in the CLI reference - #56

Merged
dzykovic merged 1 commit into
mainfrom
fix/document-init-dir
Oct 7, 2026
Merged

dzykovic merged 1 commit into
mainfrom
fix/document-init-dir

Conversation

@dzykovic

@dzykovic dzykovic commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Summary

docs/cli.md listed init [--dir name] in the synopsis and never said what it does, so a reader — a verification stage on #50 included — guessed it named an output or target directory. It names the project's content directory: where its own rules, agents, skills and adapters live, recorded as project.intelligence_dir, a plain directory inside the repository, accepted only when creating a new project (cli/commands/init.sh). One sentence in the init section now says exactly that. No behavior changes.

Type of change

  • CLI lifecycle or package behavior
  • Sync engine or adapter
  • Rule, agent, or skill content
  • Documentation
  • Refactor with no behavior change

Public CLI check

  • Uses only the established public command groups (no command changes)
  • Keeps preview/apply behavior explicit for planned writes (unchanged)
  • Covers automatic project alignment and CI refusal through the existing suites
  • Keeps fresh-clone package restoration behind intelligence sync (unchanged)

Verification

Work in a scratch directory outside this checkout; nothing below moves the checkout or its refs. Lay out this branch's runtime first: mkdir rt && git -C <checkout> archive <this PR's head> cli engine packages | tar -x -C rt, and use bash rt/cli/intelligence as the CLI.

  1. Read the intelligence init section of docs/cli.md at this PR's head. Expected: a sentence explains --dir name as the content directory, recorded as project.intelligence_dir, a plain in-repo directory, new projects only.
  2. git init a and run init --dir ai --no-sync in a. Expected: exit 0; a/intelligence.yaml has intelligence_dir: "ai" under project: and its project sources read ai/rules, ai/agents, ai/skills.
  3. In a second git init b, run init --dir ../outside. Expected: non-zero exit naming a plain directory inside the repo. Then run init --dir other in a (already a project). Expected: non-zero exit saying --dir applies only when creating a new project.

Automated coverage

None needed: no executable line changes. CI runs the full suites on this head.

Versioned artifacts

  • No release state changes: a documentation correction needs no changelog line
  • No version file moves
  • No CHANGELOG.md change
  • No stable release is published by this PR

Notes for reviewers

Found by the verification stage on #50; fixed here so it does not outlive the 0.19.0 release.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 13:59
@dzykovic dzykovic added the ai:processing An agent is working on this pull request label Oct 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The documentation accurately matches the implemented CLI behavior and validation.

Review effort: Balanced
Findings: None

What changed in this PR

Documents the existing intelligence init --dir behavior without changing runtime code.

Changes:

  • Clarifies the option’s purpose, manifest field, path restrictions, and new-project scope.
File Description
docs/​cli.md Adds the missing --dir name reference documentation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dzykovic

dzykovic commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Verification - PASS

head: b9f251b - steps: sha256:478c1c66 (## Verification section, 3 steps; docs/cli.md matched no qa_checks glob — none declared in profile/docs/qa-checks.md) - env: local (runtime archived from head into a scratch dir per the PR's own instructions: git archive b9f251b... cli engine packages | tar -x -C rt, driven via bash rt/cli/intelligence)

# Step Source Verdict Observed
1 Read the intelligence init section of docs/cli.md at head. Expected: a sentence explains --dir name as the content directory, recorded as project.intelligence_dir, a plain in-repo directory, new projects only. PR pass docs/cli.md:44 reads: "--dir name names the project's content directory — where its own rules, agents, skills and adapters live — when it should not be intelligence/; the name is recorded as project.intelligence_dir and must be a plain directory inside the repository, never an absolute path, a .. path or the .intelligence/ package store. Like --targets and --bare, it applies only when creating a new project." Matches expected exactly.
2 git init a and run init --dir ai --no-sync in a. Expected: exit 0; a/intelligence.yaml has intelligence_dir: "ai" under project: and project sources read ai/rules, ai/agents, ai/skills. PR pass Exit 0. intelligence.yaml contains project: {name: "a", intelligence_dir: "ai"} and sources: lists .intelligence/packages/@ainova-systems/sync/{rules,agents,skills} plus ai/{rules,agents,skills}.
3 In a second git init b, run init --dir ../outside. Expected: non-zero exit naming a plain directory inside the repo. Then run init --dir other in a (already a project). Expected: non-zero exit saying --dir applies only when creating a new project. PR pass init --dir ../outside in b: exit 1, ERROR: --dir must be a plain directory inside the repo, and not the package store. init --dir other in existing project a: exit 1, ERROR: --dir applies only when creating a new project. Both match expected.
- Negative probe (step 5, this skill): --dir .intelligence (the package store name) in a fresh project QA negative probe pass Exit 1, same "plain directory ... not the package store" message — matches the doc's explicit claim that the package store name is rejected.
- Negative probe: --dir <absolute path> in a fresh project QA negative probe pass Exit 1, same message — matches the doc's explicit claim that an absolute path is rejected.
- Negative probe: --dir "" (empty value) in a fresh project QA negative probe pass Exit 1, ERROR: --dir needs a directory name.

No qa_checks entry matched: docs/qa-checks.md does not exist and profile declares no qa_checks key, so no standing checks apply beyond the declared section (PR touches only docs/cli.md).

Failures

None.

@dzykovic dzykovic added the ai:verified Declared behavior verified on the reported head label Oct 7, 2026
@dzykovic

dzykovic commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Code review - CLEAN

head: b9f251b - base: main - files 1, +1/-1

Critical

None.

Warning

None.

Suggestion

None.

@dzykovic dzykovic added ai:reviewed Diff reviewed on the reported head ai:completed Agent work completed; required factors are fresh and removed ai:processing An agent is working on this pull request labels Oct 7, 2026
@dzykovic
dzykovic merged commit 28027e4 into main Oct 7, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:completed Agent work completed; required factors are fresh ai:reviewed Diff reviewed on the reported head ai:verified Declared behavior verified on the reported head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants