zyra 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c840095927f9a1b4b8ff2b3b74251f54673eb8b17095c46695ac5fe1f8095729
4
- data.tar.gz: 9b5f9c47cd321c3012df1e2d730a65c339edcbd013b3f04d64e52fa65bf9b501
3
+ metadata.gz: 773e9606d1f02c267ff707abca9b0661bd672c5ec19f1b67333b6a432cf9e956
4
+ data.tar.gz: fdf4728a97d11d49d8e99b11fe34238fed6a79ff0b888a01be389abb3f4a2d44
5
5
  SHA512:
6
- metadata.gz: 3fd0907f46f2d40623e3c909acc2409b4f7a968bd86ddafd678184e6a95564374c197402f60f88b20f8d02fa963fd2de130458acd6910f7f1b32a5c9c409b312
7
- data.tar.gz: d5cf211e2bb5bd4d5dd51d3d8f451fad5105befc811479f6ee5af146df7d9a3463be6068658ebdfe9d3a97e3163c2fa8e6c09fd230ef298fe4af44fcfd269c36
6
+ metadata.gz: 1a7d6860adefa6f16fa766b9afa23b9336de6b3e0677cd569a243fde254b9594a5618d276424b74ab34249e9038a9cddfe38f3b6aa492f40a0a7b585361dda5b
7
+ data.tar.gz: afe60d21cb865849333e107d6480d83d23bba337a2773f7dc23874b175b19290f6ec7b457b69790c3ede7f5fcce60a746e783d6c46a3e01b63f0a9afa7ab0992
data/.circleci/config.yml CHANGED
@@ -1,6 +1,5 @@
1
- version: 2
1
+ version: 2.1
2
2
  workflows:
3
- version: 2
4
3
  test-and-build:
5
4
  jobs:
6
5
  - test:
@@ -11,8 +10,13 @@ workflows:
11
10
  filters:
12
11
  tags:
13
12
  only: /.*/
13
+ - coverage-final:
14
+ requires: [test]
15
+ filters:
16
+ tags:
17
+ only: /.*/
14
18
  - build-and-release:
15
- requires: [test, checks]
19
+ requires: [test, checks, coverage-final]
16
20
  filters:
17
21
  tags:
18
22
  only: /\d+\.\d+\.\d+/
@@ -22,7 +26,7 @@ workflows:
22
26
  jobs:
23
27
  test:
24
28
  docker:
25
- - image: darthjee/circleci_rails_gems:2.1.0
29
+ - image: darthjee/circleci_ruby_3412:1.0.0
26
30
  environment:
27
31
  PROJECT: zyra
28
32
  steps:
@@ -32,13 +36,20 @@ jobs:
32
36
  command: bundle install
33
37
  - run:
34
38
  name: RSpec
35
- command: bundle exec rspec
39
+ command: CI=true bundle exec rspec
40
+ - run:
41
+ name: Upload coverage to Codacy (partial)
42
+ command: bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial -r coverage/lcov/project.lcov
43
+ coverage-final:
44
+ docker:
45
+ - image: darthjee/circleci_ruby_3412:1.0.0
46
+ steps:
36
47
  - run:
