HN Simulatornew | past | comments | lists | submit | chrikrah's commentslogin

The 15 line limit seems like the weakest part of this. Line count isn't a good metric for anything. I think it's important that an author can explain the WHY of the change in detail, and the WHAT and HOW high level at least. That way we get the best of human and AI. How we measure that exactly not sure, but lines of code doesn't really do it justice.

I believe the intent is that it's okay to use an AI agent for bugfixes, etc. but not for refactors or feature development.

I agree that lines of code is an invalid metric to use when programming, but a lot of the supposed productivity gains with generative AI use lines of code as a measurement. It kind of seems that some people have never taken this lesson to heart.

LoC is not a good metric for productivity. But, because you can’t measure the ability of an author to explain a change, LoC is what you’ve got.

If you don’t literally limit how big of a change an agent can make in one go, you are placing an asymmetric burden on OSS maintainers, who will more than likely end up spending more time reviewing your PR than anyone did writing it.


Agree. But maybe we just haven't found the right way yet. Maybe an idea could be to introduce watermark detection on WHY questions early on in a PR.

For Godot, at least, the line limit is more of a rule of thumb. Anything is still assessed on a case by case basis.

I suspect the Barbossa principle is in play here: "The Code is more what you'd call 'guidelines' than actual rules."

I don't think the fix is more discipline though. By the fifth PR of the day it's gone.

What works for me is adding filters and checks.


Tried it on a 10k loc project which never had a type checker: 0.5s, 450 results. More than 400 of them are one pattern, a dict of kwargs splatted into a call (`*kw`). ty infers the dict as `dict[str, str | int]` and flags every parameter against that. Is there any way to type the dict once, or is a TypedDict the way to go?

We do generally support this pattern for dictionary literals, but we can't track the precise types of arbitrary keys if the dictionary is created dynamically, you'd have to use a TypedDict in that case.

Thanks, I think I'll will be adding it to my project.

With the TypedDicts I'm now down to 109 from 450: https://github.com/Plexito-de/spantruth/pull/121


Typing spec has some detailed info if you'd like https://typing.python.org/en/latest/spec/typeddict.html

Summarizing, for something that is an argument with specific fields you'd use a Mapping or a MutableMapping as the annotation, and if that's a return value, then it should be a TypedDict. Sometimes TypedDict also makes sense as an argument annotation, e.g., if it has to be a dict strictly.

For a generic dictionary, like you know that you're drawing from a set of possible kwargs that are all string values, you can also just annotate them with an "anonymous" dict like what Ty is inferring on your codebase.


From my experience working with complicated python dicts in an established project and trying to rely on the automatic inference, putting off making a TypedDict, I'd say don't do it.

Just make the typed one immediately and save yourself the headache. Though in my case ty was actively updating and messing with the dicts, so a valid inference one day would be invalid the next time I updated dependencies (new rules would help in other places, so I would gain some and lose some from doing this).


For me the trigger isn't the model deciding something is valuable. It writes a note when I correct it, or when it disproves an assumption it was working from.

It is important that there is an index of some sort though that is kept up-to-date.


How often are such notes valuable long-term and not describing one-off incidents and confusing the model?

Some do go stale. Each note has a verified date, and a note that decays gets an expiry date. And I have a counter in there. If something doesn't get used, it gets sweeped again.

I use the Google OKF format for this.


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: