Skip to content

Commit 150e749

Browse files
authored
Merge pull request #304 from eduralph/chore/record-pr-bundles
Record 10 accepted bundles contributed as upstream draft PRs
2 parents 600b369 + 49b4502 commit 150e749

196 files changed

Lines changed: 19788 additions & 79 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

engine/interface/test_bug_7924_child_editor_data_loss.py

Lines changed: 142 additions & 79 deletions
Large diffs are not rendered by default.

results/issue_3214/SUMMARY.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Result — issue 3214 / preformatted-note-fontsize-reset-to-default
2+
3+
## 1. Spec (from brief.md) ← Check verifies against THIS
4+
- Defect / goal: In the Note editor, changing a (preformatted) note's font size away from the
5+
- Success criterion: Applying a style value equal to its default leaves the text with **no
6+
- Repo + branch target: gramps-project/gramps @ maintenance/gramps61
7+
- Scope (one logical fix) / out of scope: the `int` (and, for consistency, `str`) branch of
8+
9+
## 2. Disposition claimed ← sign-off confirms or overrides
10+
- Outcome: likely-fix
11+
- Confidence: medium
12+
- Recommendation: (set by Do)
13+
14+
## 3. Correctness (Check — chain)
15+
- C1 Spec: none — brief.md
16+
- C2 Reproduction (red pre-fix): none — (no gate configured)
17+
- C3 Change: none — patch.diff
18+
- C4 fix verified: test red pre-fix, green post-fix: pass — C4-verify: green-with-fix=PASS / red-without-fix=PASS
19+
- C5 test exercises the production path (not a copy): pass — added test(s) import the production package 'gramps'
20+
21+
## 4. Conformance (Check — stack)
22+
- T1 structure: addon layout vs doc 16 §Structure (folder==id, target_version, fname, no __init__.py): pass — T1 – N/A: no addons-source path in patch.diff (core-only change; §Structure is addon-only)
23+
- T2 shape: code shape vs doc 16 §Coding style (GPL header on touched files; print() advisory for reviewer): pass — T2 ✓ shape: 1 file(s) conform to doc 16 §Coding style
24+
- T2 potfiles: new/removed core .py registered in po/POTFILES.in|.skip (doc 16 §Adding and removing Python files): pass — T2 ✓ potfiles: new/removed core .py registered (doc 16 §Adding and removing Python files)
25+
- T3 runtime: gramps core unit suite (whole-suite baseline): pass — T3-baseline [baseline]: matches recorded baseline: 7 known test red(s) | ⚠ baseline tree drift: recorded detached@674e3b
26+
- T4 contribution: commit/PR wrapper vs doc 16 §Commit messages + §Contributor workflow: pass — T4 – N/A: no commit-msg.txt or pr-description.md in the bundle
27+
- T5 Judgment: none — reviewer + human sign-off
28+
- T5 judgment: → see §5.
29+
30+
## 5. Advisory review (artifact-only, decorrelated)
31+
Reviewer ran without build-notes.md. Summary:
32+
33+
Reviewing issue 3214: applying a default styled-text value, especially FONTSIZE=10, must clear any explicit tag so a note returns to the same stored state as an untouched note.
34+
35+
| Item | Verdict | Basis |
36+
|---|---|---|
37+
| C1 — C1 Spec | PASS | The brief states the defect, invariant, success criterion, scope, and expected test surface explicitly at brief.md:6, brief.md:13, brief.md:17, brief.md:27, and brief.md:38. |
38+
| C2 — C2 Reproduction (red pre-fix) | PASS | The pre-fix target unconditionally reapplies str/int tags after removal at /home/eddie/gramps/gramps/gramps/gui/widgets/styledtextbuffer.py:476 and /home/eddie/gramps/gramps/gramps/gui/widgets/styledtextbuffer.py:480, while FONTSIZE defaults to 10 at /home/eddie/gramps/gramps/gramps/gen/lib/styledtexttagtype.py:99; the added test's 12-then-default assertion at patch.diff:110 would fail on that code. |
39+
| C3 — C3 Change | PASS | The patch removes prior str/int tags and skips reapplying when the value equals STYLE_DEFAULT at patch.diff:7 and patch.diff:13, directly matching the requested invariant. |
40+
| C4 — C4 Verification (red→green) | NEEDS-HUMAN | DECISION OWED: The human must decide whether to accept the patch after rerunning verification on the intended maintenance/gramps61 worktree, because this target is on master at aef9f35 and full apply fails only in stale POTFILES context, while direct unittest execution here aborts before tests with ResourcePath.ERROR for missing build/share; this is an environment/target-state caveat, not observed patch failure. |
41+
| C5 — C5 Causal adequacy | PASS | The change is at the causal write point reached by the public apply path: apply_style delegates to _apply_style_to_selection at /home/eddie/gramps/gramps/gramps/gui/widgets/styledtextbuffer.py:674 and /home/eddie/gramps/gramps/gramps/gui/widgets/styledtextbuffer.py:689, and the test drives apply_style then inspects StyledText tags at patch.diff:116 and patch.diff:123. |
42+
| T1 — T1 Structure | N/A | No addon-source path is introduced; check-gates marks structure addon-only and N/A for this core-only change at check-gates.json:51. |
43+
| T2 — T2 Shape | PASS | The new test has the project GPL header at patch.diff:27 and is registered in POTFILES.skip at patch.diff:164; automated gates report shape and potfiles pass at check-gates.json:60 and check-gates.json:69. |
44+
| T3 — T3 Runtime | NEEDS-HUMAN | DECISION OWED: The human must decide whether the whole-suite runtime gate can be deferred or rerun in a valid lane, because check-gates reports a pre-test crash with no JUnit XML at check-gates.json:78 and check-gates.json:82, which does not identify a regression in this patch. |
45+
| T4 — T4 Contribution | N/A | No commit-msg.txt or pr-description.md is present in the artifact bundle, and the contribution gate is explicitly N/A at check-gates.json:87. |
46+
| T5 — T5 Judgment | NEEDS-HUMAN | DECISION OWED: The human must sign off that the localized guard plus focused regression tests are enough risk coverage for this core widget path, given no full-suite runtime result was obtained. |
47+
| V — Validation — fitness-to-purpose | NEEDS-HUMAN | DECISION OWED: The human must validate fitness-to-purpose for the Note editor/report workflow, because artifact review verifies the data-model invariant but does not manually confirm rendered report behavior in the application. |
48+
49+
## §6 Human Clearances
50+
51+
1. C4 Verification: rerun the added test on the intended maintenance/gramps61 target, or explicitly accept the static red/green evidence plus the target-state caveat.
52+
2. T3 Runtime: rerun the core runtime suite in a valid lane, or explicitly waive the infrastructure pre-test crash reported by the gate.
53+
3. T5 Judgment: decide whether the change/test scope is sufficient without broader runtime evidence.
54+
4. V Validation: manually confirm the Note editor/report outcome if release confidence requires the rendered workflow, using: select note text, set font size 12, set it back to 10, save, and confirm stored StyledText has no FONTSIZE tag and report rendering matches an untouched note.
55+
56+
57+
## 6. NEEDS-HUMAN — items the human must clear before sign-off
58+
- [x] C4 — C4 Verification (red→green) — DECISION OWED: The human must decide whether to accept the patch after rerunning verification on the intended maintenance/gramps61 worktree, because this target is on master at aef9f35 and full apply fails only in stale POTFILES context, while direct unittest execution here aborts before tests with ResourcePath.ERROR for missing build/share; this is an environment/target-state caveat, not observed patch failure.
59+
- [x] T3 — T3 Runtime — DECISION OWED: The human must decide whether the whole-suite runtime gate can be deferred or rerun in a valid lane, because check-gates reports a pre-test crash with no JUnit XML at check-gates.json:78 and check-gates.json:82, which does not identify a regression in this patch.
60+
- [x] T5 — T5 Judgment — DECISION OWED: The human must sign off that the localized guard plus focused regression tests are enough risk coverage for this core widget path, given no full-suite runtime result was obtained.
61+
- [x] V — Validation — fitness-to-purpose — DECISION OWED: The human must validate fitness-to-purpose for the Note editor/report workflow, because artifact review verifies the data-model invariant but does not manually confirm rendered report behavior in the application.
62+
63+
## 7. Proven / not proven
64+
- Proven by which oracle: gates overall = pass (stub oracles).
65+
- Unproven / needs manual run: anything flagged in §6.
66+
67+
## 8. Ready-to-ship attachments
68+
- patch.diff
69+
- tracker-comment.md (ALWAYS, every tracker item)
70+
- build-notes.md (builder rationale — for the human, not the reviewer)
71+
72+
## 9. Check sign-off ← human completes Check here
73+
- Disposition confirmed / overridden:
74+
- Outcome: merged-wider
75+
- Iteration delta (if iterating):
76+
- By / date: Eduard Ralph / 2026-07-02
77+
78+
## 10. Act candidates (hints for the next Act review)
79+
- (empty is the common case)

