intent-record 1.2.0 → 2.0.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 +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +5 -3
- data/docs/feature-findings.md +115 -0
- data/lib/intent_record/backfill/commit_specs.rb +4 -0
- data/lib/intent_record/blame/spans.rb +1 -0
- data/lib/intent_record/cli/usage.rb +3 -0
- data/lib/intent_record/commands/attach.rb +5 -1
- data/lib/intent_record/commands/blame.rb +2 -0
- data/lib/intent_record/commands/record.rb +4 -0
- data/lib/intent_record/input_validator.rb +25 -2
- data/lib/intent_record/linkers/link_keys.rb +11 -0
- data/lib/intent_record/linkers/stakeholder_linker.rb +1 -1
- data/lib/intent_record/version.rb +1 -1
- metadata +16 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5239cbb8afea221a339fcc6f4e5aef7c157027df3a85807c2865f72392e6920e
|
|
4
|
+
data.tar.gz: 3c49aca4a8542ad0d4f65cb34bc969bb24d170c76de5c1de12d580df3dc4d356
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a07a693526fd43910b64889c03cf0a393310e306ecb125575fdf8ad8ebd29e507b8eac35a9957d0503839b734d404cb6e34077007e5560a513136cf43c7bf7af
|
|
7
|
+
data.tar.gz: 4867b4b8379e6f7d362e164dd63f9474e9c1d3fbe6ee84849a555d7f625023b39af8b78bcccc9be7af2a2ccbebc5b782fb3d87748b0cc9da32064cb63f720074
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@ Notable changes, one section per released version. The format follows
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
## 2.0.0 - 2026-11-11
|
|
10
|
+
|
|
11
|
+
A major version because input that 1.2.0 accepted is now refused. Nothing else in the contract changes: every command, flag and output key works as before.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- `record`, `attach`, `blame` and `backfill` refuse a JSON key they do not read, at the top level or inside an entry, and the error names the keys they accept. A misspelt key used to be ignored, so a link the caller asked for was never made while the command still exited 0. A payload that carries extra keys on purpose now fails and has to drop them, for example one built by editing `show` output, which carries `intent_id`, `created_at` and `related_by_intents`.
|
|
16
|
+
- `related_intents`, the name the output uses, is refused on input with a pointer to `related_intent_ids` rather than accepted as a second spelling.
|
|
17
|
+
- `serve` runs on Puma 8, up from 6.
|
|
18
|
+
|
|
9
19
|
## 1.2.0 - 2026-09-20
|
|
10
20
|
|
|
11
21
|
### Added
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://badge.fury.io/rb/intent-record)
|
|
4
4
|
[](https://github.com/beatmadsen/intent-record/actions/workflows/ci.yml)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
A local store for the reasoning behind code changes, linked to commits and tickets.
|
|
7
7
|
|
|
8
8
|
A commit message says what changed. The intent record says why: what the agent (or person) was trying to achieve, which ticket or design page asked for it, and which earlier change it builds on. intent-record stores that in a local SQLite database, links it to the commit hash, and answers the questions people and agents ask later.
|
|
9
9
|
|
|
@@ -86,6 +86,8 @@ JSON in on stdin where input is needed, JSON out on stdout, exit code 0 on succe
|
|
|
86
86
|
}
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
A key this shape does not list is refused with the list of keys that are accepted, so a misspelt key fails the command instead of silently dropping the link it asked for. The same holds inside each entry, and for the `blame` and `backfill` input. The output lists related intents under `related_intents`, but the input key is `related_intent_ids`, and the error says so if you send the output name.
|
|
90
|
+
|
|
89
91
|
Options take either `--name value` or `--name=value`. Unknown options and stray arguments are rejected rather than ignored.
|
|
90
92
|
|
|
91
93
|
`lookup` without `--vcs` searches every system and prefers an exact id match over a prefix match. Git commits must be full SHA-1 or SHA-256 hashes; they are stored lowercase. Prefix lookup applies to hash-based systems only (git, mercurial, fossil, sapling, pijul, darcs), so a Perforce changelist `1234` never matches `12345`. URIs are normalised (lowercase scheme and host, no trailing slash) and system names are lowercased and hyphenated, so `Jira` and `jira`, or a ticket URL with and without a trailing slash, are one source. A later non-blank `title` for a source replaces the stored one.
|
|
@@ -272,9 +274,9 @@ Related-intent links may form cycles; the store records what it is told and leav
|
|
|
272
274
|
|
|
273
275
|
## Agent integration
|
|
274
276
|
|
|
275
|
-
Any agent that can run a process and read stdout can use it. Record after each commit, `
|
|
277
|
+
Any agent that can run a process and read stdout can use it. Record after each commit, `blame` before changing lines whose history you do not know, `by-source` when picking up a ticket that has history, and `backfill` once when adopting the tool on a repository that already has history.
|
|
276
278
|
|
|
277
|
-
For Claude Code there is a skill that says when to do each of those and what a usable `body` contains: [intent-record](https://github.com/beatmadsen/claude-skills/tree/main/skills/intent-record), in the [beatmadsen/claude-skills](https://github.com/beatmadsen/claude-skills) collection. Install it for every project you work on:
|
|
279
|
+
For Claude Code and Cursor there is a skill that says when to do each of those and what a usable `body` contains, with a hook that shows an agent the intents behind the lines it reads: [intent-record](https://github.com/beatmadsen/claude-skills/tree/main/skills/intent-record), in the [beatmadsen/claude-skills](https://github.com/beatmadsen/claude-skills) collection. Install it for every project you work on:
|
|
278
280
|
|
|
279
281
|
```bash
|
|
280
282
|
git clone https://github.com/beatmadsen/claude-skills.git ~/claude-skills
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Feature findings
|
|
2
|
+
|
|
3
|
+
A rulebook for building intent-record features that put records in front of agents at
|
|
4
|
+
the moment of an edit. Each rule was decided by a rendered pentsection search (eleven
|
|
5
|
+
rounds, each judged by a panel of three agents on real fun-ci records) and should hold
|
|
6
|
+
after the candidates are forgotten. The rounds and their candidates are in the git
|
|
7
|
+
history of `design/features/`; this file keeps only what they decided.
|
|
8
|
+
|
|
9
|
+
## What to build first
|
|
10
|
+
|
|
11
|
+
- A reading feature earns its place only if a record changes an edit, and the store has
|
|
12
|
+
no sign one ever has. Build the collision guard these rules describe first. Before it,
|
|
13
|
+
every reader (blame, search, the guard) needs to tell a backfilled stub from a real
|
|
14
|
+
record, without deleting the stub or the ticket links backfill recovered.
|
|
15
|
+
- A hash that resolves in no repository never comes out of blame, so it cannot mislead
|
|
16
|
+
the guard; the records that can are false sentences on real commits, which no hash
|
|
17
|
+
check sees. Checking a hash resolves before recording is still worth having, and it
|
|
18
|
+
belongs to the skill: the tool runs no VCS and stores no repository identity.
|
|
19
|
+
- Log every stop and every ack the guard makes. The next decision about it should rest on
|
|
20
|
+
how often it fires and how often it changes an edit.
|
|
21
|
+
|
|
22
|
+
## Showing records
|
|
23
|
+
|
|
24
|
+
- A record's value to a reader sits in a few sentences of its body: what was ruled out,
|
|
25
|
+
what would break, which constraint forced the shape. A view that repeats whole bodies
|
|
26
|
+
per line change buries them; seven decisions read as fifteen spans of JSON.
|
|
27
|
+
- Do not read the stub count as neglect at writing time. The stubs are backfill; the
|
|
28
|
+
records written at the time have bodies. What goes wrong at writing time is false
|
|
29
|
+
sentences and invented hashes, and a feature that makes accepting a draft easier
|
|
30
|
+
makes that worse.
|
|
31
|
+
|
|
32
|
+
## Delivering records
|
|
33
|
+
|
|
34
|
+
- An agent does not ask. Nothing in the store shows an intent read before an edit,
|
|
35
|
+
although the skill and the owner's rules both say to blame first. A reading feature
|
|
36
|
+
that waits to be called is not used; the record has to arrive at the edit.
|
|
37
|
+
- The moment belongs to the skill (a hook on the agent's edit); the tool renders what
|
|
38
|
+
that moment shows. The tool stays free of any notion of when.
|
|
39
|
+
- Labelling sentences as "ruled out" or "constraint" by reading prose at read time is
|
|
40
|
+
inference, which the tool refuses. Structure a reader relies on is written at record
|
|
41
|
+
time.
|
|
42
|
+
- Say nothing where nothing is recorded. A "no reason recorded" line would appear on
|
|
43
|
+
most files of any older repository, and an agent that learns to skim a hook's output
|
|
44
|
+
skims its warnings too. The gap belongs in the on-demand view, not the push. A
|
|
45
|
+
backfilled stub counts as nothing recorded: it carries no reasoning, and stubs are
|
|
46
|
+
most lines of any older history.
|
|
47
|
+
- Scope a pushed warning to the lines the edit changes, and phrase it as the collision
|
|
48
|
+
it is ("this edit changes line 35, which mjtLNZa pins"). A briefing of everything in
|
|
49
|
+
the file put the one decision that mattered fourth of seven.
|
|
50
|
+
- A pre-edit hook already sees the new text, so a collision is caught before the edit
|
|
51
|
+
lands; before and after are one tool call apart, not two features.
|
|
52
|
+
- A warning claims only what a record says or what a run produced. The tool cannot
|
|
53
|
+
judge code ("interpolates unquoted"). It may state text facts about an edit ("removes
|
|
54
|
+
the text `stage_command` from this line").
|
|
55
|
+
- Say what the runs showed and stop: where the guard lives, whether its test failed or
|
|
56
|
+
only errored, and the text fact about the edit, in as few words as an agent will read.
|
|
57
|
+
- Trust evidence is only worth showing if it bears on whether the sentence is true. Age
|
|
58
|
+
and author do not; a test that bites, or a later dispute, do.
|
|
59
|
+
- Evidence is linked, not edited in: a test is a source with system `test`, so an old
|
|
60
|
+
record gains one by `attach` and stays unedited.
|
|
61
|
+
|
|
62
|
+
## When an edit collides with a record
|
|
63
|
+
|
|
64
|
+
- A collision stops the edit. A warning that stops nothing is read past; a stop that
|
|
65
|
+
costs nothing to release teaches the agent to send every edit twice.
|
|
66
|
+
- Release it with something the agent must mean and a hook can see: an exact command
|
|
67
|
+
naming the kind of override (`within`, or `wrong` with a test). A repeated edit is a
|
|
68
|
+
reflex; a message that merely names the record opens the stop in passing; Claude
|
|
69
|
+
Code's Edit takes no reason argument.
|
|
70
|
+
- That command holds session state, so it belongs to the skill, not the tool.
|
|
71
|
+
- `within` is for an edit that must still change the pinned line while keeping what the
|
|
72
|
+
record protects; an agent that routes around the line does not collide again.
|
|
73
|
+
- Never write an agent's edit-time reason onto the record it collided with. It is typed
|
|
74
|
+
in a hurry to get past a stop, can misread the record, is tied to no commit, and
|
|
75
|
+
outlives a reverted edit.
|
|
76
|
+
- The reason for going against or around a record belongs in the intent of the change
|
|
77
|
+
that acts on it, linked to the old record as related. Blame already shows
|
|
78
|
+
`related_by_intents`, so the old record's next reader reaches it with no new link kind.
|
|
79
|
+
- Never make an agent record a `within` it has just said it does not mean; that writes a
|
|
80
|
+
false sentence on purpose.
|
|
81
|
+
|
|
82
|
+
## Tests as evidence
|
|
83
|
+
|
|
84
|
+
- A test named in a record vouches for the unit it exercises, not for the line the
|
|
85
|
+
record is shown on. Measured on fun-ci: `mjtLNZa`'s test fails with the quoting in
|
|
86
|
+
`ProjectConfig#stage_command` undone and passes with stage_runner.rb line 35 rewritten
|
|
87
|
+
unquoted. Never push a named test's green run as clearance.
|
|
88
|
+
- A test pins a line only if reverting that commit's own hunk on the line turns it red.
|
|
89
|
+
Revert mechanically; a break the skill writes is a judgement about code, and two runs
|
|
90
|
+
can disagree.
|
|
91
|
+
- A reverted hunk that removes an added method makes the test error, not fail (measured
|
|
92
|
+
on e2faf98: NoMethodError). An error shows the test depends on the code, not that it
|
|
93
|
+
checks the behaviour; only a failure pins.
|
|
94
|
+
- A collision on a line no test pins is a missing test, and the collision is the moment
|
|
95
|
+
to write it: green on today's code, then red on the edit.
|
|
96
|
+
- Evidence that is a run, not a sentence, may reach an old record: a test written at a
|
|
97
|
+
collision is attached to the record once reverting that record's own hunk turns it
|
|
98
|
+
red. Otherwise every later agent is asked to write the same test again.
|
|
99
|
+
- Vet a record's test at its first collision, not at record time, and keep the verdict:
|
|
100
|
+
a revert of a past commit's hunk gives the same answer forever, and most records never
|
|
101
|
+
meet an edit.
|
|
102
|
+
|
|
103
|
+
## Disputes
|
|
104
|
+
|
|
105
|
+
- A dispute (`wrong`) is accepted with a test that asserts the counter-claim and passes
|
|
106
|
+
on the new commit, and the commit must change or remove the record's own test with a
|
|
107
|
+
reason. Asked for such a test, an agent tends to disprove its own false dispute.
|
|
108
|
+
- Never treat the record's own test passing as proof the record is right.
|
|
109
|
+
- A dispute no test can settle stays unsettled in the new intent and out of the next
|
|
110
|
+
agent's warning: an agent reads "disputed, unsettled" as permission to act on it.
|
|
111
|
+
- Only the owner can settle one, and the list must reach the human alone. An agent shown
|
|
112
|
+
a stands-or-wrong prompt will answer it for the owner. A session start or a push is not
|
|
113
|
+
evidence the owner is present; this owner runs agents unattended.
|
|
114
|
+
- Two sessions of the same model are not independent witnesses; agreement between them
|
|
115
|
+
certifies a shared guess, not a fact.
|
|
@@ -6,6 +6,8 @@ module IntentRecord
|
|
|
6
6
|
# checked before any is returned, so a payload with a bad entry late in the
|
|
7
7
|
# list never reaches the database. Nothing here needs one.
|
|
8
8
|
module CommitSpecs
|
|
9
|
+
ENTRY_KEYS = %w[commit message author ref].freeze
|
|
10
|
+
|
|
9
11
|
module_function
|
|
10
12
|
|
|
11
13
|
def from(input)
|
|
@@ -13,12 +15,14 @@ module IntentRecord
|
|
|
13
15
|
end
|
|
14
16
|
|
|
15
17
|
def entries(input)
|
|
18
|
+
InputValidator.known_keys!(input, %w[commits])
|
|
16
19
|
InputValidator.array!(input, "commits")
|
|
17
20
|
end
|
|
18
21
|
|
|
19
22
|
def spec(entry)
|
|
20
23
|
raise ValidationError, "commits entries must be objects" unless entry.is_a?(Hash)
|
|
21
24
|
|
|
25
|
+
InputValidator.known_keys!(entry, ENTRY_KEYS, within: "commits entries")
|
|
22
26
|
{ commit: InputValidator.required_string!(entry, "commit"),
|
|
23
27
|
message: message(entry),
|
|
24
28
|
author: InputValidator.optional_string!(entry, "author"),
|
|
@@ -45,6 +45,7 @@ module IntentRecord
|
|
|
45
45
|
def entry(line)
|
|
46
46
|
raise ValidationError, "Each line needs a line and an external_id" unless line.is_a?(Hash)
|
|
47
47
|
|
|
48
|
+
InputValidator.known_keys!(line, %w[line external_id], within: "lines entries")
|
|
48
49
|
[line_number(line["line"]), InputValidator.required_string!(line, "external_id")]
|
|
49
50
|
end
|
|
50
51
|
|
|
@@ -49,6 +49,9 @@ module IntentRecord
|
|
|
49
49
|
"commits": ["<git hash>"], "asset_versions": [{"vcs": "perforce", "external_id": "123"}],
|
|
50
50
|
"stakeholder_references": [{"system": "jira", "uri": "https://...", "title": "..."}],
|
|
51
51
|
"related_intent_ids": ["<intent_id>"]}
|
|
52
|
+
|
|
53
|
+
A key these input shapes do not show is refused, inside entries too.
|
|
54
|
+
The output's related_intents is set on input by related_intent_ids.
|
|
52
55
|
USAGE
|
|
53
56
|
end
|
|
54
57
|
end
|
|
@@ -3,12 +3,14 @@ require_relative "../models/intent_record"
|
|
|
3
3
|
require_relative "../linkers/asset_version_linker"
|
|
4
4
|
require_relative "../linkers/stakeholder_linker"
|
|
5
5
|
require_relative "../linkers/intent_linker"
|
|
6
|
+
require_relative "../linkers/link_keys"
|
|
7
|
+
require_relative "../input_validator"
|
|
6
8
|
|
|
7
9
|
module IntentRecord
|
|
8
10
|
module Commands
|
|
9
11
|
# Links more commits, stakeholder sources or related intents to an existing intent record.
|
|
10
12
|
class Attach
|
|
11
|
-
LINK_KEYS =
|
|
13
|
+
LINK_KEYS = Linkers::LINK_KEYS
|
|
12
14
|
|
|
13
15
|
def initialize(intent_id:)
|
|
14
16
|
@intent_id = intent_id
|
|
@@ -17,6 +19,8 @@ module IntentRecord
|
|
|
17
19
|
def call(input)
|
|
18
20
|
record = Models::IntentRecord.find_by(global_id: @intent_id)
|
|
19
21
|
raise NotFoundError, "Intent record not found: #{@intent_id}" unless record
|
|
22
|
+
|
|
23
|
+
InputValidator.known_keys!(input, LINK_KEYS, renamed: Linkers::OUTPUT_NAMES)
|
|
20
24
|
raise ValidationError, "Nothing to attach: provide one of #{LINK_KEYS.join(", ")}" if nothing_to_attach?(input)
|
|
21
25
|
|
|
22
26
|
ActiveRecord::Base.transaction { link_all(record, input) }
|
|
@@ -2,6 +2,7 @@ require_relative "../blame/spans"
|
|
|
2
2
|
require_relative "../blame/porcelain"
|
|
3
3
|
require_relative "../asset_version_normalizer"
|
|
4
4
|
require_relative "../formatter"
|
|
5
|
+
require_relative "../input_validator"
|
|
5
6
|
require_relative "../models/asset_version"
|
|
6
7
|
|
|
7
8
|
module IntentRecord
|
|
@@ -24,6 +25,7 @@ module IntentRecord
|
|
|
24
25
|
UNCOMMITTED = /\A(?:0{40}|0{64})\z/
|
|
25
26
|
|
|
26
27
|
def call(input)
|
|
28
|
+
InputValidator.known_keys!(input, %w[vcs lines])
|
|
27
29
|
vcs = AssetVersionNormalizer.vcs_name(input["vcs"] || DEFAULT_VCS)
|
|
28
30
|
spans = IntentRecord::Blame::Spans.new(input["lines"]).call
|
|
29
31
|
{ "spans" => answers(spans, vcs) }
|
|
@@ -5,11 +5,14 @@ require_relative "../models/intent_record"
|
|
|
5
5
|
require_relative "../linkers/asset_version_linker"
|
|
6
6
|
require_relative "../linkers/stakeholder_linker"
|
|
7
7
|
require_relative "../linkers/intent_linker"
|
|
8
|
+
require_relative "../linkers/link_keys"
|
|
8
9
|
|
|
9
10
|
module IntentRecord
|
|
10
11
|
module Commands
|
|
11
12
|
# Creates an intent record and links it to commits, stakeholder sources and related intents.
|
|
12
13
|
class Record
|
|
14
|
+
KEYS = (%w[summary body author] + Linkers::LINK_KEYS).freeze
|
|
15
|
+
|
|
13
16
|
def call(input)
|
|
14
17
|
attributes = validated(input)
|
|
15
18
|
|
|
@@ -25,6 +28,7 @@ module IntentRecord
|
|
|
25
28
|
# Nothing here reaches the database, so bad input is refused before the
|
|
26
29
|
# store is asked anything, and these rules can be exercised without one.
|
|
27
30
|
def validated(input)
|
|
31
|
+
InputValidator.known_keys!(input, KEYS, renamed: Linkers::OUTPUT_NAMES)
|
|
28
32
|
{ summary: summary(input),
|
|
29
33
|
body: InputValidator.required_string!(input, "body"),
|
|
30
34
|
author: InputValidator.optional_string!(input, "author"),
|
|
@@ -37,15 +37,38 @@ module IntentRecord
|
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
def hashes_with!(values, label, *keys)
|
|
40
|
+
def hashes_with!(values, label, *keys, optional: [])
|
|
41
41
|
values.each do |v|
|
|
42
42
|
raise ValidationError, "#{label} entries must be objects" unless v.is_a?(Hash)
|
|
43
43
|
|
|
44
|
+
known_keys!(v, keys + optional, within: "#{label} entries")
|
|
44
45
|
keys.each { |k| required_string!(v, k) }
|
|
45
46
|
end
|
|
46
47
|
values
|
|
47
48
|
end
|
|
48
49
|
|
|
50
|
+
# A key nobody reads is a request the caller believes was carried out, so
|
|
51
|
+
# it is refused rather than ignored. `renamed` maps a name the output uses
|
|
52
|
+
# to the key input takes for it, because the output's name is the obvious
|
|
53
|
+
# wrong guess.
|
|
54
|
+
def known_keys!(input, accepted, renamed: {}, within: nil)
|
|
55
|
+
unknown = input.keys - accepted
|
|
56
|
+
return input if unknown.empty?
|
|
57
|
+
|
|
58
|
+
raise ValidationError, unknown_keys_message(unknown, accepted, renamed, within)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def unknown_keys_message(unknown, accepted, renamed, within)
|
|
62
|
+
where = within ? " in #{within}" : ""
|
|
63
|
+
noun = unknown.one? ? "key" : "keys"
|
|
64
|
+
hints = unknown.filter_map { |key| renamed_hint(key, renamed[key]) }
|
|
65
|
+
"Unknown #{noun}#{where}: #{unknown.join(", ")}. Accepted keys: #{accepted.join(", ")}.#{hints.join}"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def renamed_hint(key, input_key)
|
|
69
|
+
" #{key} is what the output calls it; input takes #{input_key}." if input_key
|
|
70
|
+
end
|
|
71
|
+
|
|
49
72
|
def non_blank_string!(input, key)
|
|
50
73
|
value = input[key]
|
|
51
74
|
raise ValidationError, "#{key} is required" if value.nil?
|
|
@@ -64,6 +87,6 @@ module IntentRecord
|
|
|
64
87
|
end
|
|
65
88
|
|
|
66
89
|
# Steps of required_string!, not part of what this module offers callers.
|
|
67
|
-
private_class_method :non_blank_string!, :within_length
|
|
90
|
+
private_class_method :non_blank_string!, :within_length!, :unknown_keys_message, :renamed_hint
|
|
68
91
|
end
|
|
69
92
|
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module IntentRecord
|
|
2
|
+
module Linkers
|
|
3
|
+
# The payload keys the linkers read, which `record` and `attach` both accept.
|
|
4
|
+
LINK_KEYS = %w[commits asset_versions stakeholder_references related_intent_ids].freeze
|
|
5
|
+
|
|
6
|
+
# Output fields whose input key is spelled differently. The output's
|
|
7
|
+
# `related_intents` is a list of records and the input's is a list of ids,
|
|
8
|
+
# so accepting the output name would give one name two shapes.
|
|
9
|
+
OUTPUT_NAMES = { "related_intents" => "related_intent_ids" }.freeze
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -24,7 +24,7 @@ module IntentRecord
|
|
|
24
24
|
|
|
25
25
|
def call(input)
|
|
26
26
|
refs = InputValidator.hashes_with!(InputValidator.array!(input, "stakeholder_references"),
|
|
27
|
-
"stakeholder_references", "system", "uri")
|
|
27
|
+
"stakeholder_references", "system", "uri", optional: %w[title])
|
|
28
28
|
refs.map { |ref| link!(ref) }
|
|
29
29
|
end
|
|
30
30
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: intent-record
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Erik T. Madsen
|
|
@@ -43,14 +43,14 @@ dependencies:
|
|
|
43
43
|
requirements:
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '
|
|
46
|
+
version: '8.0'
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '
|
|
53
|
+
version: '8.0'
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
55
|
name: rackup
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -93,10 +93,14 @@ dependencies:
|
|
|
93
93
|
- - "~>"
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
95
|
version: '2.0'
|
|
96
|
-
description: A local, agent-first store
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
description: A local, agent-first store for the reasoning behind code changes. Each
|
|
97
|
+
record links to the commits it explains, to the tickets and pages that asked for
|
|
98
|
+
the change (Jira, Confluence, Linear, GitHub and others), and to earlier records
|
|
99
|
+
it builds on. Pipe git blame into it to ask why a line is there, look up a commit
|
|
100
|
+
or a ticket, search past reasoning, or recover records from the ticket keys already
|
|
101
|
+
in a repository's commit messages. JSON in and out on the CLI, which never runs
|
|
102
|
+
git itself, plus a small local web GUI. A skill for Claude Code and Cursor that
|
|
103
|
+
drives it is at https://github.com/beatmadsen/claude-skills/tree/main/skills/intent-record.
|
|
100
104
|
email: []
|
|
101
105
|
executables:
|
|
102
106
|
- intent-record
|
|
@@ -108,6 +112,7 @@ files:
|
|
|
108
112
|
- README.md
|
|
109
113
|
- db/migrate/20260918000001_create_initial_schema.rb
|
|
110
114
|
- db/migrate/20260920000001_create_search_index.rb
|
|
115
|
+
- docs/feature-findings.md
|
|
111
116
|
- exe/intent-record
|
|
112
117
|
- lib/intent_record.rb
|
|
113
118
|
- lib/intent_record/application_record.rb
|
|
@@ -147,6 +152,7 @@ files:
|
|
|
147
152
|
- lib/intent_record/linkers/asset_version_linker.rb
|
|
148
153
|
- lib/intent_record/linkers/asset_version_specs.rb
|
|
149
154
|
- lib/intent_record/linkers/intent_linker.rb
|
|
155
|
+
- lib/intent_record/linkers/link_keys.rb
|
|
150
156
|
- lib/intent_record/linkers/stakeholder_linker.rb
|
|
151
157
|
- lib/intent_record/match_expression.rb
|
|
152
158
|
- lib/intent_record/models/asset_version.rb
|
|
@@ -206,7 +212,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
206
212
|
- !ruby/object:Gem::Version
|
|
207
213
|
version: '0'
|
|
208
214
|
requirements: []
|
|
209
|
-
rubygems_version: 4.0.
|
|
215
|
+
rubygems_version: 4.0.23
|
|
210
216
|
specification_version: 4
|
|
211
|
-
summary:
|
|
217
|
+
summary: A local store for the reasoning behind code changes, linked to commits and
|
|
218
|
+
tickets.
|
|
212
219
|
test_files: []
|