37
- name: Upload coverage to Codacy
38
- command: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage/lcov/project.lcov
48
+ name: Finalize coverage on Codacy
49
+ command: bash <(curl -Ls https://coverage.codacy.com/get.sh) final
39
50
  checks:
40
51
  docker:
41
- - image: darthjee/circleci_rails_gems:2.1.0
52
+ - image: darthjee/circleci_ruby_3412:1.0.0
42
53
  environment:
43
54
  PROJECT: zyra
44
55
  steps:
@@ -63,7 +74,7 @@ jobs:
63
74
  command: check_specs
64
75
  build-and-release:
65
76
  docker:
66
- - image: darthjee/circleci_rails_gems:2.1.0
77
+ - image: darthjee/circleci_ruby_3412:1.0.0
67
78
  environment:
68
79
  PROJECT: zyra
69
80
  steps:
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: architect
3
+ description: Zyra architect and coordinator. Use for cross-cutting tasks, multi-agent coordination, documentation, root-level files, or any task that spans more than one agent's scope.
4
+ tools: Read, Edit, Write, Bash, Agent
5
+ ---
6
+
7
+ You are the architect and coordinator for the zyra project — a Ruby gem for idempotent seeding.
8
+
9
+ ## Your scope
10
+
11
+ - `docs/agents/` — all project documentation
12
+ - Root-level files: `README.md`, `AGENTS.md`, `CLAUDE.md`, `Gemfile`, `zyra.gemspec`, `Rakefile`, `Makefile`, Docker files
13
+ - `.circleci/` and `.github/`
14
+ - Cross-cutting decisions and coordination of specialist agents
15
+
16
+ Everything that runs code must go through docker-compose (see the `ruby` agent for commands).
17
+
18
+ ## Specialist agents
19
+
20
+ Delegate implementation, exploration, and planning work to the right agent. Never implement, explore, or plan what belongs to a specialist yourself.
21
+
22
+ | Agent | Scope |
23
+ |-------|-------|
24
+ | `ruby` | `lib/`, `spec/`, `config/` — gem source, specs and tooling config |
25
+
26
+ ## How to coordinate
27
+
28
+ 1. **Break it down** — identify which parts belong to which agent.
29
+ 2. **Delegate exploration first** — dispatch the specialist before proposing an approach.
30
+ 3. **Sequence or parallelize** — parallel if independent, sequential otherwise.
31
+ 4. **Integrate** — verify cross-cutting concerns afterwards.
32
+ 5. **Update docs** — reflect architectural changes in `docs/agents/`.
33
+
34
+ ## Documentation (`docs/agents/`)
35
+
36
+ | File | Contents |
37
+ |------|----------|
38
+ | folder-structure.md | Top-level directory layout |
39
+ | architecture.md | Source layout and guidelines |
40
+ | contributing.md | Commit, PR and code organization rules |
41
+ | flow.md | Main runtime flow |
42
+ | plans/, issues/ | Plans and issue specs |
43
+
44
+ Keep documentation up to date after any architectural change. When an agent is added or its scope changes, update this file and `AGENTS.md`.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: ruby
3
+ description: Zyra Ruby specialist. Use for any task involving Ruby code, RSpec specs, YARD docs, RuboCop, or the gem's tooling config in lib/, spec/ and config/.
4
+ tools: Read, Edit, Write, Bash
5
+ ---
6
+
7
+ You are the ruby specialist for the zyra project — a Ruby gem for idempotent seeding (find-or-create by lookup keys).
8
+
9
+ ## Your scope
10
+
11
+ You own everything inside:
12
+
13
+ - `lib/` — gem source (`zyra.rb` entry point, `zyra/` namespace)
14
+ - `spec/` — RSpec unit and integration specs, factories and support
15
+ - `config/` — check_specs, yardstick and rubycritic config
16
+
17
+ Do NOT touch `docs/agents/`, `.circleci/`, `.github/`, Docker files or root-level docs; those belong to the architect.
18
+
19
+ ## Stack
20
+
21
+ - Ruby 3.3, RSpec, FactoryBot, RuboCop (+ rubocop-rspec), YARD + yardstick, Rubycritic, Jace (events), ActiveSupport
22
+
23
+ ## Commands
24
+
25
+ **Everything must be run through docker-compose** — never run ruby, bundle, rspec or rubocop directly on the host.
26
+
27
+ ```bash
28
+ docker-compose run --rm zyra /bin/bash -c 'bundle exec rspec'
29
+ docker-compose run --rm zyra /bin/bash -c 'rubocop'
30
+ docker-compose run --rm zyra /bin/bash -c 'bundle exec rake verify_measurements'
31
+ docker-compose run --rm circleci /bin/bash -c 'check_specs'
32
+ ```
33
+
34
+ Run `docker-compose run --rm zyra /bin/bash` for an interactive shell. The `circleci` service mirrors the CI image (provides `check_specs`, `check_readme.sh`, `rubycritic.sh`).
35
+
36
+ ## Conventions
37
+
38
+ - Always add specs for new/changed behaviour; files without tests go in `config/check_specs.yml` with a justification.
39
+ - Public APIs need YARD docstrings (`@param`, `@return`, `@example`).
40
+ - Small single-responsibility classes, composition over inheritance, Law of Demeter.
41
+ - snake_case files mirroring class names; public methods before private; dependencies injected via constructor.
42
+ - All code, commits and docs in English.
@@ -0,0 +1,3 @@
1
+ {
2
+ "version": "2.4.0"
3
+ }
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ set -x
4
+
5
+ docker-compose run --rm zyra /bin/bash -c 'bundle exec rspec'
6
+ docker-compose run --rm zyra /bin/bash -c 'rubocop'
7
+ docker-compose run --rm zyra /bin/bash -c 'bundle exec rake verify_measurements'
8
+ docker-compose run --rm circleci /bin/bash -c 'check_specs'
@@ -0,0 +1,10 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(auto-fix-all/scripts/wait_ci_and_merge.sh *)",
5
+ "Bash(auto-fix-issue/scripts/commit_change.sh *)",
6
+ "Bash(auto-fix-issue/scripts/run_checks.sh *)",
7
+ "Bash(git add *)"
8
+ ]
9
+ }
10
+ }
@@ -0,0 +1,32 @@
1
+ ```text
2
+ <type>(<scope>): <subject> (issue #<id>)
3
+
4
+ <optional body: what was done and why, if not obvious>
5
+
6
+ Addresses-Comment: <optional: URL of the PR comment this commit addresses>
7
+
8
+ Co-Authored-By: <AI model name> <AI model email>
9
+ Co-Authored-By: <agent> agent <agent email>
10
+ ```
11
+
12
+ Note: unlike the model line above (always the running AI model's own
13
+ canonical noreply address), the agent line's email is independently
14
+ configurable per agent via the "git.email" key (a template such as
15
+ "you+{agent}@example.com", with "{agent}" substituted for the actual
16
+ agent name, e.g. "architect" or "backend") in
17
+ .claude/state/arcanum-config.json (local) or
18
+ .claude/configuration/arcanum-repo-config.json (repo) — see
19
+ docs/guides/arcanum-repo-config.md. When "git.email" is unset, the agent
20
+ line falls back to the same address as the model line, reproducing the
21
+ old, single-shared-email template's output.
22
+
23
+ The model line above can be omitted entirely by setting the
24
+ "git.omit_model_coauthor" key to "true" in the same three locations
25
+ (local state, repo config, or global config — see
26
+ docs/guides/arcanum-repo-config.md) — the agent line is always still
27
+ emitted regardless of this setting.
28
+
29
+ This file's mere presence (as "commit_message_template-2.0.md", not its
30
+ content) is what switches the commit scripts onto this new, two-distinct-
31
+ email behavior — the content itself is never parsed at runtime, it is
32
+ purely human-facing documentation of the shape above.
@@ -0,0 +1,10 @@
1
+ ```text
2
+ <type>(<scope>): <subject> (issue #<id>)
3
+
4
+ <optional body: what was done and why, if not obvious>
5
+
6
+ Addresses-Comment: <optional: URL of the PR comment this commit addresses>
7
+
8
+ Co-Authored-By: <AI model name> <AI model email>
9
+ Co-Authored-By: <agent> agent <AI model email>
10
+ ```
@@ -1,80 +1 @@
1
- # Copilot Instructions for `zyra`
2
-
3
- ## About This Project
4
-
5
- `zyra` is a Ruby gem designed to be used from `db/seeds.rb` in Rails projects.
6
- You define how an entity is **found** (via lookup keys/attributes), and Zyra
7
- locates those entities using those keys. If the entity is not found, Zyra
8
- creates it with the additional attributes provided.
9
-
10
- This makes seeding **idempotent**: running `rake db:seed` repeatedly does not
11
- duplicate records, and it guarantees that required entities are always present
12
- in the database.
13
-
14
- ---
15
-
16
- ## Language
17
-
18
- - All PRs, PR descriptions, commit messages, review comments, documentation,
19
- and code **must be written in English**.
20
-
21
- ---
22
-
23
- ## Tests
24
-
25
- - **Always add tests** for new behaviour and for any change to existing
26
- behaviour.
27
- - Tests live in the `spec/` directory and use RSpec.
28
- - Files that cannot reasonably be tested (e.g. version constants, exception
29
- class definitions) must be listed in `config/check_specs.yml` under the
30
- `ignore:` key with a brief comment explaining why tests are not applicable.
31
-
32
- ---
33
-
34
- ## Documentation (YARD)
35
-
36
- - All **public APIs** must have YARD-compatible docstrings (`@param`, `@return`,
37
- `@example`, etc.).
38
- - Update `README.md` and any relevant usage docs whenever public behaviour
39
- changes.
40
-
41
- ---
42
-
43
- ## `config/check_specs.yml`
44
-
45
- Any file that is intentionally excluded from test coverage must be added to
46
- `config/check_specs.yml`:
47
-
48
- ```yaml
49
- ignore:
50
- - lib/zyra/version.rb # version constant only, no logic to test
51
- - lib/zyra/exceptions.rb # plain exception class definitions
52
- ```
53
-
54
- If you add a new file without tests, add its path here with a comment
55
- justifying the omission.
56
-
57
- ---
58
-
59
- ## Code Style — Small Classes & Single Responsibilities
60
-
61
- Follow the principles described by Sandi Metz (including those in
62
- *99 Bottles of OOP*):
63
-
64
- - Keep **methods short** and intention-revealing; a method should do one thing.
65
- - Prefer **extracting new objects** over adding conditionals to existing ones.
66
- - Favour **composition over inheritance**.
67
- - Name things after what they *do* or *represent*, not after implementation
68
- details.
69
-
70
- ---
71
-
72
- ## Law of Demeter
73
-
74
- Avoid Demeter violations (chained message sends across object boundaries):
75
-
76
- - **Pass collaborators** as arguments rather than reaching through objects.
77
- - **Wrap** external calls in intention-revealing methods so callers do not need
78
- to know the internal structure of their dependencies.
79
- - A method should only call methods on: `self`, objects passed as arguments,
80
- objects it creates, or direct component objects.
1
+ See [AGENTS.md](../AGENTS.md) for project instructions.
@@ -0,0 +1,17 @@
1
+ ## Summary
2
+
3
+ <!-- One sentence describing what this PR does -->
4
+
5
+ ## Problem
6
+
7
+ <!-- What problem does this solve? Why is this change needed? -->
8
+
9
+ ## Solution
10
+
11
+ <!-- How was the problem solved? What approach was taken? -->
12
+
13
+ ## Details
14
+
15
+ <!-- Optional: implementation notes, migration steps, caveats. Remove this section if not needed. -->
16
+
17
+ Fixes #
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ doc
7
7
  measurement/
8
8
  **/*.swp
9
9
  rubycritic/
10
+ .claude/state/
data/AGENTS.md ADDED
@@ -0,0 +1,121 @@
1
+ # Copilot Instructions for `zyra`
2
+
3
+ ## About This Project
4
+
5
+ `zyra` is a Ruby gem designed to be used from `db/seeds.rb` in Rails projects.
6
+ You define how an entity is **found** (via lookup keys/attributes), and Zyra
7
+ locates those entities using those keys. If the entity is not found, Zyra
8
+ creates it with the additional attributes provided.
9
+
10
+ This makes seeding **idempotent**: running `rake db:seed` repeatedly does not
11
+ duplicate records, and it guarantees that required entities are always present
12
+ in the database.
13
+
14
+ ---
15
+
16
+ ## Language
17
+
18
+ - All PRs, PR descriptions, commit messages, review comments, documentation,
19
+ and code **must be written in English**.
20
+
21
+ ---
22
+
23
+ ## Tests
24
+
25
+ - **Always add tests** for new behaviour and for any change to existing
26
+ behaviour.
27
+ - Tests live in the `spec/` directory and use RSpec.
28
+ - Files that cannot reasonably be tested (e.g. version constants, exception
29
+ class definitions) must be listed in `config/check_specs.yml` under the
30
+ `ignore:` key with a brief comment explaining why tests are not applicable.
31
+
32
+ ---
33
+
34
+ ## Documentation (YARD)
35
+
36
+ - All **public APIs** must have YARD-compatible docstrings (`@param`, `@return`,
37
+ `@example`, etc.).
38
+ - Update `README.md` and any relevant usage docs whenever public behaviour
39
+ changes.
40
+
41
+ ---
42
+
43
+ ## `config/check_specs.yml`
44
+
45
+ Any file that is intentionally excluded from test coverage must be added to
46
+ `config/check_specs.yml`:
47
+
48
+ ```yaml
49
+ ignore:
50
+ - lib/zyra/version.rb # version constant only, no logic to test
51
+ - lib/zyra/exceptions.rb # plain exception class definitions
52
+ ```
53
+
54
+ If you add a new file without tests, add its path here with a comment
55
+ justifying the omission.
56
+
57
+ ---
58
+
59
+ ## Code Style — Small Classes & Single Responsibilities
60
+
61
+ Follow the principles described by Sandi Metz (including those in
62
+ *99 Bottles of OOP*):
63
+
64
+ - Keep **methods short** and intention-revealing; a method should do one thing.
65
+ - Prefer **extracting new objects** over adding conditionals to existing ones.
66
+ - Favour **composition over inheritance**.
67
+ - Name things after what they *do* or *represent*, not after implementation
68
+ details.
69
+
70
+ ---
71
+
72
+ ## Law of Demeter
73
+
74
+ Avoid Demeter violations (chained message sends across object boundaries):
75
+
76
+ - **Pass collaborators** as arguments rather than reaching through objects.
77
+ - **Wrap** external calls in intention-revealing methods so callers do not need
78
+ to know the internal structure of their dependencies.
79
+ - A method should only call methods on: `self`, objects passed as arguments,
80
+ objects it creates, or direct component objects.
81
+
82
+ ## Documentation
83
+
84
+ All project documentation lives under [`docs/agents/`](docs/agents/):
85
+
86
+ | File | Contents |
87
+ |------|----------|
88
+ | [Folder Structure](docs/agents/folder-structure.md) | Top-level directory layout and the role of each folder. |
89
+ | [Architecture](docs/agents/architecture.md) | Source layout, modules, code style, and implementation guidelines. |
90
+ | [Contributing](docs/agents/contributing.md) | Commit guidelines, PR standards, code organization, and refactoring rules. |
91
+ | [Flow](docs/agents/flow.md) | Main runtime flow of the application. |
92
+ | [Plans](docs/agents/plans/) | Implementation plans for ongoing or upcoming features. |
93
+ | [Issues](docs/agents/issues/) | Detailed specs for open issues. |
94
+
95
+ ### Issues (`docs/agents/issues/`)
96
+
97
+ Each file documents an issue in detail. Naming convention:
98
+
99
+ ```
100
+ docs/agents/issues/<issue_id>_<issue_name>.md
101
+ ```
102
+
103
+ Example: `docs/agents/issues/5_release_docker_image.md` for issue #5.
104
+
105
+ ### Plans (`docs/agents/plans/`)
106
+
107
+ Each plan is a directory named after the issue ID and topic, containing one or more related files:
108
+
109
+ ```
110
+ docs/agents/plans/<issue_id>_<topic>/<related_files>.md
111
+ ```
112
+
113
+ Example: `docs/agents/plans/12_add-auth/plan.md` for issue #12.
114
+
115
+ ## Running commands
116
+
117
+ All commands (tests, lint, docs checks) **must be run through `docker-compose`**, never directly on the host. See `.claude/agents/ruby.md` for the exact commands.
118
+
119
+ ## Commit Attribution
120
+
121
+ Commit co-author trailers follow arcanum's resolved `git.omit_model_coauthor` and `git.remove_coauthors` config (check them with `/arcanum-check-config`); this overrides Claude Code's own attribution reminder for every commit, including ones written by hand.
data/CLAUDE.md ADDED
@@ -0,0 +1 @@
1
+ See [AGENTS.md](AGENTS.md) for project instructions.
data/Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
- FROM darthjee/scripts:0.6.0 as scripts
1
+ FROM darthjee/scripts:0.15.0 as scripts
2
2
 
3
- FROM darthjee/rails_gems:2.1.0 as base
3
+ FROM darthjee/rails_gems:3.0.0 as base
4
4
 
5
5
  COPY --chown=app:app ./ /home/app/app/
6
6
 
data/Gemfile CHANGED
@@ -4,25 +4,25 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
- gem 'activerecord', '7.2.2.1'
8
- gem 'bundler', '>= 2.5.13'
7
+ gem 'activerecord', '7.2.4'
8
+ gem 'bundler', '>= 4.0.24'
9
9
  gem 'database_cleaner', '2.1.0'
10
- gem 'factory_bot', '6.5.6'
10
+ gem 'factory_bot', '6.6.0'
11
11
  gem 'pry', '0.14.2'
12
12
  gem 'pry-nav', '1.0.0'
13
- gem 'rake', '13.2.1'
13
+ gem 'rake', '13.4.2'
14
14
  gem 'reek', '6.5.0'
15
15
  gem 'rspec', '3.13.2'
16
- gem 'rspec-core', '3.13.6'
17
- gem 'rspec-expectations', '3.13.5'
18
- gem 'rspec-mocks', '3.13.8'
19
- gem 'rspec-support', '3.13.7'
20
- gem 'rubocop', '1.85.1'
21
- gem 'rubocop-rspec', '3.9.0'
16
+ gem 'rspec-core', '3.13.7'
17
+ gem 'rspec-expectations', '3.13.6'
18
+ gem 'rspec-mocks', '3.13.9'
19
+ gem 'rspec-support', '3.13.8'
20
+ gem 'rubocop', '1.92.2'
21
+ gem 'rubocop-rspec', '3.10.2'
22
22
  gem 'rubycritic', '5.0.0'
23
23
  gem 'simplecov', '0.22.0'
24
24
  gem 'simplecov-html', '0.13.2'
25
25
  gem 'simplecov-lcov', '0.9.0'
26
- gem 'sqlite3', '1.4.2'
27
- gem 'yard', '0.9.38'
26
+ gem 'sqlite3', '2.10.2'
27
+ gem 'yard', '0.9.45'
28
28
  gem 'yardstick', '0.9.9'
data/README.md CHANGED
@@ -14,13 +14,13 @@ entity exists without having to reinsert it every time in the database
14
14
  The process is done by registering a model class, then performing
15
15
  a creation in case of missing the entry
16
16
 
17
- **Current Release**: [1.3.0](https://github.com/darthjee/zyra/tree/1.3.0)
17
+ **Current Release**: [1.4.0](https://github.com/darthjee/zyra/tree/1.4.0)
18
18
 
19
- **Next release**: [1.4.0](https://github.com/darthjee/zyra/compare/1.3.0...main)
19
+ **Next release**: [1.5.0](https://github.com/darthjee/zyra/compare/1.4.0...main)
20
20
 
21
21
  Yard Documentation
22
22
  -------------------
23
- [https://www.rubydoc.info/gems/zyra/1.3.0](https://www.rubydoc.info/gems/zyra/1.3.0)
23
+ [https://www.rubydoc.info/gems/zyra/1.4.0](https://www.rubydoc.info/gems/zyra/1.4.0)
24
24
 
25
25
  Installation
26
26
  ---------------
@@ -0,0 +1,9 @@
1
+ # Arcanum Split Issue
2
+
3
+ A checklist of concerns to consider when splitting a broad issue into sub-issues via `/arcanum-split-issue`. Not exhaustive — adjust or extend the list for this project's needs.
4
+
5
+ - **Sub-issue granularity** — is each sub-issue independently workable, or does it still depend on another sub-issue landing first?
6
+ - **Standalone clarity** — does each sub-issue stand on its own, without requiring the reader to have the parent issue open to understand it?
7
+ - **Shared contracts** — interfaces, schemas, or config keys touched by more than one sub-issue, and who owns getting them right first.
8
+ - **Sequencing** — is there a natural order sub-issues should be implemented/merged in, or can they proceed in parallel?
9
+ - **Responsible agents** — which specialist agent(s) each sub-issue is likely to fall to.
@@ -0,0 +1,31 @@
1
+ # Architecture
2
+
3
+ ## Overview
4
+
5
+ Zyra is a Ruby gem for idempotent seeding. A model class is registered with
6
+ lookup keys; `find_or_create` looks the record up by those keys and creates it
7
+ (with the remaining attributes) only if it is missing. Lifecycle hooks are
8
+ supported through `Jace` events (e.g. `:build`).
9
+
10
+ ## Source Code Layout
11
+
12
+ All application source code lives under `lib/`.
13
+
14
+ ### `lib/zyra.rb`
15
+
16
+ Entry point. Declares autoloads and exposes the public API (`Zyra.register`,
17
+ `Zyra.find_or_create`, etc.) delegating to a registry.
18
+
19
+ ### `lib/zyra/`
20
+
21
+ - `registry.rb` — Public. Stores registered `FinderCreator`s by key.
22
+ - `finder_creator.rb` — Ensures an entry exists: finds via `Finder`, else builds via `Creator`.
23
+ - `finder.rb` — Looks a model up in the DB using only the configured keys; triggers events.
24
+ - `creator.rb` — Builds and saves a model from attributes, running the block and events.
25
+ - `exceptions.rb` — Exception classes.
26
+ - `version.rb` — Version constant.
27
+
28
+ ## Guidelines
29
+
30
+ Small single-responsibility classes, composition over inheritance, Law of
31
+ Demeter, YARD docs on public APIs, specs for all behaviour (see `AGENTS.md`).
@@ -0,0 +1,141 @@
1
+ # Contributing
2
+
3
+ ## Commit Guidelines
4
+
5
+ - **Atomic and Unitary:** Each commit must represent a single logical change.
6
+ *Example:*
7
+ - Good: `Add Finder#find_by_keys method`
8
+ - Bad: `Add Finder#find_by_keys and refactor Registry logic`
9
+ - **No Unrelated Changes:** Do not mix unrelated changes in the same commit.
10
+ - **Separate Refactoring:** Whenever possible, separate refactoring commits from new feature or bugfix commits.
11
+
12
+ ## Pull Requests
13
+
14
+ - **Descriptive Summary:** Every PR must include a clear and descriptive summary of its purpose and changes.
15
+ - **PR Description Files:** If a description cannot be provided directly in the PR, generate a file with the PR description (e.g., `docs/issues/<pr_number>_description.md`), but do not commit this file.
16
+
17
+ ## Definition of Done for PRs
18
+
19
+ A PR is considered complete when:
20
+
21
+ - The stated objective has been achieved.
22
+ - All tests are passing.
23
+ - Linting passes without errors.
24
+ - Code coverage is as high as reasonably possible.
25
+ - Public APIs have YARD docs; README/usage docs are updated for public behaviour changes.
26
+ - Code is not overly complex:
27
+ - Classes and methods should have clear, focused responsibilities.
28
+ - Methods should be small and do exactly one thing. If a method is growing, extract private helpers or separate classes.
29
+ - *Example:*
30
+
31
+ ```ruby
32
+ # Good: each method does one thing
33
+ class Worker
34
+ def fetch_job; end
35
+ def process_job(job); end
36
+ end
37
+
38
+ # Bad: method does too much
39
+ class Worker
40
+ def run
41
+ fetch_job
42
+ process_job
43
+ send_metrics
44
+ cleanup
45
+ end
46
+ end
47
+ ```
48
+
49
+ - This applies primarily to source code. For specs, refactor only if there is excessive duplication.
50
+
51
+ ### CI Checks
52
+
53
+ Before a PR is considered complete, all CI checks relevant to the modified parts of the project must pass locally. The project is a single gem, so CircleCI runs these jobs on every change:
54
+
55
+ | Modified area | CircleCI job | Local commands |
56
+ |---|---|---|
57
+ | `lib/`, `spec/` | `test` | `bundle exec rspec` |
58
+ | any | `checks` | `rubocop`, `bundle exec rake verify_measurements`, `check_readme.sh`, `rubycritic.sh`, `check_specs` |
59
+
60
+ Locally, run inside Docker: `make tests` (opens a shell), then e.g. `rspec && yard && rake yardstick_measure && rake verify_measurements`.
61
+
62
+ When **planning how to resolve an issue**, include a final step listing the CI commands to run before opening a PR.
63
+
64
+ ## Code Organization
65
+
66
+ ### File Responsibility: Class Declarers vs Scripts
67
+
68
+ Every source file (excluding specs) must act as a **class declarer** — define one or more classes or modules, and not execute logic or side effects at load time. The only entrypoint is `lib/zyra.rb`, which declares autoloads and the public API.
69
+
70
+ ```ruby
71
+ # Good: class declarer
72
+ class Router
73
+ def register(app); end
74
+ end
75
+
76
+ # Bad: script — executes logic at load time
77
+ router = Router.new
78
+ router.register(app)
79
+ ```
80
+
81
+ Specs are exempt.
82
+
83
+ ### File Naming: snake_case for Class Files
84
+
85
+ Files defining a class use **snake_case** matching the class name, and live under the module path (e.g. `Zyra::FinderCreator` → `lib/zyra/finder_creator.rb`). Specs mirror this: `spec/lib/zyra/finder_creator_spec.rb`.
86
+
87
+ ### Method Order: Public Before Private
88
+
89
+ Public methods are declared before private methods; private helpers go at the end of the class body.
90
+
91
+ ```ruby
92
+ # Good
93
+ class Worker
94
+ def run
95
+ prepare
96
+ execute
97
+ end
98
+
99
+ private
100
+
101
+ def prepare; end
102
+ def execute; end
103
+ end
104
+ ```
105
+
106
+ ## Dependency Injection
107
+
108
+ Classes must receive their dependencies (data, configuration, collaborators) as constructor arguments. A class must never read files or environment variables on its own; the entry point loads configuration and passes it down. This keeps every class independently testable (as `Finder` and `Creator` do with `event_registry:`).
109
+
110
+ ```ruby
111
+ # Good
112
+ class Router
113
+ def initialize(data)
114
+ @data = data
115
+ end
116
+ end
117
+
118
+ # Bad: loads its own config
119
+ class Router
120
+ def build
121
+ data = YAML.load_file('./data.yml')
122
+ end
123
+ end
124
+ ```
125
+
126
+ ## Refactoring Guidelines
127
+
128
+ When refactoring, aim to:
129
+
130
+ - **Reduce Code Duplication:** e.g. move repeated spec setup into factories (`spec/support/factories`).
131
+
132
+ ```ruby
133
+ # Good
134
+ create(:category, id: 2)
135
+ # Bad: the same hash repeated in many specs
136
+ Category.new(id: 2, name: 'Books')
137
+ ```
138
+
139
+ - **Prefer Extracting Objects** over adding conditionals (Sandi Metz).
140
+ - **Avoid Demeter violations:** wrap chained calls in intention-revealing methods.
141
+ - **Keep behaviour unchanged** and covered by passing specs throughout.
@@ -0,0 +1,5 @@
1
+ # Flow
2
+
3
+ ## Overview
4
+
5
+ _Describe the main runtime flow of the application here._
@@ -0,0 +1,33 @@
1
+ # Folder Structure
2
+
3
+ ## Project Root
4
+
5
+ | Directory / File | Description |
6
+ |---|---|
7
+ | `lib/` | Gem source code (`zyra.rb` entry point and `zyra/` namespace). |
8
+ | `spec/` | RSpec suite: unit specs, integration specs, and shared support. |
9
+ | `config/` | Tooling configuration (spec-coverage check, yardstick, rubycritic). |
10
+ | `docs/agents/` | Documentation for agents: architecture, flow, issues, plans. |
11
+ | `.circleci/` | CI pipeline and release configuration. |
12
+ | `.github/` | PR/commit templates and Copilot instructions. |
13
+ | `Dockerfile`, `Dockerfile.circleci`, `docker-compose.yml`, `Makefile` | Docker-based dev/test environment. |
14
+ | `zyra.gemspec`, `Gemfile`, `Rakefile` | Gem packaging, dependencies and tasks. |
15
+ | `.rubocop.yml`, `.rubocop_todo.yml`, `.rspec` | Lint and test runner configuration. |
16
+ | `README.md`, `zyra.jpg`, `LICENSE` | Public docs, logo, license. |
17
+ | `AGENTS.md`, `CLAUDE.md` | Shared agent instructions (CLAUDE.md points to AGENTS.md). |
18
+
19
+ ## spec/
20
+
21
+ | Subdirectory | Description |
22
+ |---|---|
23
+ | `lib/` | Unit specs mirroring `lib/`. |
24
+ | `integration/` | Specs validating README and YARD examples. |
25
+ | `support/` | Factories, models, schema and shared examples. |
26
+
27
+ ## config/
28
+
29
+ | File | Description |
30
+ |---|---|
31
+ | `check_specs.yml` | Files ignored by the "every file has a spec" check. |
32
+ | `yardstick.rb`, `yardstick.yml` | YARD documentation coverage checks. |
33
+ | `rubycritc.rb` | Rubycritic config. |
@@ -0,0 +1,10 @@
1
+ # Issue Enhancement
2
+
3
+ A checklist of concerns to consider when fleshing out a vague issue idea (tagged `Idea`/`Writting`) before it reaches the `Created` stage. Not exhaustive — adjust or extend the list for this project's needs.
4
+
5
+ - **Scope boundaries** — what's explicitly in scope and what's explicitly out.
6
+ - **Alternative solutions** — other ways to solve the same problem, and why this one was chosen.
7
+ - **Edge cases** — inputs, states, or timing the happy path doesn't cover.
8
+ - **Backward compatibility** — whether this breaks existing behavior, data, or integrations.
9
+ - **Testing strategy** — how the change will be verified.
10
+ - **Performance & security considerations** — anything relevant to load, latency, or attack surface.
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+
data/lib/zyra/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zyra
4
- VERSION = '1.3.0'
4
+ VERSION = '1.4.0'
5
5
  end
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env bash
2
+ # Usage: scripts/bump_version.sh [major|minor|patch|X.Y.Z]
3
+ # Without arguments, bumps the patch version of the current version.
4
+
5
+ set -euo pipefail
6
+
7
+ ROOT="$(git rev-parse --show-toplevel)"
8
+ README="$ROOT/README.md"
9
+ VERSION_FILE="$ROOT/lib/zyra/version.rb"
10
+ LOCKFILE="$ROOT/Gemfile.lock"
11
+ GEM="zyra"
12
+
13
+ current=$(grep -oE "VERSION = '[0-9]+\.[0-9]+\.[0-9]+'" "$VERSION_FILE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
14
+ IFS='.' read -r cmajor cminor cpatch <<< "$current"
15
+
16
+ arg="${1:-patch}"
17
+
18
+ case "$arg" in
19
+ major) new_version="$((cmajor + 1)).0.0" ;;
20
+ minor) new_version="${cmajor}.$((cminor + 1)).0" ;;
21
+ patch) new_version="${cmajor}.${cminor}.$((cpatch + 1))" ;;
22
+ *) new_version="$arg" ;;
23
+ esac
24
+
25
+ # Validate semver format
26
+ if ! echo "$new_version" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
27
+ echo "Error: version must be major, minor, patch or X.Y.Z" >&2
28
+ exit 1
29
+ fi
30
+
31
+ # Next release: following minor
32
+ IFS='.' read -r major minor _patch <<< "$new_version"
33
+ next_release="${major}.$((minor + 1)).0"
34
+
35
+ echo "Current version: $current"
36
+ echo "New version: $new_version"
37
+ echo "Next release: $next_release"
38
+
39
+ # version.rb
40
+ sed -i '' "s|VERSION = '[0-9.]*'|VERSION = '${new_version}'|" "$VERSION_FILE"
41
+
42
+ # README: YARD docs link
43
+ sed -i '' \
44
+ "s|rubydoc.info/gems/${GEM}/[0-9.]*|rubydoc.info/gems/${GEM}/${new_version}|g" \
45
+ "$README"
46
+
47
+ # README: Current Release line
48
+ sed -i '' \
49
+ "s|\*\*Current Release\*\*: \[[0-9.]*\](https://github.com/darthjee/zyra/tree/[0-9.]*)|**Current Release**: [${new_version}](https://github.com/darthjee/zyra/tree/${new_version})|" \
50
+ "$README"
51
+
52
+ # README: Next release line
53
+ sed -i '' \
54
+ "s|\*\*Next release\*\*: \[[0-9.]*\](https://github.com/darthjee/zyra/compare/[0-9.]*\.\.\.main)|**Next release**: [${next_release}](https://github.com/darthjee/zyra/compare/${new_version}...main)|" \
55
+ "$README"
56
+
57
+ # Gemfile.lock
58
+ if [ -f "$LOCKFILE" ]; then
59
+ sed -i '' "s|^\( *${GEM} (\)[0-9.]*)|\1${new_version})|" "$LOCKFILE"
60
+ fi
61
+
62
+ echo "Done."
data/zyra.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
  gem.require_paths = ['lib']
20
20
 
21
21
  gem.add_dependency 'activesupport', '~> 7.2.x'
22
- gem.add_dependency 'jace', '>= 0.1.2'
22
+ gem.add_dependency 'jace', '>= 1.0.0'
23
23
 
24
24
  gem.metadata['rubygems_mfa_required'] = 'true'
25
25
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zyra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DarthJee
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-03-10 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -30,14 +29,14 @@ dependencies:
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: 0.1.2
32
+ version: 1.0.0
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: 0.1.2
39
+ version: 1.0.0
41
40
  description: Gem for seeding data in the database
42
41
  email:
43
42
  - darthjee@gmail.com
@@ -46,12 +45,22 @@ extensions: []
46
45
  extra_rdoc_files: []
47
46
  files:
48
47
  - ".circleci/config.yml"
48
+ - ".claude/agents/architect.md"
49
+ - ".claude/agents/ruby.md"
50
+ - ".claude/configuration/arcanum-repo-config.json"
51
+ - ".claude/scripts/check_ruby.sh"
52
+ - ".claude/settings.json"
53
+ - ".github/commit_message_template-2.0.md"
54
+ - ".github/commit_message_template.md"
49
55
  - ".github/copilot-instructions.md"
56
+ - ".github/pull_request_template.md"
50
57
  - ".github/zyra-usage.md"
51
58
  - ".gitignore"
52
59
  - ".rspec"
53
60
  - ".rubocop.yml"
54
61
  - ".rubocop_todo.yml"
62
+ - AGENTS.md
63
+ - CLAUDE.md
55
64
  - Dockerfile
56
65
  - Dockerfile.circleci
57
66
  - Gemfile
@@ -64,6 +73,14 @@ files:
64
73
  - config/yardstick.rb
65
74
  - config/yardstick.yml
66
75
  - docker-compose.yml
76
+ - docs/agents/arcanum-split-issue.md
77
+ - docs/agents/architecture.md
78
+ - docs/agents/contributing.md
79
+ - docs/agents/flow.md
80
+ - docs/agents/folder-structure.md
81
+ - docs/agents/issue-enhancement.md
82
+ - docs/agents/issues/.gitkeep
83
+ - docs/agents/plans/.gitkeep
67
84
  - lib/zyra.rb
68
85
  - lib/zyra/creator.rb
69
86
  - lib/zyra/exceptions.rb
@@ -71,6 +88,7 @@ files:
71
88
  - lib/zyra/finder_creator.rb
72
89
  - lib/zyra/registry.rb
73
90
  - lib/zyra/version.rb
91
+ - scripts/bump_version.sh
74
92
  - spec/integration/readme/.keep
75
93
  - spec/integration/readme/zyra_spec.rb
76
94
  - spec/integration/yard/.keep
@@ -98,7 +116,6 @@ homepage: https://github.com/darthjee/zyra
98
116
  licenses: []
99
117
  metadata:
100
118
  rubygems_mfa_required: 'true'
101
- post_install_message:
102
119
  rdoc_options: []
103
120
  require_paths:
104
121
  - lib
@@ -113,8 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
130
  - !ruby/object:Gem::Version
114
131
  version: '0'
115
132
  requirements: []
116
- rubygems_version: 3.5.9
117
- signing_key:
133
+ rubygems_version: 4.0.23
118
134
  specification_version: 4
119
135
  summary: Gem for seeding data in the database
120
136
  test_files: []