Free and open source preferably but if it has to be paid (I don't mind paying if somebody builds a perfect tool for me, I'll donate if it's free) - it is to be single-time payment, not any kind of subscription.
100%-internet-independent. An option to synchronize data over the internet is a nice thing to have but it must be E2E-encrypted (I feel like a manually-set private key symmetric encryption is ok) and support P2P-synchronization via local network.
It should better work on all the platforms but desktop Linux is the most important and minimally-sufficient.
It is to store the data in a format easy to read and modify programmatically. E.g. SQLite (seems the best choice, also does great storing attached files as BLOBs within the DB), XML, JSON or whatever with sane scheme.
A node can be folder/document, a document section with a heading (including subsections), a paragraph (with support for marking particular spans as non-breakable and inserting manual line breaks), a picture (svg, png or jpg), a numbered or bulleted list (of whatever a depth) or its element, a video, an audio, a table, a formula, a piece of code, an attached file (stored within or alongside the database), a link to a node or to an external URL. Something else too perhaps.
It should be possible to attach tags and custom properties to the nodes. Every node should have a UUID. The tagging system should support implications (e.g. if I tag something with "python" tag "programming" tag is applied implicitly). It should be possible to rename tags and merge tags into one.
Full text search (and replace) by content, tag, property etc.
Drag&Drop nodes migration and reordering.
Export a node with all its subnodes into a file, execute a command line with its name substituted and import it back. I am going to use this feature mostly to author documents (markdown, latex, epub etc) and blog posts via Python scripts.
What I want to use it for:
Writing down random ideas and notes, mindmapping, organizing reasonably small files and scanned stuff, writing lecture notes, papers, blog posts and books and all these with all their hierarchy elements (to the sane depth, treating every word as an node or looking inside attached files would be too much) should be 1-st class nodes displayed in the tree and available for the operations.
* Open-source, self-hosted
* Storing the data in some very plain format, as long as it doens't conflict with other features. In fact, I'd wish for it to be plain markdown in individual files on the disk, but (aside from performance problems) I don't imagine it being fully possible. So I'm not sure where the right balance should be, but the point is it is something to strive for, since personal notes is something that should be easily editable/recoverable within minutes in any situation.
* Clients for Android, web, preferrably simple enough API to be able to write plugins for vim/atom/whatever.
* The main document format (let's call it .note further): ok, maybe not really markdown, but something intentionally simple still. The only not-markdown feature I can remember right now that is really necessary is text coloring. Must support block-quotes and tables well. Otherwise, it shouldn't be possible to make any html document you want in the editor.
* Editor UI: pretty much one of the Evernote. Embed images by drag'n'drop (automatically copying them to the server), preserve simple formatting when copying HTML markup from somewhere (like Google Docs do).
* Even though only .note files must be editable, pretty much anything should be easily attachable as a first-class note: picture, audio-file, PDF, etc. Even if the only thing app can do with the file is to upload/download, this still should be considered as much a note as a .note file.
* Auth, obviously. I doubt it's a viable feature to build, but if I'm writing it myself, I'd eventually configure it to log-in the proper user using SSL user-certificate.
* Primary purpose of notetaking app is, actually, reading the notes, not writing them, so this should be simple. The default UI for any saved note should be read-only, w/o unnecessary buttons taking up the space on the screen (especially critical when using the phone).
* Tags attachable to every note (of any format). Search using tags. Tags can be non-ASCII. Tags must be easily searchable and editable in bulk.
* Full-text search.
* Some tags can be marked as "labels", and the label should be the only possible way to organize data: treat them approx. as Gmail does, don't clutter the app with both tree-style navigation and tags. To satisfy the user who really likes trees, treat some symbol in the label (- / |) as the separator, so that "university/biology" and "university/math" would form a tree in the UI.
* Pretty much everything else I can imagine right now is anti-feature. Simple is gold. Well, maybe some sort of versioning is actually useful, but if it's implemented it should not only "just work", but also be obvious for the user to see how it works.
* Treat conflicting changes well (for example, if you lose internet connection on a mobile). Maybe something similar to how git does it: let the use choose?
* Oh, yeah, about lost connections: caching on the clients. All cached data should always be encrypted on the disk (hm, I guess it would conflict with auth by SSL?).
But, it reminds me, there also must be a way to easily link one note to the other you wrote. Which isn't always available.
Which IMHO is the reason why no software for personal managment of stuff will ever be good enough. We all want the perfect tailor-made suit to work with, but we don't wanna go to the tailor and pay for it. And even worst, we grow, we change, so custom-made solution today might not do it tomorrow.
I think for that reason applications with a programatic approach are the real solution for organization like notes or tasks. Something scriptable is a good start for this.