results/issue_3214/brief.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Brief — issue 3214 / preformatted-note-fontsize-reset-to-default
2+
3+
> The Plan artifact (docs 02 §PLAN). Human-authored. Do reads ONLY this file.
4+
5+
- **Slug:** preformatted-note-fontsize-reset-to-default
6+
- **Defect:** In the Note editor, changing a (preformatted) note's font size away from the
7+
default (10) and then back to 10 does **not** clear the FONTSIZE style: the buffer removes
8+
the old FONTSIZE tag and then unconditionally applies a new *explicit* FONTSIZE=10 tag, even
9+
though 10 is the style default. The note looks fine in the editor, but reports apply that
10+
explicit size as an absolute override on top of the report's Preformatted paragraph style,
11+
so the rendered size differs from an unchanged note — and the user cannot get back to the
12+
original.
13+
- **Success criterion:** Applying a style value equal to its default leaves the text with **no
14+
explicit tag for that style** — identical to a note whose size was never changed. Demonstrable
15+
by driving the buffer's style-apply path with FONTSIZE = default and asserting the resulting
16+
`StyledText` carries no FONTSIZE tag (red pre-fix: a FONTSIZE tag persists; green post-fix: none).
17+
- **Invariant to restore:** Setting a character-style value equal to `StyledTextTagType.STYLE_DEFAULT[style]`
18+
must leave the selection in the same tagged state as if the style had never been applied — no
19+
residual absolute override. The buffer's OWN clear path already honours this
20+
(`clear_selection` only removes a tag when `value != STYLE_DEFAULT[style]`,
21+
`gramps/gui/widgets/styledtextbuffer.py:521`); the apply path must uphold the same invariant.
22+
- **Repo + branch target:** gramps-project/gramps @ maintenance/gramps61
23+
- **Surfaces:** data — the defect is in the `StyledTextBuffer` tag model; the regression test
24+
drives the production apply method and inspects the resulting `StyledText` tags. No E2E through
25+
the app is required (a unit test that imports the buffer is sufficient).
26+
- **Difficulty:** low — a localized guard in one method.
27+
- **Scope:** the `int` (and, for consistency, `str`) branch of
28+
`StyledTextBuffer._apply_style_to_selection` (`gramps/gui/widgets/styledtextbuffer.py:476-483`)
29+
applies a tag even when `value == StyledTextTagType.STYLE_DEFAULT[style]`; it must skip applying
30+
an explicit tag for the default value (after removing any prior one), so no override is written.
31+
/ out of scope: the docgen absolute-size handling (correct once no explicit default tag exists);
32+
the `bool`-style branch; any refactor of the style-state machinery.
33+
- **Repro instruction:** Note editor on a Preformatted note: select text, set Font size to 12, then
34+
back to 10 — the stored `StyledText` retains a FONTSIZE=10 tag, and a text report renders it at a
35+
size differing from the Preformatted default. Unit form: exercise the buffer's style-apply path
36+
with `FONTSIZE = STYLE_DEFAULT[FONTSIZE]` and assert `get_text()` / the retrieved `StyledText`
37+
has no FONTSIZE tag.
38+
- **Test file:** gramps/gui/widgets/test/styledtextbuffer_test.py — a headless unit test that
39+
exercises the PRODUCTION method (`_apply_style_to_selection`, via the buffer's public apply path)
40+
— NOT a parallel copy — and asserts no explicit tag remains after setting the default. Must fail
41+
pre-fix, pass post-fix.
42+
- **Citations expected:** Do must cite path:line on maintenance/gramps61 for every change.
43+
- **New/removed files:** adds `gramps/gui/widgets/test/styledtextbuffer_test.py` (a test, no
44+
translatable strings) → register in `po/POTFILES.skip`; add its `test/__init__.py` if the dir is new.
45+
- **Prior-art check (triage cycles):** searched `gramps/gui/widgets/styledtextbuffer.py` on
46+
maintenance/gramps61 — `_apply_style_to_selection` (:476) applies unconditionally; `clear_selection`
47+
(:502-522) already guards on `value != STYLE_DEFAULT`. Editor combo path at
48+
`gramps/gui/widgets/styledtexteditor.py:657-663`; docgens apply FONTSIZE absolutely (e.g.
49+
`latexdoc.py`). No fix in git history.
50+
- **Mantis:** 3214
51+
- **Disposition hint:** likely-fix
52+
53+
## STOP discipline
54+
55+
Draft only until Check sign-off. Pushing to a feature/draft branch and opening a draft PR MAY
56+
happen during the cycle (useful for CI). The PR MUST NOT be marked ready before sign-off accepts.

0 commit comments

Comments
 (0)