acting_for 0.1.0 → 0.1.1

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: 416659519f04a4cf5f2639684e6078fe51766cf1eb727ac7b9cde851207d4f9e
4
- data.tar.gz: b976be543b26602045c4f0db0152bbf5e051c028c54f18f70e2aae335f702a9e
3
+ metadata.gz: d170cbb1f6f0da3a2c26f3d55a55bb86b3533c8b27fe969f074efaee57536406
4
+ data.tar.gz: 1d86bdc3e38378efba926f9de1f56b6dce1fc120ae7f20a4685ca29fb184ea8b
5
5
  SHA512:
6
- metadata.gz: 5173d14fb39328a07f28957a365a4dbafe845f8dfbc4b2a73045f57f2c69a40ba6f96de9306b21a77d7b16d9cd10b6f136e93567f771bb5c0df0df082f4f11b3
7
- data.tar.gz: 31cb9911b3a8efa9d4a6e54a5c30fb4eff45f15e0f54a1007391727959d37b10503e8da45ff994cd26389d345d51e26651fa3fdc0f46c490f9ae503c91fb2bab
6
+ metadata.gz: 192ab4f6a44a4b05662307260191ccbc32fbe62109e5c63039ee6d171e498e983992244044653ce653d3c6fa9917bace46bfa96e7c173bee0abaa52bea3c0a76
7
+ data.tar.gz: bc98cace73ba017a48a3ed8bb76172e9d040509cf2cc2533bb30ea4cb793d5c3ca3fdb189e33240e48231d865460e13cfa96b801226246ec3bbff1973bb882d2
data/README.md CHANGED
@@ -14,7 +14,15 @@ AI AgentがPrincipalの代理として何をしてよいかを、委任された
14
14
 
15
15
  ## Status
16
16
 
