principles 0.0.9 → 0.0.10
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 +6 -0
- data/README.md +3 -1
- data/lib/principles/controllers/member_problems_report.rb +2 -8
- data/lib/principles/data/command-steps.json +1 -1
- data/lib/principles/data/running_version.rb +1 -1
- data/lib/principles/models/findings_left_open.rb +3 -3
- data/lib/principles/models/open_finding.rb +0 -4
- data/lib/principles/version.rb +2 -2
- data/lib/principles/views/open_findings_line.rb +69 -28
- data/lib/principles/views/problem_lines.rb +17 -27
- data/lib/principles/views/prompts/learn-what-a-command-does/list-member-problems.md +2 -2
- data/lib/principles/views/prompts/learn-what-a-command-does/report-at-session-start.md +14 -16
- data/lib/principles/views/prompts/start-a-session/act-on-the-changed-members.md +2 -0
- data/principles.gemspec +2 -2
- metadata +5 -5
- data/lib/principles/views/prompts/start-a-session/run-each-command-above.md +0 -1
- data/lib/principles/views/prompts/start-a-session/start-with-the-principles-skill.md +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc95d7d905593eee8514b36fd6cbc6a80629a6f210542a232dada441890cf454
|
|
4
|
+
data.tar.gz: 964984c9b9d5a44d53c65ce0b92924d960eca08db17a93897abbe17db71b7482
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4534da22b02e7aa9a8e961268a1710f430c27bca7a8613b4d4fd1a8c337705f1a41967dbc3abb976535ae58891f66211ebea1b18e27fab015c88b6f5d35cb1df
|
|
7
|
+
data.tar.gz: 7b17bd8475e8158b80a9c4af83ff94de2022bd2525901096ea7ae16163c2f811fb1441c1591ea33415fce5f7ef8a8e763900f61a63443158b3bc21ddfb69d4d2
|
data/CHANGELOG.md
CHANGED
|
@@ -13,9 +13,15 @@ The agent's mechanics are the means, never the lead: do not open with "An agent
|
|
|
13
13
|
|
|
14
14
|
## Unreleased
|
|
15
15
|
|
|
16
|
+
## [0.0.10] - 2026-11-21
|
|
17
|
+
|
|
16
18
|
### Changed
|
|
17
19
|
|
|
18
20
|
- **Your agent raises open audit findings that wait on you in its first reply, instead of skimming past them.** The open-findings line `principles report-at-session-start` prints now names the oldest finding waiting on someone and what it needs, states git's `user.name` for the agent to judge whether that is you, and says to raise each in the first reply, since nothing else will. On this tool's own repository the line is 30% shorter than before.
|
|
21
|
+
- **You see how long the oldest finding has waited on you, so a stale one stands out.** The open-findings line `principles report-at-session-start` prints says "open N days" beside the oldest finding it names, as it did before the line was rewritten, for 15 more bytes.
|
|
22
|
+
- **Your agent deals with changed audited rules before starting your task, instead of leaving the notice for later.** Each line `principles report-at-session-start` prints for a principle whose audited members changed now says that its audit no longer covers them, and asks the agent to run `principles list-member-problems ID` before your task, to acknowledge the edit or audit again. The closing line that pointed at those commands is gone.
|
|
23
|
+
- **The README opens with a 51-second video of what principles does.**
|
|
24
|
+
- **The tagline now reads "Tighter harness, longer running agents: trust the principles, loosen the supervision."** in the README and the gem summary, and the gem description says what the README says of harness support: built for Claude Code, Codex partly supported, Pi after that.
|
|
19
25
|
|
|
20
26
|
### Removed
|
|
21
27
|
|
data/README.md
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
[](#install) [](LICENSE)  
|
|
8
8
|
|
|
9
|
-
**Tighter harness, longer
|
|
9
|
+
**Tighter harness, longer running agents: trust the principles, loosen the supervision.**
|
|
10
10
|
|
|
11
11
|
Built for Claude Code. Codex is partly supported already, with full support coming soon, and Pi after that. Your principles are portable across harnesses that share the same context management vectors: Codex has no monitors, but shares almost every other vector with Claude Code, including `AGENTS.md`, skills and hooks.
|
|
12
12
|
|
|
13
|
+
https://github.com/user-attachments/assets/8bd9d6cb-893e-4422-86f0-ecad91af5aa9
|
|
14
|
+
|
|
13
15
|
## Who is this for?
|
|
14
16
|
|
|
15
17
|
Principles is based on a dead simple idea - an easy to use CLI that helps an agent create and manage a map of all the snippets of text across the harness that work together to create its _operating principles_.
|
|
@@ -32,8 +32,7 @@ module Principles
|
|
|
32
32
|
def session_start_lines(source)
|
|
33
33
|
printing = invocation.without_project
|
|
34
34
|
problems, (report,) = checked(nil, printing)
|
|
35
|
-
lines = Views::ProblemLines.new(printing)
|
|
36
|
-
.session_start_lines(changed: problems.assessed_changes, skill: skill?)
|
|
35
|
+
lines = Views::ProblemLines.new(printing).session_start_lines(changed: problems.assessed_changes)
|
|
37
36
|
lines + not_checked_lines(problems, report, printing, source)
|
|
38
37
|
end
|
|
39
38
|
|
|
@@ -48,11 +47,6 @@ module Principles
|
|
|
48
47
|
Views::FirstAuditLine.new(printing).lines(problems.awaiting_first_audit.length, source)
|
|
49
48
|
end
|
|
50
49
|
|
|
51
|
-
# Whether this session has the principles skill, which only the plugin installs, for the lines naming where
|
|
52
|
-
# to start.
|
|
53
|
-
#: () -> bool
|
|
54
|
-
def skill? = @tool.runs_from.principles_skill_in_this_session?
|
|
55
|
-
|
|
56
50
|
# list-member-problems' JSON result, or with --short its lines for a trigger, or with --hook-event the
|
|
57
51
|
# after-commit hook's JSON, which MembersACommitChanged prints.
|
|
58
52
|
#: (String?, Hash[String, untyped]) -> untyped
|
|
@@ -82,7 +76,7 @@ module Principles
|
|
|
82
76
|
never_assessed: problems.never_assessed, names_a_command:)
|
|
83
77
|
return lines unless session_start
|
|
84
78
|
|
|
85
|
-
view.at_session_start(lines, changed: problems.assessed_changes
|
|
79
|
+
view.at_session_start(lines, changed: problems.assessed_changes)
|
|
86
80
|
end
|
|
87
81
|
|
|
88
82
|
# list-member-problems' JSON result for map id, or every map, without the files it wrote.
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"help": "learn-what-a-command-does/report-at-session-start",
|
|
133
133
|
"steps": [
|
|
134
134
|
{ "id": "report-at-session-start", "actor": "cli",
|
|
135
|
-
"does": "Reads the SessionStart hook's JSON on stdin and always exits 0, since the host adds a SessionStart hook's output to the context only then. Prints nothing in a project with no maps. Otherwise prints, each line marked principles:, one line for each principle whose members an audit assessed changed since, with its count and the list-member-problems
|
|
135
|
+
"does": "Reads the SessionStart hook's JSON on stdin and always exits 0, since the host adds a SessionStart hook's output to the context only then. Prints nothing in a project with no maps. Otherwise prints, each line marked principles:, one line for each principle whose members an audit assessed changed since, with its count, that its audit no longer covers them, and the list-member-problems ID command to run before the user's task, which offers acknowledging them or auditing again, then, in git, what gives each principle's members with no baseline one, then each principle whose audit record a later release wrote, whose audits wait on an upgrade, then, while any principle awaits its first full audit, one line counting them that asks for one background subagent to follow show-first-audit-brief, or to offer the audit at the next pause if none can be started, and at resume and compact only the count, asking for no second subagent, then, while any audit finding is left open, the one line list-open-findings --short prints, worded for the session's start. When list-member-problems refuses, prints instead its code and the command that shows its repair; input it cannot read is read as a startup." }
|
|
136
136
|
]
|
|
137
137
|
},
|
|
138
138
|
{
|
|
@@ -12,7 +12,7 @@ module Principles
|
|
|
12
12
|
class RunningVersion
|
|
13
13
|
# git archive writes the short sha of the commit it archives here, since .gitattributes marks this file
|
|
14
14
|
# export-subst; a checkout keeps the placeholder as written.
|
|
15
|
-
ARCHIVED_COMMIT = "
|
|
15
|
+
ARCHIVED_COMMIT = "a8698c23" #: String
|
|
16
16
|
|
|
17
17
|
#: (?String, release: String, ?built: String?, ?archived_commit: String) -> void
|
|
18
18
|
def initialize(checkout = File.expand_path("../../..", __dir__), release:, built: nil,
|
|
@@ -20,8 +20,8 @@ module Principles
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# How many are open, how many of them are deferred with no waits_on and how many with one, so how many someone
|
|
23
|
-
# should raise, the first raised earliest of those with one
|
|
24
|
-
#
|
|
23
|
+
# should raise, and the first raised earliest of those with one and of all, each as it has waited until now, or
|
|
24
|
+
# nil when none is open. How long it waited runs from first_raised_at, never from when its
|
|
25
25
|
# waits_on was asked, which a later audit may have given it.
|
|
26
26
|
#: (Time) -> Hash[String, untyped]?
|
|
27
27
|
def waiting_at(now)
|
|
@@ -31,7 +31,7 @@ module Principles
|
|
|
31
31
|
unnamed = @findings.count(&:waiting_on_no_one_named?)
|
|
32
32
|
{ "count" => @findings.length, "waiting_on_no_one_named" => unnamed,
|
|
33
33
|
"waiting_on_someone_named" => named.length, "to_raise" => named.length + unnamed,
|
|
34
|
-
"oldest_waiting_on_someone" => named.min_by(&:first_raised_time)&.
|
|
34
|
+
"oldest_waiting_on_someone" => named.min_by(&:first_raised_time)&.waited_at(now), **oldest.waited_at(now) }
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -171,10 +171,6 @@ module Principles
|
|
|
171
171
|
#: () -> bool
|
|
172
172
|
def waiting_on_someone_named? = action == "deferred" && !without_waits_on?
|
|
173
173
|
|
|
174
|
-
# The finding as the session-start line names the oldest waiting on someone: its principle, id and waits_on.
|
|
175
|
-
#: () -> Hash[String, untyped]
|
|
176
|
-
def named_waiting = { "principle" => @principle_id, "finding_id" => id, "waits_on" => @finding.waits_on }
|
|
177
|
-
|
|
178
174
|
# The one line it says it waits on, or nil when it says it waits on nothing.
|
|
179
175
|
#: () -> String?
|
|
180
176
|
def waits_on = @finding.waits_on
|
data/lib/principles/version.rb
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
module Principles
|
|
5
5
|
# The next production release, as major.minor.patch. A production build is versioned with this alone.
|
|
6
|
-
RELEASE = "0.0.
|
|
6
|
+
RELEASE = "0.0.10"
|
|
7
7
|
# The version a built gem prints. `rake build[production]` stamps RELEASE here, in the copy of lib/ it
|
|
8
8
|
# packages, and `rake build[development]` stamps RELEASE.g<short sha>. A checkout leaves it nil, and
|
|
9
9
|
# Data::RunningVersion reads the commit this tool runs from instead.
|
|
10
|
-
BUILT_VERSION = "0.0.
|
|
10
|
+
BUILT_VERSION = "0.0.10" #: String?
|
|
11
11
|
end
|
|
@@ -11,8 +11,9 @@ module Principles
|
|
|
11
11
|
module Views
|
|
12
12
|
# list-open-findings --short: the one line a session-start hook puts into the agent's context while any
|
|
13
13
|
# finding is open that someone should raise, and nothing when none is. It states the facts the agent judges
|
|
14
|
-
# from, how many wait on someone named or on no one, whom the oldest of the former waits on and
|
|
15
|
-
# name, then says to raise each that waits on its user, and why, with the command that lists
|
|
14
|
+
# from, how many wait on someone named or on no one, whom the oldest of the former waits on and for how long,
|
|
15
|
+
# and git's user name, then says to raise each that waits on its user, and why, with the command that lists
|
|
16
|
+
# them all.
|
|
16
17
|
class OpenFindingsLine
|
|
17
18
|
# A waits_on longer than this is cut, so the line stays one short line.
|
|
18
19
|
WAITS_ON_LIMIT = 80
|
|
@@ -36,6 +37,44 @@ module Principles
|
|
|
36
37
|
def reply = @source == "startup" ? "first" : "next"
|
|
37
38
|
end
|
|
38
39
|
|
|
40
|
+
# The open findings as the line states them, from the plain hash a controller hands it: how many are open and
|
|
41
|
+
# the oldest of all, which a resumed line names, and how many wait on someone named or on no one, with the
|
|
42
|
+
# oldest of the former.
|
|
43
|
+
class Waiting
|
|
44
|
+
#: (Hash[String, untyped]) -> void
|
|
45
|
+
def initialize(fields)
|
|
46
|
+
@fields = fields
|
|
47
|
+
freeze
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
#: () -> Integer
|
|
51
|
+
def count = @fields.fetch("count")
|
|
52
|
+
|
|
53
|
+
#: () -> Integer
|
|
54
|
+
def days_open = @fields.fetch("days_open")
|
|
55
|
+
|
|
56
|
+
#: () -> Integer
|
|
57
|
+
def named = @fields.fetch("waiting_on_someone_named")
|
|
58
|
+
|
|
59
|
+
#: () -> Integer
|
|
60
|
+
def unnamed = @fields.fetch("waiting_on_no_one_named")
|
|
61
|
+
|
|
62
|
+
#: () -> Integer
|
|
63
|
+
def to_raise = @fields.fetch("to_raise")
|
|
64
|
+
|
|
65
|
+
# Whether the one finding to raise is one waiting on someone named, whose own line names its need.
|
|
66
|
+
#: () -> bool
|
|
67
|
+
def alone? = to_raise == 1 && named == 1
|
|
68
|
+
|
|
69
|
+
# The oldest open finding of all, by principle and finding_id.
|
|
70
|
+
#: () -> Hash[String, untyped]
|
|
71
|
+
def oldest = @fields.slice("principle", "finding_id")
|
|
72
|
+
|
|
73
|
+
# The oldest finding waiting on someone named, by principle, finding_id and waits_on, or nil.
|
|
74
|
+
#: () -> Hash[String, untyped]?
|
|
75
|
+
def oldest_named = @fields["oldest_waiting_on_someone"]
|
|
76
|
+
end
|
|
77
|
+
|
|
39
78
|
#: (Invocation) -> void
|
|
40
79
|
def initialize(invocation)
|
|
41
80
|
@invocation = invocation
|
|
@@ -56,8 +95,10 @@ module Principles
|
|
|
56
95
|
def lines(waiting, not_found = [], source: "startup", user_name: nil)
|
|
57
96
|
start = SessionStart.new(source)
|
|
58
97
|
return [] unless waiting
|
|
59
|
-
|
|
60
|
-
|
|
98
|
+
|
|
99
|
+
waiting = Waiting.new(waiting)
|
|
100
|
+
return [resumed("#{how_long(waiting)} (#{oldest(waiting.oldest)})", not_found)] if start.resumed?
|
|
101
|
+
return [] if waiting.to_raise.zero?
|
|
61
102
|
|
|
62
103
|
[whole(waiting, not_found, start, user_name)]
|
|
63
104
|
end
|
|
@@ -66,14 +107,12 @@ module Principles
|
|
|
66
107
|
|
|
67
108
|
# The line with what to do about the findings, for a context that does not hold it yet: the facts, then the
|
|
68
109
|
# reply that raises them and why, then the command listing them all, which one finding's own need replaces.
|
|
69
|
-
#: (
|
|
110
|
+
#: (Waiting, Array[Hash[String, untyped]], SessionStart, String?) -> String
|
|
70
111
|
def whole(waiting, not_found, start, user_name)
|
|
71
|
-
named = waiting.fetch("waiting_on_someone_named")
|
|
72
|
-
alone = waiting.fetch("to_raise") == 1 && named == 1
|
|
73
112
|
Prompts.text("start-a-session/act-on-the-open-findings",
|
|
74
113
|
facts: "#{waiting_on_someone(waiting)}#{no_one_named(waiting)}#{write_ups(not_found)}" \
|
|
75
|
-
"#{git_user(user_name) unless named.zero?}",
|
|
76
|
-
raise: raise_which(
|
|
114
|
+
"#{git_user(user_name) unless waiting.named.zero?}",
|
|
115
|
+
raise: raise_which(waiting), reply: start.reply, command: waiting.alone? ? "" : " All: #{all}")
|
|
77
116
|
end
|
|
78
117
|
|
|
79
118
|
# The command listing every open finding, a line each.
|
|
@@ -82,34 +121,36 @@ module Principles
|
|
|
82
121
|
|
|
83
122
|
# Which findings the agent raises: the one, if it waits on its user, or each that does, with those waiting on
|
|
84
123
|
# no one, or each when none names anyone.
|
|
85
|
-
#: (
|
|
86
|
-
def raise_which(
|
|
87
|
-
return "If it waits on your user, raise it" if alone
|
|
88
|
-
return "Raise each" if waiting.
|
|
124
|
+
#: (Waiting) -> String
|
|
125
|
+
def raise_which(waiting)
|
|
126
|
+
return "If it waits on your user, raise it" if waiting.alone?
|
|
127
|
+
return "Raise each" if waiting.named.zero?
|
|
89
128
|
|
|
90
|
-
"Raise each that waits on your user#{" or on no one" if waiting.
|
|
129
|
+
"Raise each that waits on your user#{" or on no one" if waiting.unnamed.positive?}"
|
|
91
130
|
end
|
|
92
131
|
|
|
93
132
|
# The sentence naming the oldest finding that waits on someone named, and whom, counting them when several do.
|
|
94
|
-
#: (
|
|
133
|
+
#: (Waiting) -> String
|
|
95
134
|
def waiting_on_someone(waiting)
|
|
96
|
-
oldest = waiting
|
|
135
|
+
oldest = waiting.oldest_named or return ""
|
|
97
136
|
need = need(oldest.fetch("waits_on"))
|
|
98
137
|
need = "#{need}." unless need.end_with?(".")
|
|
99
|
-
named =
|
|
100
|
-
return "Open finding #{
|
|
138
|
+
named = "#{oldest(oldest)}, #{age(oldest.fetch("days_open"))},"
|
|
139
|
+
return "Open finding #{named} waits on: #{need}" if waiting.named == 1
|
|
101
140
|
|
|
102
|
-
"#{counted(named)} on someone; the oldest, #{
|
|
103
|
-
"#{need}"
|
|
141
|
+
"#{counted(waiting.named)} on someone; the oldest, #{named} waits on: #{need}"
|
|
104
142
|
end
|
|
105
143
|
|
|
144
|
+
# How long a finding has gone unraised, in whole days.
|
|
145
|
+
#: (Integer) -> String
|
|
146
|
+
def age(days) = "open #{days} #{days == 1 ? "day" : "days"}"
|
|
147
|
+
|
|
106
148
|
# The sentence counting the findings deferred with no waits_on, after any naming someone.
|
|
107
|
-
#: (
|
|
149
|
+
#: (Waiting) -> String
|
|
108
150
|
def no_one_named(waiting)
|
|
109
|
-
unnamed = waiting.
|
|
151
|
+
unnamed = waiting.unnamed
|
|
110
152
|
return "" if unnamed.zero?
|
|
111
|
-
return " #{unnamed} #{unnamed == 1 ? "waits" : "wait"} on no one named."
|
|
112
|
-
if waiting.fetch("waiting_on_someone_named").positive?
|
|
153
|
+
return " #{unnamed} #{unnamed == 1 ? "waits" : "wait"} on no one named." if waiting.named.positive?
|
|
113
154
|
|
|
114
155
|
"#{counted(unnamed)} on no one named."
|
|
115
156
|
end
|
|
@@ -149,17 +190,17 @@ module Principles
|
|
|
149
190
|
end
|
|
150
191
|
|
|
151
192
|
# How many findings are open and how long the oldest has waited.
|
|
152
|
-
#: (
|
|
153
|
-
def how_long(waiting) = "#{still_open(waiting.
|
|
193
|
+
#: (Waiting) -> String
|
|
194
|
+
def how_long(waiting) = "#{still_open(waiting.count)}#{waited(waiting)}"
|
|
154
195
|
|
|
155
196
|
#: (Integer) -> String
|
|
156
197
|
def still_open(count)
|
|
157
198
|
count == 1 ? "1 audit finding is still open, " : "#{count} audit findings are still open, the oldest "
|
|
158
199
|
end
|
|
159
200
|
|
|
160
|
-
#: (
|
|
201
|
+
#: (Waiting) -> String
|
|
161
202
|
def waited(waiting)
|
|
162
|
-
days = waiting.
|
|
203
|
+
days = waiting.days_open
|
|
163
204
|
return "for less than a day" if days < 1
|
|
164
205
|
|
|
165
206
|
"for #{days} #{days == 1 ? "day" : "days"}"
|
|
@@ -44,41 +44,31 @@ module Principles
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
# short's lines for a session-start hook: on stdout, one line for each principle with a changed member an
|
|
47
|
-
# audit or acknowledgement assessed,
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
stdout = session_start_lines(changed:, skill:)
|
|
54
|
-
Lines.new(stdout: stdout.map { "#{it}\n" }.join, stderr: short.stderr, status: short.status)
|
|
47
|
+
# audit or acknowledgement assessed, as session_start_lines says, from changed, in place of the rows and
|
|
48
|
+
# never-assessed counts, which an always-loaded carrier cannot afford; stderr and the status kept.
|
|
49
|
+
#: (Lines, changed: Hash[String, Integer]) -> Lines
|
|
50
|
+
def at_session_start(short, changed:)
|
|
51
|
+
Lines.new(stdout: session_start_lines(changed:).map { "#{it}\n" }.join, stderr: short.stderr,
|
|
52
|
+
status: short.status)
|
|
55
53
|
end
|
|
56
54
|
|
|
57
|
-
# at_session_start's stdout, a line
|
|
58
|
-
#
|
|
59
|
-
#
|
|
60
|
-
#: (changed: Hash[String, Integer]
|
|
61
|
-
def session_start_lines(changed
|
|
62
|
-
|
|
63
|
-
[*counts, *(where_to_start(skill) unless counts.empty?)]
|
|
55
|
+
# at_session_start's stdout, a line for each principle with changed audited members: how many, why that
|
|
56
|
+
# matters, to act before the user's task, and the command whose output offers acknowledging them or auditing
|
|
57
|
+
# again. Its command leaves out --project, as the hook's own commands do, since a session runs in its project.
|
|
58
|
+
#: (changed: Hash[String, Integer]) -> Array[String]
|
|
59
|
+
def session_start_lines(changed:)
|
|
60
|
+
changed.map { |id, count| changed_line(id, count) }
|
|
64
61
|
end
|
|
65
62
|
|
|
66
63
|
private
|
|
67
64
|
|
|
68
|
-
#
|
|
69
|
-
# commands those lines print.
|
|
70
|
-
#: (bool) -> String
|
|
71
|
-
def where_to_start(skill)
|
|
72
|
-
return Prompts.text("start-a-session/start-with-the-principles-skill") if skill
|
|
73
|
-
|
|
74
|
-
Prompts.text("start-a-session/run-each-command-above")
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
# The session-start line counting principle id's changed audited members, with the command that lists them.
|
|
65
|
+
# The session-start line on principle id's count of changed audited members.
|
|
78
66
|
#: (String, Integer) -> String
|
|
79
67
|
def changed_line(id, count)
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
Prompts.text("start-a-session/act-on-the-changed-members",
|
|
69
|
+
members: "#{count} audited member#{"s" unless count == 1} of #{VisibleText.new(id)}",
|
|
70
|
+
them: count == 1 ? "it" : "them",
|
|
71
|
+
command: @invocation.without_project.in_project("list-member-problems", id))
|
|
82
72
|
end
|
|
83
73
|
|
|
84
74
|
# The line counting principle id's members no audit has assessed, which a reader tells from a member's row by
|
|
@@ -56,8 +56,8 @@ it, else run in the project it names once, and says when there are no maps, or m
|
|
|
56
56
|
stdout would hide. A changed member stays listed until an audit takes it in: a notice, not a gate that blocks commits.
|
|
57
57
|
For a post-commit hook, run: %{executable} list-member-problems --short || true
|
|
58
58
|
A heartbeat can compare each line's commit with the last one it reported.
|
|
59
|
-
`--short --session-start SOURCE`, for the session-start hook, prints instead
|
|
60
|
-
|
|
59
|
+
`--short --session-start SOURCE`, for the session-start hook, prints instead a line for each principle with changed
|
|
60
|
+
audited members, its count and, to run before the user's task, this command for that principle.
|
|
61
61
|
|
|
62
62
|
`--commits-after COMMIT --hook-event EVENT` is for a Claude Code hook that runs after a Bash call, so a long session
|
|
63
63
|
learns of a member it changed at the commit that changed it, not only at its next start. The plugin's after-commit
|
|
@@ -4,22 +4,20 @@ nothing more, so a shell that leaves stdin open is not kept waiting; it reads no
|
|
|
4
4
|
0, since a host adds a SessionStart hook's output to the context only on 0, and shows the user an error on any other
|
|
5
5
|
status. In a project with no maps it prints nothing.
|
|
6
6
|
|
|
7
|
-
Otherwise each line it prints starts `principles:`.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Last, while any finding an audit deferred or accepted is open, the one line `list-open-findings --short` prints, worded
|
|
22
|
-
for the session's start, and short on resume, whose conversation holds the whole line already.
|
|
7
|
+
Otherwise each line it prints starts `principles:`. Input that is not JSON, or names no source a host sends, is read as
|
|
8
|
+
a startup. First comes one line for each principle with a member an audit assessed that changed since, counting them,
|
|
9
|
+
saying its audit no longer covers them, and asking the agent to run, before the user's task, the `list-member-problems
|
|
10
|
+
ID` command that offers acknowledging them or auditing again. An edit to a member no audit has assessed is not counted
|
|
11
|
+
here, since it carries no verdict to act on. In git, a line follows for each principle with members no baseline holds
|
|
12
|
+
yet, as a session that ended mid-mapping leaves them, saying which files to commit, or the audit to run when every file
|
|
13
|
+
is committed already. Outside git only an audit gives a baseline, so that line would repeat at every session, and is
|
|
14
|
+
left out. Then a line for each principle whose audit record a later release of principles wrote: this copy does not
|
|
15
|
+
check its members, so none of them is counted, and the line says how to update. Then, while any principle awaits its
|
|
16
|
+
first full audit, one line counting them, naming none, asks the agent to tell the user and start one background subagent
|
|
17
|
+
to follow `show-first-audit-brief`, or to offer the audit at its next pause if it cannot. At resume and compact, when
|
|
18
|
+
one may be running already, it gives the count alone and asks for no second one. Last, while any finding an audit
|
|
19
|
+
deferred or accepted is open, the one line `list-open-findings --short` prints, worded for the session's start, and
|
|
20
|
+
short on resume, whose conversation holds the whole line already.
|
|
23
21
|
|
|
24
22
|
When the maps or members cannot be read, as `list-member-problems` would refuse, it prints instead the refusal's code
|
|
25
23
|
and that command, whose refusal says why and how to repair it, and still exits 0. Stdin that cannot be read is read as
|
data/principles.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
# Rakefile. Loaded from the checkout, as Bundler does, it is RELEASE, so Gemfile.lock does not change with
|
|
9
9
|
# every commit.
|
|
10
10
|
spec.version = Principles::BUILT_VERSION || Principles::RELEASE
|
|
11
|
-
spec.summary = "Tighter harness, longer
|
|
11
|
+
spec.summary = "Tighter harness, longer running agents: trust the principles, loosen the supervision"
|
|
12
12
|
spec.description = <<~TEXT
|
|
13
13
|
A harness configuration framework that keeps every part of your Claude Code agent's harness in alignment.
|
|
14
14
|
Name the principles your CLAUDE.md files, rules, skills, subagents and hooks encode, and map every place
|
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
|
16
16
|
move with it, and walks your agent through bringing them back into line, recording anything still to fix.
|
|
17
17
|
It never edits your harness and calls no model: it keeps the books deterministically.
|
|
18
18
|
Ruby 3.4, with no runtime gem dependencies.
|
|
19
|
-
Codex
|
|
19
|
+
Built for Claude Code. Codex is partly supported, with full support coming soon, and Pi after that.
|
|
20
20
|
TEXT
|
|
21
21
|
spec.license = "Apache-2.0"
|
|
22
22
|
spec.authors = ["Sidu Ponnappa"]
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: principles
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sidu Ponnappa
|
|
@@ -16,7 +16,7 @@ description: |
|
|
|
16
16
|
move with it, and walks your agent through bringing them back into line, recording anything still to fix.
|
|
17
17
|
It never edits your harness and calls no model: it keeps the books deterministically.
|
|
18
18
|
Ruby 3.4, with no runtime gem dependencies.
|
|
19
|
-
Codex
|
|
19
|
+
Built for Claude Code. Codex is partly supported, with full support coming soon, and Pi after that.
|
|
20
20
|
email:
|
|
21
21
|
- sidu@realfast.ai
|
|
22
22
|
executables:
|
|
@@ -466,12 +466,11 @@ files:
|
|
|
466
466
|
- lib/principles/views/prompts/set-principles-up/place-the-passage-with-the-user.md
|
|
467
467
|
- lib/principles/views/prompts/set-principles-up/what-the-passage-presumes.md
|
|
468
468
|
- lib/principles/views/prompts/set-principles-up/wire-the-report-hooks-with-the-user.md
|
|
469
|
+
- lib/principles/views/prompts/start-a-session/act-on-the-changed-members.md
|
|
469
470
|
- lib/principles/views/prompts/start-a-session/act-on-the-open-findings.md
|
|
470
471
|
- lib/principles/views/prompts/start-a-session/hand-the-first-audit-to-a-subagent.md
|
|
471
|
-
- lib/principles/views/prompts/start-a-session/run-each-command-above.md
|
|
472
472
|
- lib/principles/views/prompts/start-a-session/see-the-earlier-line.md
|
|
473
473
|
- lib/principles/views/prompts/start-a-session/start-no-second-first-audit.md
|
|
474
|
-
- lib/principles/views/prompts/start-a-session/start-with-the-principles-skill.md
|
|
475
474
|
- lib/principles/views/read_the_change.rb
|
|
476
475
|
- lib/principles/views/record_waiting_on_an_upgrade.rb
|
|
477
476
|
- lib/principles/views/repoint_result.rb
|
|
@@ -511,5 +510,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
511
510
|
requirements: []
|
|
512
511
|
rubygems_version: 3.6.9
|
|
513
512
|
specification_version: 4
|
|
514
|
-
summary: 'Tighter harness, longer
|
|
513
|
+
summary: 'Tighter harness, longer running agents: trust the principles, loosen the
|
|
514
|
+
supervision'
|
|
515
515
|
test_files: []
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Run each command above; its output says what to do next.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
The principles skill, /principles, is where to start with these members; each command's output says what to do next.
|