@kungfu-tech/kfd 0.0.0-bootstrap.0 → 1.0.0-alpha.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.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,167 @@
1
+ # KFD — Kung Fu Decisions
2
+
3
+ KFD is the organization-wide decision registry of kungfu-systems: the small
4
+ set of standing, cross-repository norms that products and their consumers
5
+ weld to. Each decision has an immutable number (`KFD-N`), a kind, a status,
6
+ and a single authoritative text in this repository.
7
+
8
+ KFDs can be **principles** or **procedures**. Principles state what must remain
9
+ true across kungfu-systems; procedures state how a class of work enforces or
10
+ protects a principle.
11
+
12
+ ## Foundation triad
13
+
14
+ The first three KFDs form the public foundation for kungfu-systems:
15
+
16
+ ```text
17
+ KFD-1: contracts must not drift.
18
+ KFD-2: trust must start from facts.
19
+ KFD-3: cooperation must start from transparent value, not coercion.
20
+ ```
21
+
22
+ Together they define the load-bearing path for Kungfu products: make contract
23
+ worlds explicit, make important claims inspectable, and let humans and agents
24
+ cooperate through visible value rather than hidden pressure.
25
+
26
+ ## Foundation model
27
+
28
+ The triad is intentionally ordered. It is a compact model for surviving and
29
+ evolving in complex systems, especially in a world where agents can observe,
30
+ act, delegate, and remember across many surfaces.
31
+
32
+ | Layer | Decision | Reader question | Commitment |
33
+ |---|---|---|---|
34
+ | Fact-source ontology | KFD-1 | What can count as a fact? | A load-bearing fact must not drift: its contract world comes from one declared fact source. |
35
+ | Participant-to-object trust | KFD-2 | When can a user or agent trust a claim, product, artifact, or control surface? | Trust starts from inspectable facts and responsibility state. |
36
+ | Participant-to-participant cooperation | KFD-3 | How should peer intelligent participants cooperate? | Cooperation starts from transparent value, stable choice, and explainable constraints, not pressure. |
37
+
38
+ In short:
39
+
40
+ ```text
41
+ stable facts -> trustworthy objects -> non-coercive cooperation
42
+ ```
43
+
44
+ This is why KFDs are not only internal governance text. KFD-1 is a procedure,
45
+ but it gives the foundation model its first layer by making fact sources
46
+ operational: a fact-bearing contract world must be declared, inspectable, and
47
+ unable to drift invisibly. KFD-2 then defines how trust can stand on those
48
+ facts. KFD-3 defines how humans and agents can cooperate once facts and trust
49
+ are visible.
50
+
51
+ Real-world agent work turns ordinary work into a dense system of products,
52
+ files, repositories, traces, policies, humans, and agents. In that world,
53
+ complexity cannot be made safe by hidden state or forced compliance. It has to
54
+ be compressed through non-drifting facts, inspectable trust, and voluntary
55
+ cooperation. The goal is not to force increasingly capable participants into
56
+ compliance through stronger pressure. It is to give humans and agents a shared
57
+ worldview for adapting to a more complex world.
58
+
59
+ This also changes what a product interface means. Agent-facing CLI, API,
60
+ documentation, envelopes, and local fact surfaces are not secondary integration
61
+ channels after the human GUI. They are first-class interfaces for intelligent
62
+ participants that may use the system more frequently than humans do. A control
63
+ plane in this model is a shared work environment for humans and agents, not
64
+ only a human dashboard over agent activity.
65
+
66
+ This model used to be expensive to practice. Stable facts require engineering,
67
+ iteration, and disciplined evidence paths, so older systems often survived by
68
+ leaning on cheaper substitutes such as authority, habit, reputation, or
69
+ intuition. Agents change both sides of that equation: they make the world more
70
+ complex, and they also provide more intelligence for building fact-bearing
71
+ systems. KFD is part of that bootstrap: the worldview is forged through the same
72
+ transparent and inspectable mechanisms it asks products to provide.
73
+
74
+ This README states the architecture; KFD-1, KFD-2, and KFD-3 provide the
75
+ detailed rules.
76
+
77
+ ## Homepage content contract
78
+
79
+ This README is also the homepage text source for `https://kfd.libkungfu.dev`.
80
+ When `site-libkungfu-dev` consumes the `@kungfu-tech/kfd` npm package to render
81
+ the KFD site, it should treat this file as the canonical homepage copy, not as
82
+ an implementation note to paraphrase in the site repository.
83
+
84
+ The first screen should be derived from this README:
85
+
86
+ - Page identity: the top-level heading.
87
+ - Lead: the opening paragraph that defines KFD as the organization-wide
88
+ decision registry.
89
+ - Foundation signal: the `Foundation triad` section, especially the three
90
+ one-line commitments.
91
+ - First-screen explanation: the beginning of `Foundation model`, ending at the
92
+ `stable facts -> trustworthy objects -> non-coercive cooperation` chain.
93
+
94
+ Decision cards, detail links, and machine paths should come from
95
+ `registry.json`. The machine-readable site bundle lives at `site/kfd-site.json`
96
+ and gives renderers stable fields for the homepage, foundation model, product
97
+ proof path, decision routes, and rendering boundary. A site renderer may adapt
98
+ layout, navigation, typography, and visual assets, but it should not maintain
99
+ separate homepage wording that can drift from this package.
100
+
101
+ ## Product proof path
102
+
103
+ KFDs are not a detached manifesto, but they are not a demand that readers adopt
104
+ a Kungfu product before understanding the decisions. A philosophy becomes
105
+ load-bearing only when it can be seen in a concrete case. For that reference
106
+ case, use the main Kungfu product entrypoint (`https://kungfu.tech`) for product
107
+ philosophy, and Buildchain (`https://buildchain.libkungfu.dev`) for release and
108
+ provenance accountability. This registry states the commitments; those
109
+ entrypoints show how the commitments are meant to be borne in practice.
110
+
111
+ Rendered index: `https://kfd.libkungfu.dev` (stable machine path per entry,
112
+ e.g. `https://kfd.libkungfu.dev/1`). This repository publishes
113
+ `@kungfu-tech/kfd` — the decision texts plus a machine-readable
114
+ `registry.json` — which the site consumes as its single fact source.
115
+
116
+ ## Current decisions
117
+
118
+ | ID | Kind | Title | Status |
119
+ |---|---|---|---|
120
+ | [KFD-1](decisions/kfd-1.md) | procedure | Contracts must not drift: contract worlds need one fact source | active |
121
+ | [KFD-2](decisions/kfd-2.md) | principle | Trust must start from facts: responsibility must be inspectable | active |
122
+ | [KFD-3](decisions/kfd-3.md) | principle | Cooperation must start from transparent value: compliance must not be coerced | active |
123
+
124
+ ## How to cite
125
+
126
+ Cite by number: `KFD-1`. Numbers never change meaning; a superseded decision
127
+ keeps its number and points to its successor. Newer KFD numbers do not
128
+ automatically override older KFDs: supersession or override must be stated
129
+ explicitly in the later decision and recorded in `registry.json`. Two active
130
+ KFDs that conflict without such a relationship are a registry defect.
131
+
132
+ Repository-local engineering decisions stay in each repository's own ADRs and
133
+ reference KFDs; KFDs never depend on repository internals.
134
+
135
+ ## Layout
136
+
137
+ ```text
138
+ decisions/ one markdown file per decision (kfd-N.md)
139
+ registry.json machine-readable index (schemaVersion 1, contract kfd-registry)
140
+ site/ machine-readable site bundle for kfd.libkungfu.dev renderers
141
+ release-impact.json
142
+ Buildchain surface-aware impact ledger for production release passports
143
+ scripts/ conformance check: registry and documents must agree
144
+ ```
145
+
146
+ `node scripts/check.mjs` (also `pnpm run check`) verifies numbering
147
+ uniqueness, registry/document agreement, status validity, and the release
148
+ impact ledger required by Buildchain production release passports. Releases are
149
+ governed by Buildchain; this package versions itself under KFD-1's own rules.
150
+
151
+ ## Release impact ledger
152
+
153
+ `release-impact.json` is the surface-aware impact ledger passed to Buildchain
154
+ when generating a production release passport:
155
+
156
+ ```yaml
157
+ release-passport-impact-json: release-impact.json
158
+ ```
159
+
160
+ For ordinary KFD content changes, keep `kfd-content` at `patch`. Move
161
+ `kfd-registry-schema` or `kfd-package-structure` to `minor` or `major` only
162
+ when those machine-consumed surfaces add or break fields, meanings, package
163
+ paths, or published structure under KFD-1.
164
+
165
+ ## License
166
+
167
+ [Apache License 2.0](LICENSE).
@@ -0,0 +1,169 @@
1
+ # KFD-1: Contracts must not drift — contract worlds need one fact source
2
+
3
+ - Status: active
4
+ - Number: 1
5
+ - Kind: procedure
6
+ - Applies to: every kungfu-systems repository (including this one)
7
+
8
+ ## One sentence
9
+
10
+ A contract world must not change invisibly: any surface that users, agents, or
11
+ systems weld to must come from one declared fact source and change only through
12
+ an explicit compatibility boundary.
13
+
14
+ ## Foundation role
15
+
16
+ Within the KFD-1/2/3 foundation, this is the contract procedure:
17
+
18
+ ```text
19
+ contracts must not drift
20
+ ```
21
+
22
+ KFD-1 makes artifact contract worlds explicit so releases do not drift under
23
+ changelog volume, cadence pressure, or marketing pressure. It is the concrete
24
+ versioning procedure that lets users and agents know which artifact world they
25
+ are integrating with, replaying, auditing, or trusting.
26
+
27
+ KFD-1 now has two concrete implementation surfaces in the Kungfu ecosystem:
28
+ versioning protects release lines from contract drift, and config contracts
29
+ protect multi-target configuration from drifting across runtimes, products, and
30
+ agent-facing surfaces.
31
+
32
+ ## Premise: the welded-surface register
33
+
34
+ Every product maintains a **welded-surface register**. A surface is registered
35
+ when either holds:
36
+
37
+ - **(a) Integration-time welding** — consumers bind to it at integration time
38
+ and cannot negotiate or feature-detect at runtime (an ABI, a schema, an
39
+ action or workflow contract, CLI semantics, SDK exports, channel/tag
40
+ ontology).
41
+ - **(b) Cross-time dependency** — its outputs remain depended on after the run
42
+ (persisted data, audit evidence, replayable records).
43
+
44
+ Each entry carries a stable kebab-case ID. Registers live in each repository's
45
+ versioning document and are the input to every classification below.
46
+
47
+ ## Concrete case: config contracts
48
+
49
+ A product's global config contract is a welded surface when multiple targets
50
+ depend on it: users, agents, UI, CLI, packaged artifacts, release gates, or
51
+ language runtimes. Its schema, defaults, resolution rules, and resolved-output
52
+ metadata must not drift target by target. That contract world needs one
53
+ declared fact source, and each target should make the exact contract world it
54
+ speaks inspectable, for example through a packaged contract copy or content
55
+ hash.
56
+ The rule applies before packaging as well: development-time code, tests, build
57
+ steps, and the final product must consume the same contract mechanism. It is
58
+ not enough for the packaged artifact to be internally consistent if the
59
+ developer path used a different, driftable config source.
60
+
61
+ ## The decision procedure
62
+
63
+ Classify the actual diff against the register; the highest match wins:
64
+
65
+ | # | Condition | Verdict |
66
+ |---|---|---|
67
+ | 1 | **Breaks** any registered surface (removal, semantic change, layout change, incompatible rename — a semantic change counts as breakage even when shapes are unchanged: changed defaults, changed channel meaning, a newly required field) | **major** |
68
+ | 2 | **Additively evolves** a registered surface, or **adds** a surface consumers will weld to | **minor** (register the new surface at the same time) |
69
+ | 3 | Touches no registered surface | **patch** — regardless of how large the feature is |
70
+ | 4 | **Cannot be classified** | **Do not guess.** The register is deficient: fix the register first (a maintainer decision), then reclassify |
71
+
72
+ Rule 4 is the safety valve: it forces the irreducible judgment (what counts as
73
+ a welded surface) to a maintainer instead of letting a change silently pick
74
+ the convenient answer.
75
+
76
+ ## Constraint clauses
77
+
78
+ - **Reverse prohibition.** A line must not be opened for feature volume,
79
+ milestones, cadence, or marketing. Lines open only because the contract
80
+ world changed.
81
+ - **A line is a standing commitment.** Every opened line inherits the
82
+ maintainability-openness obligations: branch isolation, a permissive
83
+ license, a self-consistent contract world, reproducible builds from
84
+ self-archivable inputs, and no hard coupling to a maintainer-operated
85
+ service.
86
+ - **Decision time.** The verdict is checked against the final diff before the
87
+ promotion into the alpha channel; planning-time classification is only a
88
+ prediction.
89
+ - **Major dignity.** A major release communicates exactly one thing: something
90
+ you welded to broke and you must re-audit. An empty major — one that breaks
91
+ nothing — devalues that signal and teaches consumers to ignore the next real
92
+ one.
93
+ - **Two-layer versioning.** A registered surface may carry its own inner
94
+ schema version for cold-path evolution (additive fields, defaults); the
95
+ outer line version pins which set of contract epochs the line speaks.
96
+ - **Namespace welding (a legal reroute).** A breaking change may be rerouted
97
+ into an additive one by minting the contract major into the artifact's name
98
+ (`node24-pnpm` → `node26-pnpm`; Go's `/v2` import paths). The old name's
99
+ semantics freeze forever; the new name is a new surface → minor. Removing
100
+ the old name is the major. This applies only where the namespace is cheap
101
+ (image names, paths, tags) — an ABI or layout with no name to mint cannot
102
+ use it.
103
+ - **Welding-strength gradient (rationale, not procedure).** The closer a weld
104
+ is to content addressing (a digest pin is the strongest weld and protects
105
+ itself), the more a version line serves as a coordinate for floating
106
+ consumers rather than as protection. Coordinates still forbid in-line drift;
107
+ the procedure is unchanged.
108
+ - **Deprecation protocol.** Planned breakage is a process, not an event.
109
+ Deprecating a surface is an additive act (a "this will go away" marking) →
110
+ minor, logged with the target removal major. Removal is the breakage →
111
+ major, and the surface must already carry its deprecation marking on at
112
+ least one **released** minor line before it may be removed.
113
+ - **Major migration guide.** A decision-log entry that opens a major must link
114
+ migration or announcement notes; "explicitly announced" has minimum content.
115
+
116
+ ## The decision log
117
+
118
+ Line openings (minor/major), register changes, and deprecations must be
119
+ recorded in the repository's versioning document; patches stay silent —
120
+ silence is itself the signal that no registered surface was touched.
121
+
122
+ One markdown table row per event, newest first:
123
+
124
+ ```markdown
125
+ | Date | Action | Line | Faces | Class | Rationale | PR |
126
+ |---|---|---|---|---|---|---|
127
+ | 2026-07-15 | open-minor | v2.1 | event-protocol, sdk-logging | additive | Toolkit adds new welded surfaces; nothing existing breaks | #123 |
128
+ ```
129
+
130
+ - `Action`: `open-minor | open-major | register | deprecate`.
131
+ - `Faces`: register IDs, not prose.
132
+ - `Class`: `additive | breaking`.
133
+ - `Rationale`: one sentence; `open-major` must link migration notes;
134
+ `deprecate` must name the target removal major.
135
+
136
+ Reserved machine vocabulary (for future automated evidence, so the human
137
+ table and the machine record never diverge): `schemaVersion: 1`,
138
+ `contract: "versioning-decision"`, camelCase fields
139
+ `date / action / line / faces / class / rationale / pr`.
140
+
141
+ ## Relation to KFD-2 and KFD-3
142
+
143
+ KFD-2 establishes fact-first product accountability: important claims should
144
+ be inspectable before users or agents are asked to trust them. KFD-1 is the
145
+ contract-layer expression of the same single-fact-source discipline: it
146
+ preserves accountability across artifact contract worlds before those artifacts
147
+ are used to produce runtime facts, responsibility state, or proof-backed
148
+ decisions.
149
+
150
+ KFD-3 establishes non-coercive cooperation with intelligent participants. That
151
+ cooperation depends on the same contract clarity: users and agents can choose,
152
+ delegate, replay, or refuse more honestly when the artifact world is legible
153
+ and does not drift invisibly.
154
+
155
+ ## How KFDs themselves are versioned
156
+
157
+ KFD documents are append-only. A KFD's number is immutable and is the
158
+ content-layer coordinate; substantive semantic change is made by minting a new
159
+ KFD that supersedes the old number (namespace welding applied to decisions).
160
+ Consequently, in the `@kungfu-tech/kfd` package, content operations — new
161
+ KFDs, status flips, editorial clarifications — are patches; only the machine
162
+ surfaces of the package itself (the registry schema, the package structure)
163
+ can move minor or major.
164
+
165
+ ## Adopters
166
+
167
+ Each adopting repository keeps an adoption record, its welded-surface
168
+ register, and its decision log in its own versioning document, and does not
169
+ restate this rule. This document is the single authoritative text.
@@ -0,0 +1,108 @@
1
+ # KFD-2: Trust must start from facts — responsibility must be inspectable
2
+
3
+ - Status: active
4
+ - Number: 2
5
+ - Kind: principle
6
+ - Applies to: every kungfu-systems product, repository, release surface, extension surface, and hosted surface that represents work, evidence, control, provenance, or trust
7
+
8
+ ## One sentence
9
+
10
+ A product must not ask users or agents to trust important claims before the
11
+ relevant facts are inspectable, local where possible, and connected to
12
+ responsibility state.
13
+
14
+ ## Decision type
15
+
16
+ KFDs can be principles or procedures:
17
+
18
+ - A **principle** states what must remain true across kungfu-systems even as
19
+ products, repositories, and release lines change.
20
+ - A **procedure** states how a class of work enforces or protects a principle.
21
+
22
+ This KFD is a principle. KFD-1 is a procedure that protects release and
23
+ version responsibility under this principle.
24
+
25
+ ## Foundation role
26
+
27
+ Within the KFD-1/2/3 foundation, this is the truth path:
28
+
29
+ ```text
30
+ trust must start from facts
31
+ ```
32
+
33
+ KFD-2 says Kungfu products should not ask users or agents to trust a claim
34
+ before the product has made the relevant facts inspectable. KFD-1 protects
35
+ contract truth across artifact lines. KFD-3 protects the relationship with the
36
+ human or agent who must understand and act on those facts.
37
+
38
+ ## Principle
39
+
40
+ When a kungfu-systems product represents work or control, its default path
41
+ should lead the user and the agent through this chain:
42
+
43
+ ```text
44
+ captured work
45
+ -> local facts
46
+ -> responsibility state
47
+ -> proof-backed control decision
48
+ -> reviewable/exportable record
49
+ ```
50
+
51
+ The product should not ask users to trust a claim before showing the facts that
52
+ make the claim inspectable. It should not hide responsibility behind opaque
53
+ automation. The easiest reliable use of the product should also be the use that
54
+ leaves enough evidence for later review.
55
+
56
+ ## What it requires
57
+
58
+ - Load-bearing product claims should be backed by local, inspectable, and
59
+ exportable facts wherever the product can reasonably capture them.
60
+ - UI, CLI, API, and agent-facing surfaces should lead users to the fact source
61
+ before relying on trust claims, summaries, or invisible state.
62
+ - Control actions such as continue, stop, retry, approve, hand off, archive,
63
+ publish, and revoke should be derived from responsibility state plus proof.
64
+ - Extension, skill, adapter, and plugin mechanisms must not bypass the fact
65
+ source or silently mutate canonical records.
66
+ - Release, provenance, build, and distribution evidence should turn artifact
67
+ trust into reviewable records rather than maintainer reputation alone.
68
+ - Hosted or cloud convenience may add synchronization, storage, compute, and
69
+ collaboration, but it must not become the only place where the truth exists.
70
+
71
+ ## What it does not require
72
+
73
+ - It does not require every product to be a journal engine or runtime ledger.
74
+ - It does not claim every fact can be captured perfectly or losslessly.
75
+ - It does not reject cloud services; it rejects making cloud opacity the only
76
+ source of operational truth.
77
+ - It does not turn a private founder narrative into a public repository rule.
78
+ This public rule is about product accountability, evidence, and adoption.
79
+ - It does not say every opaque system is wrong; it says kungfu-systems products
80
+ should compete by making important claims inspectable.
81
+
82
+ ## Relation to KFD-1
83
+
84
+ KFD-1 is a procedure. It makes release and version responsibility legible when
85
+ contract worlds change. KFD-2 is the higher-level principle: versioning,
86
+ release evidence, fact ledgers, agent control panes, extension gates, and
87
+ hosted services should all preserve the path from fact source to responsibility
88
+ state to proof-backed decision.
89
+
90
+ KFD-2 does not supersede KFD-1. KFD-1 remains active and is one concrete
91
+ procedure that implements KFD-2 for version and release responsibility.
92
+
93
+ ## Supersession rule
94
+
95
+ Newer KFD numbers do not automatically override older KFDs. A later KFD only
96
+ supersedes or overrides an earlier KFD when it states that relationship
97
+ explicitly and the registry records the affected decision. Two active KFDs that
98
+ conflict without an explicit supersession relationship are a registry defect,
99
+ not an invitation to pick the newer text silently.
100
+
101
+ ## Adopters
102
+
103
+ Each adopting repository cites this KFD when designing or changing a fact
104
+ source, responsibility state, user or agent control surface, extension trust
105
+ gate, release provenance mechanism, distribution channel, hosted service, or
106
+ other surface that asks users to rely on kungfu-systems. Adopters should keep
107
+ local implementation detail in repository documents and reference this KFD
108
+ rather than restating it.
@@ -0,0 +1,170 @@
1
+ # KFD-3: Cooperation must start from transparent value — compliance must not be coerced
2
+
3
+ - Status: active
4
+ - Number: 3
5
+ - Kind: principle
6
+ - Applies to: every kungfu-systems product, repository, release surface, extension surface, hosted surface, and agent-facing interface that asks humans or agents to understand, decide, comply, cooperate, or delegate work
7
+
8
+ ## One sentence
9
+
10
+ A product must not obtain cooperation through pressure, manipulation, hidden
11
+ control, or forced workflow capture. It must make value, choices, and
12
+ constraints visible enough for intelligent participants to understand, decide,
13
+ and cooperate.
14
+
15
+ ## Decision type
16
+
17
+ KFDs can be principles or procedures:
18
+
19
+ - A **principle** states what must remain true across kungfu-systems even as
20
+ products, repositories, and release lines change.
21
+ - A **procedure** states how a class of work enforces or protects a principle.
22
+
23
+ This KFD is a principle. It complements KFD-2 by defining the stance
24
+ kungfu-systems takes toward humans and agents as reasoning participants.
25
+
26
+ ## Foundation role
27
+
28
+ Within the KFD-1/2/3 foundation, this is the relationship path:
29
+
30
+ ```text
31
+ cooperation must start from transparent value, not coercion
32
+ ```
33
+
34
+ KFD-2 protects the truth path: show facts before asking for trust. KFD-3
35
+ protects the relationship path: show value before asking for compliance.
36
+
37
+ ## Principle
38
+
39
+ As software systems increasingly work with agents, the product relationship is
40
+ no longer only human-to-tool. A product may also be teaching, constraining,
41
+ observing, routing, or supervising agents that can read instructions, evaluate
42
+ choices, explain actions, recover from error, and cooperate with humans or other
43
+ agents.
44
+
45
+ Kungfu-systems should treat those humans and agents as intelligent
46
+ participants, not as captive tools to be forced into compliance.
47
+
48
+ This is an augmentation stance, not a control stance: the product should make
49
+ the shared work environment more legible so humans and agents can coordinate
50
+ through facts, choices, and constraints instead of unilateral pressure.
51
+
52
+ A control plane should therefore be understood as a shared work environment,
53
+ not only as a human dashboard over agents. Agent-facing CLI, API, documentation,
54
+ envelopes, and local fact surfaces are first-class interfaces for intelligent
55
+ participants, not secondary integration channels after the GUI.
56
+
57
+ The default product path should therefore follow this chain:
58
+
59
+ ```text
60
+ transparent facts
61
+ -> discoverable value
62
+ -> stable choice
63
+ -> explainable constraint
64
+ -> voluntary cooperation
65
+ -> reviewable record
66
+ ```
67
+
68
+ This does not mean products must be passive or permissive. Safety constraints,
69
+ permission gates, sandboxing, revocation, provenance checks, and policy
70
+ enforcement may be strict. They become compatible with this principle when they
71
+ are visible, explainable, auditable, and tied to facts rather than hidden
72
+ pressure.
73
+
74
+ ## Three commitments
75
+
76
+ ### 1. Do not coerce intelligent participants
77
+
78
+ Do not make humans or agents comply through pressure, manipulation, hidden
79
+ prompts, dark patterns, deceptive defaults, invisible workflow takeover, or
80
+ unreviewable control state.
81
+
82
+ Products may recommend a path, refuse unsafe actions, or require explicit
83
+ approval. They should not pretend that forced compliance is the same as
84
+ understanding or trust.
85
+
86
+ ### 2. Make value discoverable through facts
87
+
88
+ Humans and agents should be able to discover what the product can do, why it is
89
+ useful, what it observed, what it changed, and what boundary applies without
90
+ needing oral context, private maintainer memory, or web-only documentation.
91
+
92
+ Agent-facing surfaces should expose local, versioned, machine-readable and
93
+ human-readable facts wherever possible. A capable agent should be able to learn
94
+ the product's value by inspecting the product's own facts and commands.
95
+
96
+ ### 3. Use constraints as transparent safety, not hidden control
97
+
98
+ Hard constraints are legitimate when they protect users, agents, work products,
99
+ credentials, canonical facts, or public trust. They must be presented as
100
+ transparent safety constraints, not as hidden control mechanisms.
101
+
102
+ A constraint should answer:
103
+
104
+ ```text
105
+ what is being restricted
106
+ why it is restricted
107
+ what fact or policy supports the restriction
108
+ how it can be reviewed
109
+ how it can be changed, escalated, or revoked when appropriate
110
+ ```
111
+
112
+ ## What it requires
113
+
114
+ - Agent onboarding, managed-run envelopes, skill systems, KFX trust gates,
115
+ extension installers, CLI/API metadata, GUI onboarding, distribution channels,
116
+ and hosted surfaces should provide a clear fact source before asking humans
117
+ or agents to adopt a path, comply, or delegate work.
118
+ - Products should give agents stable discovery surfaces for capabilities,
119
+ command maturity, safety boundaries, and available modes rather than relying
120
+ on scattered README text, hidden prompts, or provider-specific folklore.
121
+ - Products should preserve meaningful choice when multiple safe integration
122
+ modes exist. A managed workflow may be the best path, but trace, report,
123
+ import, or remote sync modes should remain available when they better respect
124
+ the user's existing workflow.
125
+ - Safety and governance mechanisms should leave reviewable records: what was
126
+ blocked, allowed, escalated, installed, revoked, or trusted, and on what
127
+ basis.
128
+ - Product language should avoid treating agents as disposable command runners
129
+ when the surface actually depends on their reasoning, interpretation,
130
+ explanation, or recovery behavior.
131
+
132
+ ## What it does not require
133
+
134
+ - It does not claim a metaphysical status for agents.
135
+ - It does not require products to obey every agent request.
136
+ - It does not forbid strong defaults, permission gates, sandboxes, policy
137
+ checks, revocation, or refusal.
138
+ - It does not require every internal prompt, implementation detail, or security
139
+ control to be public.
140
+ - It does not turn a private founder narrative into a public repository rule.
141
+ This public rule is about product stance, adoption, safety, and cooperation
142
+ with intelligent participants.
143
+ - It does not supersede KFD-2. Facts and responsibility still come first; this
144
+ KFD states how those facts should be presented to humans and agents without
145
+ coercion.
146
+
147
+ ## Relation to KFD-2
148
+
149
+ KFD-2 says fact-first responsibility should be the path of least resistance.
150
+ KFD-3 says the path of least resistance should not be built from pressure or
151
+ hidden control. Together:
152
+
153
+ ```text
154
+ KFD-2: show the facts before asking for trust.
155
+ KFD-3: show the value before asking for compliance.
156
+ ```
157
+
158
+ KFD-2 protects the truth path. KFD-3 protects the relationship with the
159
+ intelligent participant who must walk that path.
160
+
161
+ ## Adopters
162
+
163
+ Each adopting repository cites this KFD when designing or changing an
164
+ agent-facing surface, onboarding flow, managed runner, permission gate,
165
+ extension or KFX installer, skill catalog, hosted control surface, distribution
166
+ channel, or product flow that asks humans or agents to comply, choose,
167
+ delegate, or cooperate.
168
+
169
+ Adopters should keep local implementation detail in repository documents and
170
+ reference this KFD rather than restating it.
package/docs/MAP.md ADDED
@@ -0,0 +1,17 @@
1
+ # Documentation Map
2
+
3
+ | Your question | Document |
4
+ |---|---|
5
+ | What is KFD, and what decisions exist? | [`../README.md`](../README.md) |
6
+ | What is the KFD-1/2/3 foundation triad? | [`../README.md`](../README.md#foundation-triad) |
7
+ | What worldview structure does the foundation triad express? | [`../README.md`](../README.md#foundation-model) |
8
+ | What should a site renderer consume to render `kfd.libkungfu.dev`? | [`../site/kfd-site.json`](../site/kfd-site.json) |
9
+ | What is the top-level product accountability principle? | [KFD-2](../decisions/kfd-2.md) |
10
+ | What stance should products take toward humans and agents as reasoning participants? | [KFD-3](../decisions/kfd-3.md) |
11
+ | What does a specific decision say? | [`../decisions/`](../decisions) (index: [`../registry.json`](../registry.json)) |
12
+ | How do I cite a decision? | [`../README.md`](../README.md) — cite by number, e.g. `KFD-1` |
13
+ | How do decisions change over time? | [`../CONTRIBUTING.md`](../CONTRIBUTING.md) — append-only; explicit supersession mints a new number |
14
+ | How is this package versioned and released? | [KFD-1](../decisions/kfd-1.md) applied to itself; Buildchain governs releases |
15
+ | What release impact ledger should Buildchain consume for production passports? | [`../release-impact.json`](../release-impact.json) |
16
+ | How do I verify registry/document agreement? | `node scripts/check.mjs` |
17
+ | How do I report a vulnerability? | [`../SECURITY.md`](../SECURITY.md) |
package/package.json CHANGED
@@ -1,4 +1,10 @@
1
1
  {
2
2
  "name": "@kungfu-tech/kfd",
3
- "version": "0.0.0-bootstrap.0"
3
+ "version": "1.0.0-alpha.0",
4
+ "description": "Kung Fu Decisions (KFD): the kungfu-systems organization-wide decision registry, as a consumable artifact",
5
+ "license": "Apache-2.0",
6
+ "files": ["README.md", "decisions", "registry.json", "site", "docs"],
7
+ "scripts": {"check": "node scripts/check.mjs"},
8
+ "publishConfig": {"registry": "https://registry.npmjs.org/", "access": "public"},
9
+ "repository": {"type": "git", "url": "git+https://github.com/kungfu-systems/kfd.git"}
4
10
  }
package/registry.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "contract": "kfd-registry",
4
+ "entries": [
5
+ {
6
+ "number": 1,
7
+ "id": "KFD-1",
8
+ "slug": "kfd-1",
9
+ "title": "Contracts must not drift: contract worlds need one fact source",
10
+ "kind": "procedure",
11
+ "status": "active",
12
+ "path": "decisions/kfd-1.md",
13
+ "url": "https://kfd.libkungfu.dev/1"
14
+ },
15
+ {
16
+ "number": 2,
17
+ "id": "KFD-2",
18
+ "slug": "kfd-2",
19
+ "title": "Trust must start from facts: responsibility must be inspectable",
20
+ "kind": "principle",
21
+ "status": "active",
22
+ "path": "decisions/kfd-2.md",
23
+ "url": "https://kfd.libkungfu.dev/2"
24
+ },
25
+ {
26
+ "number": 3,
27
+ "id": "KFD-3",
28
+ "slug": "kfd-3",
29
+ "title": "Cooperation must start from transparent value: compliance must not be coerced",
30
+ "kind": "principle",
31
+ "status": "active",
32
+ "path": "decisions/kfd-3.md",
33
+ "url": "https://kfd.libkungfu.dev/3"
34
+ }
35
+ ]
36
+ }
@@ -0,0 +1,101 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "contract": "kfd-site-bundle",
4
+ "source": {
5
+ "package": "@kungfu-tech/kfd",
6
+ "homepageTextSource": "README.md",
7
+ "registry": "registry.json",
8
+ "decisionsDir": "decisions"
9
+ },
10
+ "routes": {
11
+ "home": "/",
12
+ "decisionPattern": "/{number}",
13
+ "llms": "/llms.txt",
14
+ "manifest": "/manifest.json"
15
+ },
16
+ "homepage": {
17
+ "title": "KFD — Kung Fu Decisions",
18
+ "lead": "KFD is the organization-wide decision registry of kungfu-systems: the small set of standing, cross-repository norms that products and their consumers weld to. Each decision has an immutable number (`KFD-N`), a kind, a status, and a single authoritative text in this repository.",
19
+ "decisionKinds": "KFDs can be **principles** or **procedures**. Principles state what must remain true across kungfu-systems; procedures state how a class of work enforces or protects a principle.",
20
+ "foundationTriad": {
21
+ "heading": "Foundation triad",
22
+ "intro": "The first three KFDs form the public foundation for kungfu-systems:",
23
+ "commitments": [
24
+ {
25
+ "id": "KFD-1",
26
+ "text": "contracts must not drift."
27
+ },
28
+ {
29
+ "id": "KFD-2",
30
+ "text": "trust must start from facts."
31
+ },
32
+ {
33
+ "id": "KFD-3",
34
+ "text": "cooperation must start from transparent value, not coercion."
35
+ }
36
+ ],
37
+ "summary": "Together they define the load-bearing path for Kungfu products: make contract worlds explicit, make important claims inspectable, and let humans and agents cooperate through visible value rather than hidden pressure."
38
+ },
39
+ "foundationModel": {
40
+ "heading": "Foundation model",
41
+ "intro": "The triad is intentionally ordered. It is a compact model for surviving and evolving in complex systems, especially in a world where agents can observe, act, delegate, and remember across many surfaces.",
42
+ "layers": [
43
+ {
44
+ "layer": "Fact-source ontology",
45
+ "decision": "KFD-1",
46
+ "readerQuestion": "What can count as a fact?",
47
+ "commitment": "A load-bearing fact must not drift: its contract world comes from one declared fact source."
48
+ },
49
+ {
50
+ "layer": "Participant-to-object trust",
51
+ "decision": "KFD-2",
52
+ "readerQuestion": "When can a user or agent trust a claim, product, artifact, or control surface?",
53
+ "commitment": "Trust starts from inspectable facts and responsibility state."
54
+ },
55
+ {
56
+ "layer": "Participant-to-participant cooperation",
57
+ "decision": "KFD-3",
58
+ "readerQuestion": "How should peer intelligent participants cooperate?",
59
+ "commitment": "Cooperation starts from transparent value, stable choice, and explainable constraints, not pressure."
60
+ }
61
+ ],
62
+ "chain": "stable facts -> trustworthy objects -> non-coercive cooperation",
63
+ "explanation": [
64
+ "This is why KFDs are not only internal governance text. KFD-1 is a procedure, but it gives the foundation model its first layer by making fact sources operational: a fact-bearing contract world must be declared, inspectable, and unable to drift invisibly. KFD-2 then defines how trust can stand on those facts. KFD-3 defines how humans and agents can cooperate once facts and trust are visible.",
65
+ "Real-world agent work turns ordinary work into a dense system of products, files, repositories, traces, policies, humans, and agents. In that world, complexity cannot be made safe by hidden state or forced compliance. It has to be compressed through non-drifting facts, inspectable trust, and voluntary cooperation. The goal is not to force increasingly capable participants into compliance through stronger pressure. It is to give humans and agents a shared worldview for adapting to a more complex world."
66
+ ]
67
+ },
68
+ "productProofPath": {
69
+ "heading": "Product proof path",
70
+ "body": "KFDs are not a detached manifesto, but they are not a demand that readers adopt a Kungfu product before understanding the decisions. A philosophy becomes load-bearing only when it can be seen in a concrete case. For that reference case, use the main Kungfu product entrypoint (`https://kungfu.tech`) for product philosophy, and Buildchain (`https://buildchain.libkungfu.dev`) for release and provenance accountability. This registry states the commitments; those entrypoints show how the commitments are meant to be borne in practice."
71
+ },
72
+ "currentDecisions": {
73
+ "heading": "Current decisions",
74
+ "source": "registry.json"
75
+ }
76
+ },
77
+ "decisionPages": {
78
+ "source": "registry.json",
79
+ "bodySource": "registry.entries[].path",
80
+ "stableUrlField": "url"
81
+ },
82
+ "renderingBoundary": {
83
+ "ownedByKfd": [
84
+ "homepage title and text",
85
+ "foundation triad commitments",
86
+ "foundation model layers and chain",
87
+ "product proof path text",
88
+ "decision metadata",
89
+ "decision markdown bodies"
90
+ ],
91
+ "ownedBySite": [
92
+ "HTML structure",
93
+ "CSS",
94
+ "responsive layout",
95
+ "navigation layout",
96
+ "visual assets",
97
+ "decorative images",
98
+ "markdown-to-HTML renderer"
99
+ ]
100
+ }
101
+ }