17
- > **Implemented and CI verified; Not released.** The Public API, migrations, models, constraints, automatic Audit persistence, and formal test suite are implemented. CI covers Ruby 3.4 / 4.0, Rails 8.0 / 8.1, and PostgreSQL 16. The runnable setup was verified in a new Rails application in [D230](docs/DECISIONS.md#d230-runnable-quick-start-implementation). ActingFor has not been published to RubyGems.
17
+ > **Released: v0.1.0.** ActingFor 0.1.0 is published on [RubyGems](https://rubygems.org/gems/acting_for) and as [GitHub Release v0.1.0](https://github.com/cuichangquan/acting_for/releases/tag/v0.1.0). The Public API, migrations, models, constraints, automatic Audit persistence, and formal test suite are implemented. CI covers Ruby 3.4 / 4.0, Rails 8.0 / 8.1, and PostgreSQL 16.
18
+ >
19
+ > **0.1.1 release candidate:** `Decision#reason_code` is implemented, verified, and under release preparation. The latest published RubyGems version is still `0.1.0`; `0.1.1` has not been published yet.
20
+
21
+ ## ActingFor at a glance
22
+
23
+ ![ActingFor overview: Principal, Delegation, Agent, authorization decisions, AuditEvent, and Rails Host Application](docs/images/acting_for_overview.svg)
24
+
25
+ The diagram summarizes the v0.1 responsibility boundary: the Host authenticates/resolves the Agent and Principal and establishes trusted business data; ActingFor evaluates the Delegation and returns `allow`, `deny`, or `require_approval`. Approval workflow and business execution remain Host responsibilities.
18
26
 
19
27
  ## Why ActingFor?
20
28
 
@@ -168,19 +176,23 @@ decision = ActingFor.authorize(
168
176
  context: { amount: product.price }
169
177
  )
170
178
 
179
+ decision.status # => :allow
171
180
  decision.allowed? # => true when product.price is 8_900
181
+
182
+ # ActingFor 0.1.1 release candidate:
183
+ decision.reason_code # => :delegation_allowed
172
184
  ```
173
185
 
174
- Both calls use the implemented [v0.1 Public API](docs/public_api_v0_1.md). Context values that affect authorization must be established by the host, not trusted directly from an Agent request.
186
+ The released 0.1.0 behavior is documented in the [v0.1 Public API](docs/public_api_v0_1.md). The [0.1.1 `Decision#reason_code` API note](docs/decision_reason_code.md) documents the new final-reason accessor. Context values that affect authorization must be established by the host, not trusted directly from an Agent request. `reason_code` is not available in the published `0.1.0` gem.
175
187
 
176
188
  ## Quick Start
177
189
 
178
- ActingFor is not yet published to RubyGems. This pre-release setup installs the public GitHub `main` branch.
190
+ Install the released `0.1.0` gem from RubyGems.
179
191
 
180
192
  1. Add the Gem and install dependencies:
181
193
 
182
194
  ```ruby
183
- gem "acting_for", github: "cuichangquan/acting_for", branch: "main"
195
+ gem "acting_for", "~> 0.1.0"
184
196
  # Rails 8.0 uses JSON options removed in JSON 3.
185
197
  gem "json", "< 3"
186
198
  ```
@@ -240,7 +252,7 @@ ActingFor is not yet published to RubyGems. This pre-release setup installs the
240
252
  # => [:allow, true, false, false]
241
253
  ```
242
254
 
243
- For the complete runnable setup—including a new Rails application, public GitHub pre-release installation, host models, all three `¥8,900 / ¥20,000 / ¥50,000` outcomes, Audit behavior, and production security guidance—see [Getting Started](docs/getting_started.md).
255
+ For the complete runnable setup—including a new Rails application, RubyGems installation, host models, all three `¥8,900 / ¥20,000 / ¥50,000` outcomes, Audit behavior, and production security guidance—see [Getting Started](docs/getting_started.md).
244
256
 
245
257
  ## How does an external AI Agent reach ActingFor?
246
258
 
@@ -446,11 +458,15 @@ ActingFor is not an authentication provider, OAuth/OIDC server, Agent framework,
446
458
  Project documents are maintained primarily in Japanese:
447
459
 
448
460
  - [Getting Started](docs/getting_started.md)
461
+ - [Release Runbook](docs/release_runbook.md)
462
+ - [v0.1.0 Release Process and Verification Record](docs/release_process_v0_1_0.md)
463
+ - [v0.1.0 Release Notes](docs/release_notes_v0_1_0.md)
449
464
  - [Current State](docs/CURRENT_STATE.md)
450
465
  - [Progress](docs/PROGRESS.md)
451
466
  - [Project scope, roadmap, and terminology](docs/PROJECT.md)
452
467
  - [Decisions and rationale](docs/DECISIONS.md)
453
468
  - [v0.1 Public API](docs/public_api_v0_1.md)
469
+ - [Next-release Decision reason_code API](docs/decision_reason_code.md)
454
470
  - [v0.1 Security Model](docs/security_model_v0_1.md)
455
471
  - [v0.1 Domain Model](docs/domain_model_v0_1.md)
456
472
  - [v0.1 Gem Structure](docs/gem_structure_v0_1.md)
@@ -158,7 +158,7 @@ module ActingFor
158
158
  resource_type: resource_type,
159
159
  resource_id: resource_id,
160
160
  decision: decision_value,
161
- reason_code: ActingFor::AuditEvent::DECISION_REASONS.fetch(decision_value),
161
+ reason_code: decision.reason_code.to_s,
162
162
  matched_delegation_ids: matches.map(&:id).sort,
163
163
  sanitized_context: sanitized_context
164
164
  }
@@ -1,14 +1,20 @@
1
1
  module ActingFor
2
2
  class Decision
3
3
  STATUSES = %i[allow deny require_approval].freeze
4
- private_constant :STATUSES
4
+ REASON_CODES = {
5
+ allow: :delegation_allowed,
6
+ deny: :no_matching_delegation,
7
+ require_approval: :delegation_requires_approval
8
+ }.freeze
9
+ private_constant :STATUSES, :REASON_CODES
5
10
 
6
- attr_reader :status
11
+ attr_reader :status, :reason_code
7
12
 
8
13
  def initialize(status)
9
14
  raise ArgumentError, "invalid decision status" unless STATUSES.include?(status)
10
15
 
11
16
  @status = status
17
+ @reason_code = REASON_CODES.fetch(status)
12
18
  freeze
13
19
  end
14
20
 
@@ -1,3 +1,3 @@
1
1
  module ActingFor
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acting_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ChangQuan Cui