Keep one-letter skills without corrupting others - #50
Disesfgewu wants to merge 1 commit into
Conversation
jserv
left a comment
There was a problem hiding this comment.
Indent via make indent and then squash commits without Claude markers.
1496214 to
2ad5ddb
Compare
Sorry about that! I've run make indent, squashed the commits, and pushed the updates. Could you please take another look when you have a moment? Thanks! |
You didn't. Check git manual carefully for |
|
Oops. I check that again. |
2ad5ddb to
618f25b
Compare
|
Check Git Squash Commits: How to Combine Commits Into One by using |
ColtenOuO
left a comment
There was a problem hiding this comment.
It's recommended to make the commit message title relevant to the actual changes, as this helps others quickly understand the updates when reviewing.
That's very helpful advice. I'll apply this practice to my future commits. |
ColtenOuO
left a comment
There was a problem hiding this comment.
As a reminder, once the issue pointed out is fixed, we should add a regression test for it to ensure the bug doesn't come back in future updates.
618f25b to
5af2df8
Compare
jserv
left a comment
There was a problem hiding this comment.
Rebase latest main branch and refine commit messages properly.
1f9eec9 to
a1f91ad
Compare
a1f91ad to
c932cb1
Compare
|
Also, I don't think it's a good idea to describe the collaboration process in the commit body. It should focus on what was actually changed. This issue is still present in the current commit message. |
|
By the way, the PR description might need to be updated to reflect the latest changes, as some parts appear to be outdated. |
For small projects like this, it is acceptable to combine diverse changes into a single pull request, provided that each change has a clear purpose and the overall changes are not extensive enough to make the review difficult, allowing reviewers to still walk through them effectively. |
jserv
left a comment
There was a problem hiding this comment.
Rebase the current branch onto the upstream default branch and rework the series into functionally minimal commits, folding similar ones and enforcing the project's commit message rules.
c272822 to
bf7ab09
Compare
|
Squash the commits touching the same files into one and reword the commit message to reflect the updated state. |
e63a31d to
c8f549a
Compare
jserv
left a comment
There was a problem hiding this comment.
Read https://chris.beams.io/git-commit carefully and enforce the rules.
c8f549a to
1149e07
Compare
ColtenOuO
left a comment
There was a problem hiding this comment.
Please remember to resolve the open comments and add regression tests.
1149e07 to
500155f
Compare
ColtenOuO
left a comment
There was a problem hiding this comment.
There are several strange typos in the PR description. Please clean them up.
500155f to
b9d5fa7
Compare
b9d5fa7 to
e5dc8d3
Compare
| function clean(line) { | ||
| return line.replace(/^[-*•\d.)\s]+/, "").slice(0, textLimit).trim(); | ||
| return line.trimStart() | ||
| .replace(/^(?:(?:-+|\*)\s+|\d+[.)]+(?=\s|\p{L})\s*|•\s*)+/u, "") |
There was a problem hiding this comment.
The numbered-marker regex still uses ASCII-only \d, even though the surrounding filtering is Unicode-aware. JD requirements such as 1. Must know Rust retain their markers as well.
It may be worth tracking in a follow-up PR using \p{Nd}+ with regression tests for both resumes and JDs.
There was a problem hiding this comment.
So, do I need to check this or just keep this in mind?
I've updated the latest PR description here and the commit message.
| // but not the marker itself for these common copy-paste shapes, so the | ||
| // digit case relies on "." or ")" following the digits instead: that still | ||
| // protects "5G" and "3D", which no "." or ")" ever follows. | ||
| const jd = await parseGroundingFile(txt("1.Must know Rust\n1.) Should know Go\n-- Must know Python"), "jd"); |
There was a problem hiding this comment.
The dashed fixture carries a space, so the "dashed marker with no space" half of the name is never exercised: --Must know Python is left intact, because the dash branch still requires \s+. Use that input and make the branch handle it, or narrow the name to the numbered case this actually covers.
There was a problem hiding this comment.
I would narrow the name to the numbered case this actually covers.
| // would have to guess at. | ||
| function unique(values, max) { | ||
| return [...new Set(values.map(clean).filter((value) => value.length >= 2))].slice(0, max); | ||
| return [...new Set(values.map(clean).filter((value) => /\p{L}/u.test(value)))].slice(0, max); |
There was a problem hiding this comment.
Every letterless token goes, and on a systems resume that is the part numbers: 6502, 8051, 68000, 802.3 and 99.999% all cleared the old floor and clear nothing here. The rationale above covers years, percentages and split standards but not bare part numbers, which is the one class the audience named in the first test of this change lists without a letter anywhere near them. Worth saying whether that loss is accepted, since the title's bug (a two-character floor hiding C and R) does not require it.
There was a problem hiding this comment.
However, tokens like 8051 or 6502 are format-wise indistinguishable from years (e.g., 2015) or arbitrary numbers without deeper contextual analysis.
Since we currently lack the context to tell them apart, treating letterless tokens uniformly is a trade-off we accept for now. I would update the PR rationale to explicitly call out this limitation.
A length floor meant to drop stray punctuation also dropped one-letter skills like C and R. Replace it: a token is kept only if it has a letter, so punctuation, "24/7", "100%" and bare numbers like 2015 or 27001 are dropped, whether typed alone or split from a prefix like ISO. Bare part numbers such as 6502 go too, since they look like a year; a named one like MOS 6502 is kept. Without the floor, the marker strip in clean() turned 5G into G. It now strips only a bullet, a run of dashes or asterisks before whitespace, or digits (full-width included) followed by "." or ")" and then whitespace or two letters. So 5G and 9.x Java survive, while 1.Must and ** Must lose their markers.
e5dc8d3 to
0119193
Compare
What
unique()dropped any candidate shorter than two characters, meant to dropstray punctuation left over from a bad split. It also silently dropped
one-letter skills like
CandRbefore a candidate could choose them.Removing that floor exposed a second bug:
clean()'s leading-strip regexswallowed a bare digit run, so
5Glost its5and survived as thefabricated skill
G.Why
unique()now keeps a token only if it has a letter. Punctuation-onlyfragments and bare numbers (
24/7,100%,2015,27001,3.14) aredropped, whether typed alone or split from a prefix like
ISO.ISO 9001and802.11acare kept.6502and8051are dropped too. This is anaccepted loss:
8051and2025have the same shape, so a filter that goesby shape cannot keep one and drop the other. A named part (
MOS 6502,Z80) is kept.clean()now strips only a real list marker: a bullet, a run of dashes orasterisks followed by whitespace, or digits followed by
.or)and thenwhitespace or two letters. Digits are matched with
\p{Nd}, so afull-width
1.counts like1..5G,3D,4Kand9.x Javastay whole, while1. Must,1.Must,** Mustand-- Mustlose theiKnown limits
.is a heuristiitsmarker and
3.js experienceloses its3..--Muis,since stripping it would eat into real content such as
-Java.Testing
node --test tests/browser/document-grounding.test.js: 35 tests pass, withnew coverage for one-letter skills, digit-leded
markers with and without a space, runs of asterisks, version wildcards,
full-width digits, and bare part numbers. `es
Summary by cubic
Fixes grounding extraction so one-letter skills like
CandRsurvive, and5Gis no longer corrupted intoG. The old length floor dropped stray punctuation but also erased one-letter skills; removing it exposedclean()treating bare digit runs as list markers.Changes
clean()now strips only real list markers: bullet glyphs, dash/asterisk runs before whitespace, and digits followed by./)and then whitespace or two letters. Requirement lines still lose1.Mustand** Must, while3Dand9.x Javastay whole.unique()now keeps a token only if it has a letter, so pure punctuation and bare numbers are dropped —24/7,100%,27001,3.14, and part numbers like6502— while named forms likeISO 9001,802.11ac, andMOS 6502survive.Written for commit 0119193. Summary will update on new commits.