Conversation
…truth The workflow ENV-sync now keeps only the 10 most recent /opt/smartsht/.env.bak-gha-* backups instead of accumulating them unbounded. Also documents that the GitHub ENV secret is authoritative (every auto-deploy overwrites the server .env from it), warns against hand-editing the live file, and notes how to verify the loaded env via /health or the boot log.
Move the keep-last-10 prune outside the [ -f /opt/smartsht/.env ] guard so stale backups are pruned on every sync, including runs where the live .env file does not exist. Pruning depends only on the .bak-gha-* files, not the live file.
Make imports honest, block gapped apply_formula without preview, keep critical insights visible, and document the useful-first strategy.
…umber-format-only imports - applyAction: treat explicit Apply of a previewed apply_formula as gap confirmation (confirmGaps=true) so reviewed formulas are not rejected - xlsx import: track numberFormatsApplied so number-format-only workbooks no longer trigger the misleading 'no visual styles applied' warning
…s to full CellFormat (P1.1) P0.5: thumbs-down now opens an inline optional comment field; the rating is recorded on click and re-recorded with the user's own words on submit. P1.1: expose underline, strikethrough, fontFamily, textAlign, verticalAlign, textWrap, and borders through buildFormatPatch, FormatCellsParams, and the format_cells registry schema. Borders accept a shared string or per-side object; align values are enum-validated. Extends formatCellsTool tests.
…fit (P1.2) Expose the existing undoable store layout methods to the agent: - ExecutionContext gains setColumnWidth/setRowHeight/autoFitRows hooks that mutate without pushing history (the handler owns the single undo point, matching the deleteRow convention) - new layoutOps handlers parse column (B, B:D, B,D,F) and row (2, 2:5) specs; auto_fit falls back to all populated rows - register the three tools (category: mutate) so they reach MUTATION_TOOL_NAMES and the LLM tool prompt - layoutOps unit tests for parsers and handlers
…(P1.3) Add parseLayoutPhrase (shared) and route it through both the client agent-parser and server actTemplates so coverage stays aligned: - width: 'set column C width to 200', 'make column B wider', 'widen columns B:D' - height: 'set row 2 height to 40', 'make row 1 taller' - auto-fit: 'auto-fit the rows', 'resize rows to fit content' Patterns are conservative (require explicit column/row + keyword) so the false-positive corpus stays green. Adds phrase + parser + actTemplates tests.
…update and implement plans from docs, p0 complete, check p0.5, started 1.0-5
…reakage Concludes the merge of 9e68548 (Feat/p0 usefulness first, #41). HEAD already contained all of #41's content, so the merge itself is a no-op; resolved by keeping our side, which is a strict superset: P0.3 gap detection extracted to src/lib/formulaGapRisk.ts and wired into the preview path, P0.5 user-entered thumbs-down detail, and P1.4 style_recipe preview support. Fixes four pre-existing breakages on this branch, masked until now by the unresolved conflict markers: - previewBuilders: add the missing detectFormulaRangeGapRisk import; the P0.3 preview path did not compile - styleRecipes.test: use refToCell(row, col) -- cellToRef takes a cell id - parser: add style_recipe and format_as_table to the question-veto set, so "Should I add a total row?" no longer fires a bulk restyle - styleRecipes: drop the dead totalsRow binding, which failed lint:ci (--max-warnings=0) Verified green: lint:ci, typecheck, 1822 unit tests, 344 server tests, 12 realengine golden-set tests.
Reviewer's GuideImplements the remaining Useful First trust, safety, activation, and AI-feedback work, while adding formatting/layout tools and shared natural-language routing with preview-aware execution; it also hardens deployment configuration and resolves CI regressions. Review the shared parser/tool contracts, preview-versus-execution parity, undo behavior, and import/audit messaging closely; the manual P0 smoke-test gate remains outside this PR. Sequence diagram for natural-language formatting and layout executionsequenceDiagram
actor User
participant Chat as ChatPanel
participant Parser as parseMessage
participant PhraseParser as parseLayoutPhrase
participant Handler as ToolHandler
participant Context as ExecutionContext
participant Store as aiExecution
User->>Chat: Enter layout or formatting request
Chat->>Parser: parseMessage(message, sheetContext)
Parser->>PhraseParser: parseLayoutPhrase(message)
PhraseParser-->>Parser: LayoutPhrase
Parser->>Handler: set_column_width / set_row_height / auto_fit
Handler->>Context: pushHistory(description)
Handler->>Context: setColumnWidth / setRowHeight / autoFitRows
Context->>Store: Mutate sheet layout
Store-->>User: Updated layout with one undo point
Sequence diagram for formula gap-risk preview and confirmationsequenceDiagram
actor User
participant Preview as buildActionPreview
participant Risk as detectFormulaRangeGapRisk
participant UI as ApplyRejectPreview
participant Executor as handleApplyFormula
participant Context as ExecutionContext
User->>Preview: Request apply_formula preview
Preview->>Risk: detectFormulaRangeGapRisk(formula, sheet, getComputedValue)
Risk-->>Preview: Warning or null
Preview-->>UI: changes and optional warnings
UI-->>User: Show proposed formula and gap warning
alt User rejects or edits formula
User->>UI: Reject preview
else User confirms safely
UI->>Executor: handleApplyFormula(params)
Executor->>Risk: detectFormulaRangeGapRisk(formula, sheet, getComputedValue)
Risk-->>Executor: Warning or null
Executor->>Context: setCellValue(cell, null, formula)
Context-->>User: Formula applied
else User explicitly confirms gap
UI->>Executor: handleApplyFormula(confirmGaps)
Executor->>Context: setCellValue(cell, null, formula)
Context-->>User: Formula applied with override
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: Comment |
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. The new style recipe and layout paths can persist formulas, filters, formatting, and workbook dimensions based on natural-language parsing, so a misinterpretation could write incorrect totals or alter the sheet before being noticed. The changes are bounded and generally undoable or recomputable, but incorrect persisted values or layout state may need cleanup after reverting.
Lands the remaining P0 (Useful First) items and the first three P1 (competitive polish) items from
docs/strategy/2026-09-24-usefulness-first-strategy.md.P0 — Useful First
@ocean8219/formualizer@^0.9.3; gaps doc refreshed; real-WASM golden set extendedsrc/io/xlsx.tswarns on Excel cached values / dropped styles, surfaced via import metaapply_formulagap detection + Apply/Reject preview;confirmGapsoverrideImportInsightsOverlaywaits for audit/grace, never auto-dismisses on critical/highP1 — Competitive polish
format_cellsextended to the fullCellFormatsurface (underline, strikethrough, fontFamily, align, wrap, borders) —src/lib/formatCellsTool.tsset_column_width/set_row_height/auto_fit—src/agent/toolHandlers/layoutOps.ts+ExecutionContexthooksshared/spreadsheetPhrases.ts,shared/actTemplates.ts)Plus deploy hardening (
.envbackup pruning, ENV source-of-truth).Notable refactor
P0.3 gap detection was extracted out of
columnOps.tsintosrc/lib/formulaGapRisk.tsso the preview path can share it, not just the execute path.columnOps.tsshrinks by ~110 lines as a result.Fixes in the final commit
The branch had four pre-existing breakages, masked until an unresolved merge was cleared:
previewBuilders— missingdetectFormulaRangeGapRiskimport; the P0.3 preview path did not compilestyleRecipes.test—refToCell(row, col);cellToReftakes a cell idparser—style_recipe/format_as_tableadded to the question-veto set, so "Should I add a total row?" no longer fires a bulk restylestyleRecipes— deadtotalsRowbinding, which failedlint:ci(--max-warnings=0)Verification
npm run lint:cinpm run typechecknpm run testnpm run test --prefix servernpm run test:realengineNot covered by this PR
The P0 gate (strategy doc §3, steps 1-6) is a manual smoke test — import a real budget
.xlsx, confirm totals match Excel, 5+ grounded Q&A turns, safe edit with preview/undo. CI cannot verify it. Tracked indocs/verification-backlog.md(items 1-3).🤖 Generated with Claude Code
Summary by Sourcery
Complete the remaining usefulness-first trust and activation work while adding safer formula previews and broader spreadsheet formatting, layout, and natural-language editing capabilities.
New Features:
Bug Fixes:
Enhancements:
Build:
.envbackup pruning and a single environment source of truth.Deployment:
.envbackup pruning and a single environment source of truth.Documentation:
Tests: