Skip to content

Commit b2d6c82

Browse files
authored
fix: remove field context and record maintenance friction (#110)
1 parent 15e69e6 commit b2d6c82

12 files changed

Lines changed: 113 additions & 10 deletions

File tree

‎.claude-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "fdeops",
33
"description": "Forward deployed engineering skills for AI coding agents. One @fde skill for the client work around the code. You confirm; then it lands in .fde/ on your laptop.",
4-
"version": "4.0.1",
4+
"version": "4.0.2",
55
"category": "productivity",
66
"tags": [
77
"community-managed"

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 4.0.2 - 2026-09-14
4+
5+
- Keep complete context packets intact when they fit the requested budget, including compact mode. Oversized packets still retain their byte ceiling and omission warnings.
6+
- Recognize measurable acceptance checks phrased with “observe” while retaining structural checks for a concrete test, result and named signer.
7+
- Show the exact existing reality record fields when formatting needs repair, and point audit guidance to the initialized template.
8+
39
## 4.0.1 - 2026-09-14
410

511
- Make consequential interpretations and reversed instructions visible within the existing debrief review, without adding another approval step.

‎bin/fde.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ function parseReality(md, maxLen) {
846846
if (prose) {
847847
return {
848848
line: '',
849-
missing: 'UNREADABLE - reality.md does not match the schema (Working theory / Evidence / Differs from brief). Not showing the brief as truth.',
849+
missing: 'UNREADABLE - reality.md does not match the schema. Use **Working theory:** / **Evidence:** / **Differs from brief how:** from templates/.fde/reality.md. Not showing the brief as truth.',
850850
}
851851
}
852852
return { line: '', missing: '' }
@@ -2880,7 +2880,7 @@ function successContractIssues(success) {
28802880
if (explicit) return explicit[1].trim().length > 3 && target.test(explicit[2])
28812881
const stimulus = /\b(?:test|drill|replay|runs?|request|sample|given|when|simulate|inject|compare|restore|verified|observed|measured)\b/i.test(check)
28822882
|| /^\d+\s+[a-z]/i.test(check)
2883-
const result = /\b(?:returns?|rejects?|matches?|equals?|arrives?|alerts?|restores?|passes?|fails?|contains?|produces?|shows?|remains?|receives?)\b/i.test(check)
2883+
const result = /\b(?:returns?|rejects?|matches?|equals?|arrives?|alerts?|restores?|passes?|fails?|contains?|produces?|shows?|remains?|receives?|observe)\b/i.test(check)
28842884
|| /\b(?:zero|no duplicate|no missing)\s+[a-z]/i.test(check)
28852885
return stimulus && result && target.test(check)
28862886
})

‎bin/lib/context.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ function boundedSections(sections, maxBytes = DEFAULT_BYTES) {
3333
const footer = '\n\nCONTEXT: selected excerpts, not the complete record or proof of approval. Use fde recall <topic> for relevant evidence. If policy or constraints are truncated, retrieve them before acting. Verify conflicting decisions.\n'
3434
let out = ''
3535
const filled = sections.filter(s => s && s.trim())
36+
// Preserve complete packets before allocating fair shares to oversized ones.
37+
const complete = filled.join('\n\n') + footer
38+
if (Buffer.byteLength(complete) <= maxBytes) return complete
3639
for (let i = 0; i < filled.length; i++) {
3740
const available = maxBytes - Buffer.byteLength(out + footer) - 2
3841
const share = Math.max(0, Math.floor(available / (filled.length - i)))

‎mcp/fdeops-ingest/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fdeops-ingest-mcp",
3-
"version": "4.0.1",
3+
"version": "4.0.2",
44
"private": true,
55
"description": "Thin stdio MCP sink for FDEOps ingest (stage → propose → apply). Zero runtime dependencies.",
66
"bin": {

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fdeops",
3-
"version": "4.0.1",
3+
"version": "4.0.2",
44
"description": "Client delivery tools for Forward Deployed Engineers. One @fde skill, local Markdown engagement records, and an offline dashboard for decisions, evidence, approvals, and next actions.",
55
"bin": {
66
"fdeops": "bin/install.js",

‎plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
33
"name": "fdeops",
4-
"version": "4.0.1",
4+
"version": "4.0.2",
55
"description": "Forward deployed engineering skills for AI coding agents. One @fde skill for the client work around the code. You confirm; then it lands in .fde/ on your laptop.",
66
"author": {
77
"name": "Subash Natarajan",

‎skills/fde/references/audit.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ That's the load-bearing wall. Also establish: the single highest risk right now
4949

5050
**`terrain.md`** - the map as understood now. Honest beats complete: mark unknowns explicitly.
5151

52-
**`reality.md`** - real problem vs stated brief, even if the delta is small.
52+
**`reality.md`** - real problem vs stated brief, even if the delta is small. Preserve the initialized template. If creating or repairing the file, put each bold colon field on its own line with its content after the label: `**Working theory:**`, `**Evidence:**`, `**Differs from brief how:**`.
5353

5454
**`context.md`** - updated so anyone walking in is operational in five minutes.
5555

‎templates/.fde/success.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Success definition
22

3-
<!-- Agreed definition of done. Out-of-scope is as important as in-scope. -->
3+
<!-- Agreed definition of done. Out-of-scope is as important as in-scope.
4+
Example for Done when: Input: replay duplicate event A twice and unique B on staging. Pass when: exactly one dispatch per ID is observed.
5+
Record the customer-side signer separately; this check is not evidence of acceptance. -->
46

57
**Done when:**
68
**Primary value bucket:** <!-- cost-save | risk-mitigation | revenue-uplift (pick one) -->

‎test/context-budget.test.js‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,33 @@ test('fat history cannot displace policy, named signer or the latest sourced dec
9696
assert.doesNotMatch(out.stdout, /Transcript history line 500/)
9797
assert.match(out.stdout, /truncated|omitted/)
9898
})
99+
100+
101+
test('sections that fit retain complete uneven content including separators and footer', () => {
102+
const { boundedSections } = require('../bin/lib/context')
103+
const sections = ['RECORD\n' + '客户🙂'.repeat(180) + '\nENGAGEMENT: fictional-client', '', 'CURRENT ACTION: confirm Tuesday', 'SIGNER: Priya Shah']
104+
const complete = boundedSections(sections, 65536)
105+
const bytes = Buffer.byteLength(complete)
106+
assert.ok(bytes < 4096)
107+
assert.equal(boundedSections(sections, 4096), complete)
108+
assert.equal(boundedSections(sections, bytes), complete)
109+
const clipped = boundedSections(sections, bytes - 1)
110+
assert.ok(Buffer.byteLength(clipped) <= bytes - 1)
111+
assert.match(clipped, /Excerpt truncated/)
112+
assert.doesNotMatch(clipped, /\uFFFD/)
113+
})
114+
115+
test('compact resume preserves a complete fitting packet and still masks private content', t => {
116+
const f = fixture(t)
117+
f.write('context.md', '# Context\n**Phase:** land\n## Next action\nConfirm Tuesday replay\n<private>PRIVATE_PACKET_SENTINEL</private>\n')
118+
f.write('success.md', '# Success\n**Done when:** Replay events; observe exactly one dispatch per ID.\n**Stakeholder who signs off:** Priya Shah [source: meeting:scope]\n')
119+
f.write('decisions.md', '- [2026-09-10] Keep CSV import [source: meeting:scope]\n')
120+
const full = f.run(['resume', '--max-bytes', '65536'])
121+
const compact = f.run(['resume', '--max-bytes', '4096'])
122+
assert.equal(full.status, 0, full.stderr)
123+
assert.equal(compact.status, 0, compact.stderr)
124+
assert.ok(Buffer.byteLength(full.stdout) <= 4096)
125+
assert.equal(compact.stdout, full.stdout)
126+
for (const value of [f.eng, 'Keep CSV import', 'Priya Shah', 'Confirm Tuesday replay']) assert.ok(compact.stdout.includes(value), value)
127+
assert.doesNotMatch(compact.stdout, /Excerpt truncated|PRIVATE_PACKET_SENTINEL/)
128+
})

0 commit comments

Comments
 (0)